mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-18 23:51:49 +02:00
@@ -553,26 +553,15 @@ class session
|
|||||||
$method = basename(trim($config['auth_method']));
|
$method = basename(trim($config['auth_method']));
|
||||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
||||||
|
|
||||||
if ($user_id !== false && !sizeof($this->data))
|
|
||||||
{
|
|
||||||
$this->cookie_data['k'] = '';
|
|
||||||
$this->cookie_data['u'] = $user_id;
|
|
||||||
|
|
||||||
$sql = 'SELECT *
|
|
||||||
FROM ' . USERS_TABLE . '
|
|
||||||
WHERE user_id = ' . (int) $this->cookie_data['u'] . '
|
|
||||||
AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')';
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
$this->data = $db->sql_fetchrow($result);
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
$bot = false;
|
|
||||||
}
|
|
||||||
else if (!$bot)
|
|
||||||
{
|
|
||||||
$method = 'autologin_' . $method;
|
$method = 'autologin_' . $method;
|
||||||
if (function_exists($method))
|
if (function_exists($method))
|
||||||
{
|
{
|
||||||
$this->data = $method();
|
$user_data = $method();
|
||||||
|
|
||||||
|
if ($user_id === false || (isset($user_data['user_id']) && $user_id == $user_data['user_id']))
|
||||||
|
{
|
||||||
|
$this->data = $user_data;
|
||||||
|
}
|
||||||
|
|
||||||
if (sizeof($this->data))
|
if (sizeof($this->data))
|
||||||
{
|
{
|
||||||
@@ -592,11 +581,31 @@ class session
|
|||||||
AND k.user_id = u.user_id
|
AND k.user_id = u.user_id
|
||||||
AND k.key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'";
|
AND k.key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
$user_data = $db->sql_fetchrow($result);
|
||||||
|
|
||||||
|
if ($user_id === false || (isset($user_data['user_id']) && $user_id == $user_data['user_id']))
|
||||||
|
{
|
||||||
|
$this->data = $user_data;
|
||||||
|
$bot = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($user_id !== false && !sizeof($this->data))
|
||||||
|
{
|
||||||
|
$this->cookie_data['k'] = '';
|
||||||
|
$this->cookie_data['u'] = $user_id;
|
||||||
|
|
||||||
|
$sql = 'SELECT *
|
||||||
|
FROM ' . USERS_TABLE . '
|
||||||
|
WHERE user_id = ' . (int) $this->cookie_data['u'] . '
|
||||||
|
AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')';
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
$this->data = $db->sql_fetchrow($result);
|
$this->data = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
$bot = false;
|
$bot = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Bot user, if they have a SID in the Request URI we need to get rid of it
|
// Bot user, if they have a SID in the Request URI we need to get rid of it
|
||||||
// otherwise they'll index this page with the SID, duplicate content oh my!
|
// otherwise they'll index this page with the SID, duplicate content oh my!
|
||||||
|
Reference in New Issue
Block a user