1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

- some changes to the recent session change

- display errors on inserting sessions
- fix database updater

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8438 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2008-03-18 10:14:37 +00:00
parent afba17e562
commit 221001a6dc
5 changed files with 27 additions and 22 deletions

View File

@@ -130,7 +130,7 @@ class session
'root_script_path' => str_replace(' ', '%20', htmlspecialchars($root_script_path)),
'page' => $page,
'forum' => (isset($_REQUEST['f']) && $_REQUEST['f'] > 0) ? (int) $_REQUEST['f'] : 0,
'forum' => (isset($_REQUEST['f']) && $_REQUEST['f'] > 0) ? (int) $_REQUEST['f'] : 0,
);
return $page_array;
@@ -185,11 +185,6 @@ class session
$this->forwarded_for = '';
}
// Add forum to the page for tracking online users - also adding a "x" to the end to properly identify the number
$this->page['page'] .= (isset($_REQUEST['f'])) ? ((strpos($this->page['page'], '?') !== false) ? '&' : '?') . '_f_=' . (int) $_REQUEST['f'] . 'x' : '';
if (isset($_COOKIE[$config['cookie_name'] . '_sid']) || isset($_COOKIE[$config['cookie_name'] . '_u']))
{
$this->cookie_data['u'] = request_var($config['cookie_name'] . '_u', 0, false, true);
@@ -614,6 +609,8 @@ class session
// Limit new sessions in 1 minute period (if required)
if (empty($this->data['session_time']) && $config['active_sessions'])
{
$db->sql_return_on_error(false);
$sql = 'SELECT COUNT(session_id) AS sessions
FROM ' . SESSIONS_TABLE . '
WHERE session_time >= ' . ($this->time_now - 60);
@@ -629,6 +626,9 @@ class session
}
}
// Since we re-create the session id here, the inserted row must be unique. Therefore, we display potential errors.
$db->sql_return_on_error(false);
$this->session_id = $this->data['session_id'] = md5(unique_id());
$sql_ary['session_id'] = (string) $this->session_id;
@@ -638,8 +638,6 @@ class session
$sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);
$db->sql_return_on_error(false);
// Regenerate autologin/persistent login key
if ($session_autologin)
{