Exemple #1
0
function pathos_sessions_validate()
{
    global $db;
    if (pathos_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) {
            pathos_sessions_logout();
            define('SITE_403_HTML', SESSION_TIMEOUT_HTML);
            return;
        }
        global $user;
        $user = $_SESSION[SYS_SESSION_KEY]['user'];
        if ($ticket->refresh == 1) {
            pathos_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);
}
Exemple #2
0
function pathos_users_logout()
{
    pathos_sessions_logout();
}