From 548cc2c10b56cc9e5c71c2f87356947939abe888 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 15 Nov 2006 15:35:50 +0000 Subject: - fixes for the following bugs: #5326 #5318 #5304 #5290 #5288 #5278 #5276 #5272 #5266 - also fixed the "Call-time pass-by-reference" bug #5252 - within this step changed the normalize calls to require references. - added captcha size variables to the class scope (suggestion was posted at area51) git-svn-id: file:///svn/phpbb/trunk@6584 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/session.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/session.php') diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index b69bcc5f44..21180bd9a5 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -450,7 +450,6 @@ class session $this->check_ban($this->data['user_id'], $this->ip); } - $this->data['is_registered'] = (!$bot && $this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false; $this->data['is_bot'] = ($bot) ? true : false; @@ -471,6 +470,8 @@ class session // Only update session DB a minute or so after last update or if page changes if ($this->time_now - $this->data['session_time'] > 60 || ($this->update_session_page && $this->data['session_page'] != $this->page['page'])) { + $this->data['session_time'] = $this->data['session_last_visit'] = $this->time_now; + $sql_ary = array('session_time' => $this->time_now, 'session_last_visit' => $this->time_now, 'session_admin' => 0); if ($this->update_session_page) @@ -481,6 +482,12 @@ class session $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE session_id = '" . $db->sql_escape($this->session_id) . "'"; $db->sql_query($sql); + + // Update the last visit time + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_lastvisit = ' . (int) $this->data['session_time'] . ' + WHERE user_id = ' . (int) $this->data['user_id']; + $db->sql_query($sql); } $SID = '?sid='; -- cgit v1.2.1