From 581cb37b8c7ae4f1902cfd6114a34ce1510139a8 Mon Sep 17 00:00:00 2001 From: Joseph Warner Date: Wed, 24 Jul 2013 13:46:33 -0400 Subject: [feature/oauth] Start linking/registering OAuth accounts during login PHPBB3-11673 --- phpBB/phpbb/auth/auth.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'phpBB/phpbb/auth/auth.php') diff --git a/phpBB/phpbb/auth/auth.php b/phpBB/phpbb/auth/auth.php index 279959974d..400f5fef6d 100644 --- a/phpBB/phpbb/auth/auth.php +++ b/phpBB/phpbb/auth/auth.php @@ -970,6 +970,21 @@ class phpbb_auth ); } + // If the auth provider wants us to link an empty account do so and redirect + if ($login['status'] == LOGIN_SUCCESS_LINK_PROFILE) + { + // If this status exists a fourth field is in the $login array called 'redirect_data' + // This data is passed along as GET data to the next page allow the account to be linked + $url = 'ucp.php?mode=login_link'; + + foreach ($login['redirect_data'] as $key => $value) + { + $url .= '&' . $key . '=' . $value; + } + + redirect($url); + } + // If login succeeded, we will log the user in... else we pass the login array through... if ($login['status'] == LOGIN_SUCCESS) { -- cgit v1.2.1 From 310caec5d92d58453d1eee40e9b5a7f0157bd5ea Mon Sep 17 00:00:00 2001 From: Joseph Warner Date: Sat, 24 Aug 2013 21:34:23 -0400 Subject: [feature/oauth] Fix redirects PHPBB3-11673 --- phpBB/phpbb/auth/auth.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'phpBB/phpbb/auth/auth.php') diff --git a/phpBB/phpbb/auth/auth.php b/phpBB/phpbb/auth/auth.php index 400f5fef6d..5093483d4a 100644 --- a/phpBB/phpbb/auth/auth.php +++ b/phpBB/phpbb/auth/auth.php @@ -975,12 +975,9 @@ class phpbb_auth { // If this status exists a fourth field is in the $login array called 'redirect_data' // This data is passed along as GET data to the next page allow the account to be linked - $url = 'ucp.php?mode=login_link'; - foreach ($login['redirect_data'] as $key => $value) - { - $url .= '&' . $key . '=' . $value; - } + $params = array('mode' => 'login_link'); + $url = append_sid('ucp.' . $phpEx, array_merge($params, $login['redirect_data'])); redirect($url); } -- cgit v1.2.1 From 29e3768ecc7bc8adf96d4e31c4e05a6f1de6735a Mon Sep 17 00:00:00 2001 From: Joseph Warner Date: Mon, 2 Sep 2013 16:47:40 -0400 Subject: [feature/oauth] More minor changes from review PHPBB3-11673 --- phpBB/phpbb/auth/auth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/auth/auth.php') diff --git a/phpBB/phpbb/auth/auth.php b/phpBB/phpbb/auth/auth.php index 5093483d4a..81f8c76fc8 100644 --- a/phpBB/phpbb/auth/auth.php +++ b/phpBB/phpbb/auth/auth.php @@ -977,7 +977,7 @@ class phpbb_auth // This data is passed along as GET data to the next page allow the account to be linked $params = array('mode' => 'login_link'); - $url = append_sid('ucp.' . $phpEx, array_merge($params, $login['redirect_data'])); + $url = append_sid($phpbb_root_path . 'ucp.' . $phpEx, array_merge($params, $login['redirect_data'])); redirect($url); } -- cgit v1.2.1 From b95fdacdd378877d277e261465da73deb06e50da Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 10 Sep 2013 14:01:09 +0200 Subject: [ticket/11700] Move all recent code to namespaces PHPBB3-11700 --- phpBB/phpbb/auth/auth.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/auth/auth.php') diff --git a/phpBB/phpbb/auth/auth.php b/phpBB/phpbb/auth/auth.php index 279959974d..804e1ce44b 100644 --- a/phpBB/phpbb/auth/auth.php +++ b/phpBB/phpbb/auth/auth.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\auth; + /** * @ignore */ @@ -19,7 +21,7 @@ if (!defined('IN_PHPBB')) * Permission/Auth class * @package phpBB3 */ -class phpbb_auth +class auth { var $acl = array(); var $cache = array(); @@ -92,7 +94,7 @@ class phpbb_auth } } - // If a bitstring within the list does not match the options, we have a user with incorrect permissions set and need to renew them + // If a bitstring within the list does not match the options, we have a user with incorrect permissions set and need to renew \them if ($renew) { $this->acl_cache($userdata); @@ -993,7 +995,7 @@ class phpbb_auth // Successful session creation if ($result === true) { - // If admin re-authentication we remove the old session entry because a new one has been created... + // If admin re-authentication we remove the old session entry because a new \one has been created... if ($admin) { // the login array is used because the user ids do not differ for re-authentication -- cgit v1.2.1 From 3860b37741c21576dae2f02e3754aa322c24567f Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 16 Sep 2013 03:50:47 +0200 Subject: [ticket/11700] Actually "one" in comments is not a class PHPBB3-11700 --- phpBB/phpbb/auth/auth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/auth/auth.php') diff --git a/phpBB/phpbb/auth/auth.php b/phpBB/phpbb/auth/auth.php index 5c76b64281..05d7d5e97b 100644 --- a/phpBB/phpbb/auth/auth.php +++ b/phpBB/phpbb/auth/auth.php @@ -1007,7 +1007,7 @@ class auth // Successful session creation if ($result === true) { - // If admin re-authentication we remove the old session entry because a new \one has been created... + // If admin re-authentication we remove the old session entry because a new one has been created... if ($admin) { // the login array is used because the user ids do not differ for re-authentication -- cgit v1.2.1 From acea8f5c0a5d0901b25e4055dd6dfc4b8bebe707 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 16 Sep 2013 03:51:25 +0200 Subject: [ticket/11700] The word "them" in a comment is not a class PHPBB3-11700 --- phpBB/phpbb/auth/auth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/auth/auth.php') diff --git a/phpBB/phpbb/auth/auth.php b/phpBB/phpbb/auth/auth.php index 05d7d5e97b..b5cc675838 100644 --- a/phpBB/phpbb/auth/auth.php +++ b/phpBB/phpbb/auth/auth.php @@ -94,7 +94,7 @@ class auth } } - // If a bitstring within the list does not match the options, we have a user with incorrect permissions set and need to renew \them + // If a bitstring within the list does not match the options, we have a user with incorrect permissions set and need to renew them if ($renew) { $this->acl_cache($userdata); -- cgit v1.2.1