diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-10-16 12:39:39 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-10-16 12:48:13 +0200 |
commit | 55b97ffc2759c2cf2a38cff926d889953778e3dd (patch) | |
tree | 660a8f3003d4227489ef12ae87a73dbbc61b5c11 /phpBB/phpbb/session.php | |
parent | b343bf783ab020b085c3e35b50784414cfcaa695 (diff) | |
parent | e7e016637b8c136dfc31d422a263e808b61271a8 (diff) | |
download | forums-55b97ffc2759c2cf2a38cff926d889953778e3dd.tar forums-55b97ffc2759c2cf2a38cff926d889953778e3dd.tar.gz forums-55b97ffc2759c2cf2a38cff926d889953778e3dd.tar.bz2 forums-55b97ffc2759c2cf2a38cff926d889953778e3dd.tar.xz forums-55b97ffc2759c2cf2a38cff926d889953778e3dd.zip |
Merge branch 'ticket/13138-2' into ticket/13138-asc
Conflicts:
phpBB/phpbb/session.php
Diffstat (limited to 'phpBB/phpbb/session.php')
-rw-r--r-- | phpBB/phpbb/session.php | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index da8b848fa5..cf8ea1877e 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -577,32 +577,7 @@ class session } } - $provider_collection = $phpbb_container->get('auth.provider_collection'); - $provider = $provider_collection->get_provider(); - $this->data = $provider->autologin(); - - if (sizeof($this->data)) - { - $this->cookie_data['k'] = ''; - $this->cookie_data['u'] = $this->data['user_id']; - } - - // If we're presented with an autologin key we'll join against it. - // Else if we've been passed a user_id we'll grab data based on that - if (isset($this->cookie_data['k']) && $this->cookie_data['k'] && $this->cookie_data['u'] && !sizeof($this->data)) - { - $sql = 'SELECT u.* - FROM ' . USERS_TABLE . ' u, ' . SESSIONS_KEYS_TABLE . ' k - WHERE u.user_id = ' . (int) $this->cookie_data['u'] . ' - AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ") - AND k.user_id = u.user_id - AND k.key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'"; - $result = $db->sql_query($sql); - $this->data = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - $bot = false; - } - else if ($user_id !== false && !sizeof($this->data)) + if ($user_id !== false && !sizeof($this->data)) { $this->cookie_data['k'] = ''; $this->cookie_data['u'] = $user_id; @@ -616,6 +591,34 @@ class session $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(); + + if (sizeof($this->data)) + { + $this->cookie_data['k'] = ''; + $this->cookie_data['u'] = $this->data['user_id']; + } + + // If we're presented with an autologin key we'll join against it. + // Else if we've been passed a user_id we'll grab data based on that + if (isset($this->cookie_data['k']) && $this->cookie_data['k'] && $this->cookie_data['u'] && !sizeof($this->data)) + { + $sql = 'SELECT u.* + FROM ' . USERS_TABLE . ' u, ' . SESSIONS_KEYS_TABLE . ' k + WHERE u.user_id = ' . (int) $this->cookie_data['u'] . ' + AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ") + AND k.user_id = u.user_id + AND k.key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'"; + $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 // otherwise they'll index this page with the SID, duplicate content oh my! |