示例#1
0
function exponent_users_logout()
{
    exponent_sessions_logout();
}
function exponent_sessions_validate()
{
    global $db;
    if (exponent_sessions_loggedIn()) {
        $ticket = $db->selectObject('sessionticket', "ticket='" . $_SESSION[SYS_SESSION_KEY]['ticket'] . "'");
        $timeoutval = SESSION_TIMEOUT;
        if ($timeoutval < 300) {
            $timeoutval = 300;
        }
        if ($ticket == null || $ticket->last_active < time() - $timeoutval) {
            exponent_sessions_logout();
            define('SITE_403_HTML', SESSION_TIMEOUT_HTML);
            return;
        }
        global $user;
        $user = $_SESSION[SYS_SESSION_KEY]['user'];
        if ($ticket->refresh == 1) {
            exponent_permissions_load($user);
            $db->updateObject($ticket, 'sessionticket', "ticket='" . $ticket->ticket . "'");
        }
        $ticket->refresh = 0;
        $ticket->last_active = time();
        $db->updateObject($ticket, 'sessionticket', "ticket='" . $ticket->ticket . "'");
    }
    define('SITE_403_HTML', SITE_403_REAL_HTML);
}