From bfa6f1d18a6eba3f323282266a977088ce2d1412 Mon Sep 17 00:00:00 2001 From: Tom Beddard Date: Thu, 5 Jan 2006 21:22:44 +0000 Subject: [PATCH] Prevents an occasional error where the $this->data['session_time'] is undefined. git-svn-id: file:///svn/phpbb/trunk@5428 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/session.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index a1086cb3bd..850c063135 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -382,16 +382,21 @@ class session global $SID, $db, $config; $sql = 'DELETE FROM ' . SESSIONS_TABLE . " - WHERE session_id = '" . $db->sql_escape($this->session_id) . "' + WHERE session_id = '" . $db->sql_escape($this->session_id) . "' AND session_user_id = " . (int) $this->data['user_id']; $db->sql_query($sql); if ($this->data['user_id'] != ANONYMOUS) { // Delete existing session, update last visit info first! + if ( !isset($this->data['session_time']) ) + { + $this->data['session_time'] = time(); + } + $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_lastvisit = ' . (int) $this->data['session_time'] . ' - WHERE user_id = ' . (int) $this->data['user_id']; + SET user_lastvisit = ' . (int) $this->data['session_time'] . ' + WHERE user_id = ' . (int) $this->data['user_id']; $db->sql_query($sql); if ($this->cookie_data['k'])