aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/auth/provider/oauth/oauth.php
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-08-24 22:00:16 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-08-24 22:04:04 -0400
commita8ffbce99f9ea99bd1fdca0e009001026e2d6950 (patch)
tree1cae1d43fee4c417eedd8303f581eb3109d083ab /phpBB/phpbb/auth/provider/oauth/oauth.php
parent310caec5d92d58453d1eee40e9b5a7f0157bd5ea (diff)
downloadforums-a8ffbce99f9ea99bd1fdca0e009001026e2d6950.tar
forums-a8ffbce99f9ea99bd1fdca0e009001026e2d6950.tar.gz
forums-a8ffbce99f9ea99bd1fdca0e009001026e2d6950.tar.bz2
forums-a8ffbce99f9ea99bd1fdca0e009001026e2d6950.tar.xz
forums-a8ffbce99f9ea99bd1fdca0e009001026e2d6950.zip
[feature/oauth] Changes due to code review
PHPBB3-11673
Diffstat (limited to 'phpBB/phpbb/auth/provider/oauth/oauth.php')
-rw-r--r--phpBB/phpbb/auth/provider/oauth/oauth.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php
index b427ca4e72..c1c27c979f 100644
--- a/phpBB/phpbb/auth/provider/oauth/oauth.php
+++ b/phpBB/phpbb/auth/provider/oauth/oauth.php
@@ -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 = '" . $this->db->sql_escape($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);
@@ -231,7 +231,9 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
'error_msg' => false,
'user_row' => $row,
);
- } else {
+ }
+ else
+ {
$url = $service->getAuthorizationUri();
header('Location: ' . $url);
}
@@ -291,8 +293,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
if (!$service)
{
- // Update to an actual error message
- throw new Exception('Service not created: ' . $service_name);
+ throw new Exception('AUTH_PROVIDER_OAUTH_ERROR_SERVICE_NOT_CREATED');
}
return $service;
@@ -474,7 +475,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
}
/**
- * Performs the account linking for login_link
+ * Performs the account linking for auth_link
*
* @param array $link_data The same variable given to {@see phpbb_auth_provider_interface::link_account}
* @param string $service_name The name of the service being used in
@@ -503,7 +504,9 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
);
$this->link_account_perform_link($data);
- } else {
+ }
+ else
+ {
$url = $service->getAuthorizationUri();
header('Location: ' . $url);
}