Ejemplo n.º 1
0
            $err->errorEvent(WARNING_FAILED_LOGIN, "Failed login attempt for username" . $_POST['username']);
            $message = "Username / Password incorrect - contact your system adminstrator for a password reset if required";
        }
    } else {
        $err = Errors::getInstance();
        // note we don't include username as it may contain invalid characters
        $err->errorEvent(WARNING_INVALID_LOGIN, "Invalid login attempt");
        $message = "Invalid login - contact your system adminstrator for a password reset if required";
    }
}
/***if not from a post or if a failed then we give login screen***/
// show expired message
if ($message == '' && isset($_GET['status']) && $_GET['status'] == '-2') {
    $message = "Login expired";
}
// default is to go to index page
$goto = 'aindex';
// do we have a valid alternative to go to
if (isset($_POST['location']) && $auth->securityCheck('location', $_POST['location'], $locations)) {
    $goto = $_POST['location'];
} elseif (isset($_GET['location']) && $auth->securityCheck('location', $_GET['location'], $locations)) {
    $goto = $_GET['location'];
}
// header template
$templates->includeTemplate('header', 'admin');
print "<h1>Adminstration Login</h1>";
// Error message if appropriate
print "<p class=\"" . CSS_CLASS_MESSAGE . "\">{$message}</p>\n";
$auth->loginForm(ADMIN_LOGIN_FILE, $goto);
// footer template
$templates->includeTemplate('footer', 'admin');