diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2008-03-27 16:17:54 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2008-03-27 16:17:54 +0000 |
commit | b2521b83b1a5c35c4c5df9c90515eb3d90cdab4d (patch) | |
tree | 857d9a04c03c495acd426689090ef39637e4f18d /phpBB/includes | |
parent | 976e83351a2c7e784e4968722dee40f59e6932b1 (diff) | |
download | forums-b2521b83b1a5c35c4c5df9c90515eb3d90cdab4d.tar forums-b2521b83b1a5c35c4c5df9c90515eb3d90cdab4d.tar.gz forums-b2521b83b1a5c35c4c5df9c90515eb3d90cdab4d.tar.bz2 forums-b2521b83b1a5c35c4c5df9c90515eb3d90cdab4d.tar.xz forums-b2521b83b1a5c35c4c5df9c90515eb3d90cdab4d.zip |
some corrections to let the update work flawlessly.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8475 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions.php | 4 | ||||
-rw-r--r-- | phpBB/includes/session.php | 17 |
2 files changed, 18 insertions, 3 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 6363dd0264..2388ae66b4 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3116,8 +3116,8 @@ function obtain_guest_count($forum_id = 0) $reading_sql = ''; } $time = (time() - (intval($config['load_online_time']) * 60)); - - // Get number of online guests + + // Get number of online guests if ($db->sql_layer === 'sqlite') { diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 382f76aca3..da54a6c512 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -311,9 +311,24 @@ class session $sql_ary['session_forum_id'] = $this->page['forum']; } + $db->sql_return_on_error(true); + $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); + $result = $db->sql_query($sql); + + $db->sql_return_on_error(false); + + // If the database is not yet updated, there will be an error due to the session_forum_id + // @todo REMOVE for 3.0.2 + if ($result === false) + { + unset($sql_ary['session_forum_id']); + + $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); + } } $this->data['is_registered'] = ($this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false; |