mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-21 18:44:37 +02:00
Merge branch 'develop-olympus' into develop-ascraeus
* develop-olympus: [ticket/13138] Do not use cookie data and autologin while forcing a user_id Conflicts: phpBB/phpbb/session.php
This commit is contained in:
@ -577,6 +577,22 @@ class session
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
$provider_collection = $phpbb_container->get('auth.provider_collection');
|
||||
$provider = $provider_collection->get_provider();
|
||||
$this->data = $provider->autologin();
|
||||
@ -602,19 +618,6 @@ class session
|
||||
$db->sql_freeresult($result);
|
||||
$bot = false;
|
||||
}
|
||||
else 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;
|
||||
}
|
||||
|
||||
// Bot user, if they have a SID in the Request URI we need to get rid of it
|
||||
|
Reference in New Issue
Block a user