Ejemplo n.º 1
0
    $t->replace('FOOTER', 'footer.html');
    $t->replace('JAVASCRIPT_LIBS', 'javascript.libs.php');
    $t->replace('JAVASCRIPT_CHRIS', 'javascript.chris.html');
    $t->replace('USERNAME', ucfirst($_SESSION['username']));
    $t->replace('CHRIS_VERSION', CHRIS_VERSION);
    // ui
    $t->replace('CHRIS_UI_CHECKBOX', 'ui_checkbox.html');
    if (CHRIS_MAINTENANCE) {
        $t->replace('MAINTENANCE', 'display:block');
    } else {
        $t->replace('MAINTENANCE', 'display:none');
    }
    return $t;
}
// check if this is a logout attempt
if (SecurityC::logout_attempt()) {
    echo 'LOGOUT ATTEMP' . PHP_EOL;
    // perform the logout
    SecurityC::logout();
    exit;
}
// check if this is a login attempt
if (SecurityC::login_attempt()) {
    // login could be requested using a session or a post request
    // perform the login
    if (!SecurityC::login()) {
        // invalid credentials
        // destroy the session
        session_destroy();
        // .. and forward to the sorry page
        header('Location: ?sorry');