diff options
author | Joseph Warner <hardolaf@hardolaf.com> | 2013-07-29 16:03:54 -0400 |
---|---|---|
committer | Joseph Warner <hardolaf@hardolaf.com> | 2013-07-29 16:04:08 -0400 |
commit | 3d55e5faa91f0161bc020720a81b50171b30f49d (patch) | |
tree | cb289863ebaccc21ea4aeb39902549a440de09dc /phpBB/includes/ucp/ucp_login_link.php | |
parent | 641433920e43478a021743557f69382292f60f68 (diff) | |
download | forums-3d55e5faa91f0161bc020720a81b50171b30f49d.tar forums-3d55e5faa91f0161bc020720a81b50171b30f49d.tar.gz forums-3d55e5faa91f0161bc020720a81b50171b30f49d.tar.bz2 forums-3d55e5faa91f0161bc020720a81b50171b30f49d.tar.xz forums-3d55e5faa91f0161bc020720a81b50171b30f49d.zip |
[feature/oauth] Works in all tests now
PHPBB3-11673
Diffstat (limited to 'phpBB/includes/ucp/ucp_login_link.php')
-rw-r--r-- | phpBB/includes/ucp/ucp_login_link.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/phpBB/includes/ucp/ucp_login_link.php b/phpBB/includes/ucp/ucp_login_link.php index c2fc0fdfab..5b58e91b9a 100644 --- a/phpBB/includes/ucp/ucp_login_link.php +++ b/phpBB/includes/ucp/ucp_login_link.php @@ -59,11 +59,19 @@ class ucp_login_link { if ($request->is_set_post('login')) { + $login_username = $request->variable('login_username', '', false, phpbb_request_interface::POST); + $login_password = $request->untrimmed_variable('login_password', '', true, phpbb_request_interface::POST); + + $login_result = $auth_provider->login($login_username, $login_password); + // We only care if there is or is not an error - $login_error = $this->perform_login_action(); + $login_error = $this->process_login_result($login_result); if (!$login_error) { + // Give the user_id to the data + $data['user_id'] = $login_result['user_row']['user_id']; + // The user is now logged in, attempt to link the user to the external account $result = $auth_provider->link_account($data); @@ -71,6 +79,9 @@ class ucp_login_link { $login_link_error = $user->lang[$result]; } else { + // Finish login + $result = $user->session_create($login_result['user_row']['user_id'], false, false, true); + // Perform a redirect as the account has been linked $this->perform_redirect(); } @@ -117,13 +128,9 @@ class ucp_login_link return $login_link_data; } - protected function perform_login_action() + protected function process_login_result($result) { - global $auth, $config, $request, $template, $user; - $login_username = $request->variable('login_username', '', false, phpbb_request_interface::POST); - $login_password = $request->untrimmed_variable('login_password', '', true, phpbb_request_interface::POST); - - $result = $auth->login($login_username, $login_password); + global $config, $request, $template, $user; $login_error = null; |