mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-13 04:04:12 +02:00
[feature/oauth] More minor changes from review
PHPBB3-11673
This commit is contained in:
@@ -82,11 +82,11 @@ class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'user_id' => $this->user->data['user_id'],
|
||||
'user_id' => (int) $this->user->data['user_id'],
|
||||
'provider' => $service,
|
||||
);
|
||||
|
||||
if ($this->user->data['user_id'] === ANONYMOUS)
|
||||
if ((int) $this->user->data['user_id'] === ANONYMOUS)
|
||||
{
|
||||
$data['session_id'] = $this->user->data['session_id'];
|
||||
}
|
||||
@@ -104,7 +104,7 @@ class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
|
||||
$this->cachedToken = $token;
|
||||
|
||||
$data = array(
|
||||
'user_id' => $this->user->data['user_id'],
|
||||
'user_id' => (int) $this->user->data['user_id'],
|
||||
'provider' => $service,
|
||||
'oauth_token' => $this->json_encode_token($token),
|
||||
'session_id' => $this->user->data['session_id'],
|
||||
@@ -127,11 +127,11 @@ class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'user_id' => $this->user->data['user_id'],
|
||||
'user_id' => (int) $this->user->data['user_id'],
|
||||
'provider' => $service,
|
||||
);
|
||||
|
||||
if ($this->user->data['user_id'] === ANONYMOUS)
|
||||
if ((int) $this->user->data['user_id'] === ANONYMOUS)
|
||||
{
|
||||
$data['session_id'] = $this->user->data['session_id'];
|
||||
}
|
||||
@@ -149,12 +149,12 @@ class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
|
||||
$this->cachedToken = null;
|
||||
|
||||
$sql = 'DELETE FROM ' . $this->auth_provider_oauth_table . '
|
||||
WHERE user_id = ' . $this->user->data['user_id'] . "
|
||||
WHERE user_id = ' . (int) $this->user->data['user_id'] . "
|
||||
AND provider = '" . $this->db->sql_escape($service) . "'";
|
||||
|
||||
if ($this->user->data['user_id'] === ANONYMOUS)
|
||||
if ((int) $this->user->data['user_id'] === ANONYMOUS)
|
||||
{
|
||||
$sql .= " AND session_id = '" . $this->user->data['session_id'] . "'";
|
||||
$sql .= " AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'";
|
||||
}
|
||||
|
||||
$this->db->sql_query($sql);
|
||||
@@ -168,11 +168,11 @@ class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
|
||||
$this->cachedToken = null;
|
||||
|
||||
$sql = 'DELETE FROM ' . $this->auth_provider_oauth_table . '
|
||||
WHERE user_id = ' . $this->user->data['user_id'];
|
||||
WHERE user_id = ' . (int) $this->user->data['user_id'];
|
||||
|
||||
if ($this->user->data['user_id'] === ANONYMOUS)
|
||||
if ((int) $this->user->data['user_id'] === ANONYMOUS)
|
||||
{
|
||||
$sql .= " AND session_id = '" . $this->user->data['session_id'] . "'";
|
||||
$sql .= " AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'";
|
||||
}
|
||||
|
||||
$this->db->sql_query($sql);
|
||||
@@ -194,8 +194,8 @@ class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
|
||||
SET ' . $this->db->sql_build_array('UPDATE', array(
|
||||
'user_id' => (int) $user_id
|
||||
)) . '
|
||||
WHERE user_id = ' . $this->user->data['user_id'] . "
|
||||
AND session_id = '" . $this->user->data['session_id'] . "'";
|
||||
WHERE user_id = ' . (int) $this->user->data['user_id'] . "
|
||||
AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'";
|
||||
$this->db->sql_query($sql);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user