1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-20 23:41:29 +02:00

[feature/oauth] Update storage implementation due to inteface change

PHPBB3-11673
This commit is contained in:
Joseph Warner
2013-09-02 15:25:38 -04:00
parent d04def0558
commit 6df2bd4fd3
2 changed files with 21 additions and 3 deletions

View File

@@ -145,13 +145,31 @@ class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
/**
* {@inheritdoc}
*/
public function clearToken()
public function clearToken($service)
{
$this->cachedToken = null;
$sql = 'DELETE FROM ' . $this->auth_provider_oauth_table . '
WHERE user_id = ' . $this->user->data['user_id'] . "
AND provider = '" . $this->db->sql_escape($this->service_name) . "'";
AND provider = '" . $this->db->sql_escape($service) . "'";
if ($this->user->data['user_id'] === ANONYMOUS)
{
$sql .= " AND session_id = '" . $this->user->data['session_id'] . "'";
}
$this->db->sql_query($sql);
}
/**
* {@inheritdoc}
*/
public function clearAllTokens()
{
$this->cachedToken = null;
$sql = 'DELETE FROM ' . $this->auth_provider_oauth_table . '
WHERE user_id = ' . $this->user->data['user_id'];
if ($this->user->data['user_id'] === ANONYMOUS)
{