Esempio n. 1
0
        $smarty->display('footer.tpl');
        die;
    } else {
        // tried to authenticate the user, but failed
        // show error message
        $smarty->display('header.tpl');
        show_smarty_error($smarty, 'ERR_WRONG_PASSWORD', '');
        $smarty->display('footer.tpl');
    }
}
if ($admin_action == '' && $admin_routine == '' && $authentication_success) {
    // workaround for saved password autologin
} else {
    if ($admin_action == 'exit' || $token !== assign($_REQUEST['token'])) {
        $cookie_exp_time = 1;
        $pony_db->remove_auth_cookie($auth_cookie);
        setcookie($config_cookie_name, '', $cookie_exp_time);
        // destroy session
        $_SESSION = array();
        if (ini_get("session.use_cookies")) {
            $params = session_get_cookie_params();
            setcookie(session_name(), '', time() - 42000, $params["path"], $params["domain"], $params["secure"], $params["httponly"]);
        }
        // redirect to authentication page
        header('Location: ' . $self_file);
        session_destroy();
        die;
    }
}
if (!$authentication_success) {
    // authentication failed, stop script execution