diff options
author | Joseph Warner <hardolaf@hardolaf.com> | 2013-08-14 16:45:17 -0400 |
---|---|---|
committer | Joseph Warner <hardolaf@hardolaf.com> | 2013-08-14 16:45:31 -0400 |
commit | 7bd4c88ec519fa0bf10558c79994d14243255813 (patch) | |
tree | 6200d9771346156f07159d23fb391a457f02f258 /phpBB | |
parent | 9cd80345ad05cccb362ec3eba15304c3f43630ed (diff) | |
download | forums-7bd4c88ec519fa0bf10558c79994d14243255813.tar forums-7bd4c88ec519fa0bf10558c79994d14243255813.tar.gz forums-7bd4c88ec519fa0bf10558c79994d14243255813.tar.bz2 forums-7bd4c88ec519fa0bf10558c79994d14243255813.tar.xz forums-7bd4c88ec519fa0bf10558c79994d14243255813.zip |
[feature/oauth] Fix errors in oauth
PHPBB3-11673
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/phpbb/auth/provider/oauth/oauth.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php index 9af6f04e38..0972d59fee 100644 --- a/phpBB/phpbb/auth/provider/oauth/oauth.php +++ b/phpBB/phpbb/auth/provider/oauth/oauth.php @@ -425,6 +425,8 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base */ protected function link_account_login_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); + // Check for an access token, they should have one if (!$storage->has_access_token_by_session()) { @@ -593,10 +595,9 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base $this->db->sql_query($sql); // Clear all tokens belonging to the user on this servce - $sql = 'DELETE FROM ' . $this->auth_provider_oauth_token_storage_table . " - WHERE user_id = " . (int) $this->user->data['user_id'] . " - AND provider = '" . $this->db->sql_escape($link_data['oauth_service']) . "'"; - $this->db->sql_query($sql); + $service_name = 'auth.provider.oauth.service.' . strtolower($link_data['oauth_service']); + $storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $service_name, $this->auth_provider_oauth_token_storage_table); + $storage->clearToken(); return; } |