aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-08-14 15:55:38 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-08-14 15:55:58 -0400
commitbb68338861e4fc618407f83706d194e1114ce103 (patch)
tree271f6468329aa90380c67940c1ed9b450f78c992 /phpBB/includes/ucp
parentafebbf231adeee6828d75d346b64f3036ff46e7c (diff)
downloadforums-bb68338861e4fc618407f83706d194e1114ce103.tar
forums-bb68338861e4fc618407f83706d194e1114ce103.tar.gz
forums-bb68338861e4fc618407f83706d194e1114ce103.tar.bz2
forums-bb68338861e4fc618407f83706d194e1114ce103.tar.xz
forums-bb68338861e4fc618407f83706d194e1114ce103.zip
[feature/oauth] Refactor oauth::link_account for two paths
PHPBB3-11673
Diffstat (limited to 'phpBB/includes/ucp')
-rw-r--r--phpBB/includes/ucp/ucp_auth_link.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/phpBB/includes/ucp/ucp_auth_link.php b/phpBB/includes/ucp/ucp_auth_link.php
index 43d69be901..59eedb7c92 100644
--- a/phpBB/includes/ucp/ucp_auth_link.php
+++ b/phpBB/includes/ucp/ucp_auth_link.php
@@ -39,6 +39,7 @@ class ucp_auth_link
$submit = $request->variable('submit', false, false, phpbb_request_interface::POST);
+ // This path is only for primary actions
if (!sizeof($error) && $submit)
{
if (!check_form_key('ucp_auth_link'))
@@ -57,7 +58,7 @@ class ucp_auth_link
// Tell the provider that the method is auth_link not login_link
$link_data['link_method'] = 'auth_link';
- if ($request->variable('link', null))
+ if ($request->variable('link', null, false, phpbb_request_interface::POST))
{
$error[] = $auth_provider->link_account($link_data);
}
@@ -68,6 +69,17 @@ class ucp_auth_link
}
}
+ // In some cases, an request to an external server may be required in
+ // these cases, the GET parameter 'link' should exist and should be true
+ if ($request->variable('link', false))
+ {
+ // In this case the link data should only be populated with the
+ // link_method as the provider dictates how data is returned to it.
+ $link_data = array('link_method' => 'auth_link');
+
+ $error[] = $auth_provider->link_account($link_data);
+ }
+
if (isset($provider_data['VARS']))
{
// Handle hidden fields separately