1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[feature/oauth] More minor changes from review

PHPBB3-11673
This commit is contained in:
Joseph Warner
2013-09-02 16:47:40 -04:00
parent 63ba064065
commit 29e3768ecc
5 changed files with 22 additions and 21 deletions

View File

@@ -211,8 +211,8 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
// Retrieve the user's account
$sql = 'SELECT user_id, username, user_password, user_passchg, user_pass_convert, user_email, user_type, user_login_attempts
FROM ' . $this->users_table . '
WHERE user_id = ' . (int) $row['user_id'];
FROM ' . $this->users_table . '
WHERE user_id = ' . (int) $row['user_id'];
$result = $this->db->sql_query($sql);
$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);
@@ -545,7 +545,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
// Get all external accounts tied to the current user
$data = array(
'user_id' => $this->user->data['user_id'],
'user_id' => (int) $this->user->data['user_id'],
);
$sql = 'SELECT oauth_provider_id, provider FROM ' . $this->auth_provider_oauth_token_account_assoc . '
WHERE ' . $this->db->sql_build_array('SELECT', $data);

View File

@@ -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);
}