Minor updates

git-svn-id: file:///svn/phpbb/trunk@5186 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2005-07-17 14:51:57 +00:00
parent 7520a51ea6
commit 540ef9d5b6

View file

@ -32,7 +32,6 @@ class session
* running on a system which makes such information readily available) and * running on a system which makes such information readily available) and
* halt if it's above an admin definable limit. * halt if it's above an admin definable limit.
* *
* @todo Review page discovery code
* @todo Introduce further user types, bot, guest * @todo Introduce further user types, bot, guest
* @todo Change user_type (as above) to a bitfield? user_type & USER_FOUNDER for example * @todo Change user_type (as above) to a bitfield? user_type & USER_FOUNDER for example
*/ */
@ -339,10 +338,10 @@ class session
$SID = '?sid='; $SID = '?sid=';
if (!$bot) if (!$bot)
{ {
$cookie_expire = ($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000; $cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000);
$this->set_cookie('u', $this->cookie_data['u'], $this->time_now + $cookie_expire); $this->set_cookie('u', $this->cookie_data['u'], $cookie_expire);
$this->set_cookie('k', $this->cookie_data['k'], $this->time_now + $cookie_expire); $this->set_cookie('k', $this->cookie_data['k'], $cookie_expire);
$this->set_cookie('sid', $this->session_id, 0); $this->set_cookie('sid', $this->session_id, 0);
$SID = '?sid=' . $this->session_id; $SID = '?sid=' . $this->session_id;
@ -404,9 +403,11 @@ class session
} }
$this->set_cookie('u', '', $this->time_now - 31536000); $cookie_expire = $this->time_now - 31536000;
$this->set_cookie('k', '', $this->time_now - 31536000); $this->set_cookie('u', '', $cookie_expire);
$this->set_cookie('sid', '', $this->time_now - 31536000); $this->set_cookie('k', '', $cookie_expire);
$this->set_cookie('sid', '', $cookie_expire);
unset($cookie_expire);
$SID = '?sid='; $SID = '?sid=';
$this->session_id = ''; $this->session_id = '';
@ -516,16 +517,6 @@ class session
break; break;
} }
// Now we'll clean autologin keys which have expired, i.e.
// where users have not logged in for an admin defined number
// of days
if ($config['allow_autologin'] && $config['max_autologin_time'])
{
$sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
WHERE last_login < ' . (time() - ((int) $config['max_autologin_time'] * 86400));
$db->sql_query($sql);
}
return; return;
} }