aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/auth/provider/oauth/oauth.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-02-03 14:44:01 +0100
committerMarc Alexander <admin@m-a-styles.de>2015-03-24 17:08:55 +0100
commit4d7cb7ca737195f42141c3939b9515cb3edd8b9b (patch)
tree4784fa6eb7b6d4add9cc743d7b4ba11a4b7bcad2 /phpBB/phpbb/auth/provider/oauth/oauth.php
parentca883f119614bf636802320e60822e1ed4992f2e (diff)
downloadforums-4d7cb7ca737195f42141c3939b9515cb3edd8b9b.tar
forums-4d7cb7ca737195f42141c3939b9515cb3edd8b9b.tar.gz
forums-4d7cb7ca737195f42141c3939b9515cb3edd8b9b.tar.bz2
forums-4d7cb7ca737195f42141c3939b9515cb3edd8b9b.tar.xz
forums-4d7cb7ca737195f42141c3939b9515cb3edd8b9b.zip
[ticket/13564] Use user_id from link_data for unlinking account in oauth
PHPBB3-13564
Diffstat (limited to 'phpBB/phpbb/auth/provider/oauth/oauth.php')
-rw-r--r--phpBB/phpbb/auth/provider/oauth/oauth.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php
index 9fc3a107e6..be0fbf5831 100644
--- a/phpBB/phpbb/auth/provider/oauth/oauth.php
+++ b/phpBB/phpbb/auth/provider/oauth/oauth.php
@@ -616,10 +616,13 @@ class oauth extends \phpbb\auth\provider\base
return 'LOGIN_LINK_MISSING_DATA';
}
+ // Remove user specified in $link_data if possible
+ $user_id = isset($link_data['user_id']) ? $link_data['user_id'] : $this->user->data['user_id'];
+
// Remove the link
$sql = 'DELETE FROM ' . $this->auth_provider_oauth_token_account_assoc . "
WHERE provider = '" . $this->db->sql_escape($link_data['oauth_service']) . "'
- AND user_id = " . (int) $this->user->data['user_id'];
+ AND user_id = " . (int) $user_id;
$this->db->sql_query($sql);
// Clear all tokens belonging to the user on this servce