aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-08-14 16:01:59 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-08-14 16:02:47 -0400
commitcd12786e58995d93bb73218fb869bad00ad9674e (patch)
tree4705ed0cb4d02db85afaf51ce9da55172bd4df17 /phpBB
parentbb68338861e4fc618407f83706d194e1114ce103 (diff)
downloadforums-cd12786e58995d93bb73218fb869bad00ad9674e.tar
forums-cd12786e58995d93bb73218fb869bad00ad9674e.tar.gz
forums-cd12786e58995d93bb73218fb869bad00ad9674e.tar.bz2
forums-cd12786e58995d93bb73218fb869bad00ad9674e.tar.xz
forums-cd12786e58995d93bb73218fb869bad00ad9674e.zip
[feature/oauth] Fix errors found in testing linking
PHPBB3-11673
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/ucp/ucp_auth_link.php2
-rw-r--r--phpBB/phpbb/auth/provider/oauth/oauth.php9
2 files changed, 4 insertions, 7 deletions
diff --git a/phpBB/includes/ucp/ucp_auth_link.php b/phpBB/includes/ucp/ucp_auth_link.php
index 59eedb7c92..b7fd014493 100644
--- a/phpBB/includes/ucp/ucp_auth_link.php
+++ b/phpBB/includes/ucp/ucp_auth_link.php
@@ -58,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, false, phpbb_request_interface::POST))
+ if ($request->variable('link', 0, false, phpbb_request_interface::POST))
{
$error[] = $auth_provider->link_account($link_data);
}
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php
index ff715d8944..6f6e6fd344 100644
--- a/phpBB/phpbb/auth/provider/oauth/oauth.php
+++ b/phpBB/phpbb/auth/provider/oauth/oauth.php
@@ -391,10 +391,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
// We must have an oauth_service listed, check for it two ways
if (!array_key_exists('oauth_service', $link_data) || !$link_data['oauth_service'])
{
- if (!$link_data['oauth_service'] && $this->request->is_set('oauth_service'))
- {
- $link_data['oauth_service'] = $this->request->variable('oauth_service', '');
- }
+ $link_data['oauth_service'] = $this->request->variable('oauth_service', false);
if (!$link_data['oauth_service'])
{
@@ -452,7 +449,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
protected function link_account_auth_link(array $link_data, $service_name)
{
$storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $service_name, $this->auth_provider_oauth_token_storage_table);
- $query = 'i=ucp_auth_link&mode=auth_link&link=1&login_link_oauth_service=' . strtolower($link_data['oauth_service']);
+ $query = 'i=ucp_auth_link&mode=auth_link&link=1&oauth_service=' . strtolower($link_data['oauth_service']);
$service_credentials = $this->service_providers[$service_name]->get_service_credentials();
$scopes = $this->service_providers[$service_name]->get_auth_scope();
$service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $scopes, $query);
@@ -464,7 +461,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
// Insert into table, they will be able to log in after this
$data = array(
- 'user_id' => $link_data['user_id'],
+ 'user_id' => $this->user->data['user_id'],
'provider' => strtolower($link_data['oauth_service']),
'oauth_provider_id' => $unique_id,
);