aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-07-15 14:57:00 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-07-15 14:57:22 -0400
commit6e1c522bdd0e3c67786656a866219c57b7b1e4dc (patch)
tree838691770109049180c5ce62257964112479d690 /phpBB/phpbb
parenteb17462f906a9010ca193b2dd28375f2fcc38c03 (diff)
downloadforums-6e1c522bdd0e3c67786656a866219c57b7b1e4dc.tar
forums-6e1c522bdd0e3c67786656a866219c57b7b1e4dc.tar.gz
forums-6e1c522bdd0e3c67786656a866219c57b7b1e4dc.tar.bz2
forums-6e1c522bdd0e3c67786656a866219c57b7b1e4dc.tar.xz
forums-6e1c522bdd0e3c67786656a866219c57b7b1e4dc.zip
[feature/oauth] Update oauth to reflect recent changes
PHPBB3-11673
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/auth/provider/oauth/oauth.php16
1 files changed, 3 insertions, 13 deletions
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php
index 4db9946e50..3ef6d8c934 100644
--- a/phpBB/phpbb/auth/provider/oauth/oauth.php
+++ b/phpBB/phpbb/auth/provider/oauth/oauth.php
@@ -109,7 +109,8 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
{
// Requst the name of the OAuth service
$service_name = $this->request->variable('oauth_service', '', false, phpbb_request_interface::POST);
- if ($service_name === '')
+ $service_name = strtolower($service_name);
+ if ($service_name === '' && isset($this->services[$service_name]))
{
return array(
'status' => LOGIN_ERROR_EXTERNAL_AUTH,
@@ -120,18 +121,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
}
// Get the service credentials for the given service
- $service_credentials = $this->get_credentials($service_name);
-
- // Check that the service has settings
- if ($service_credentials['key'] == false || $service_credentials['secret'] == false)
- {
- return array(
- 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
- // TODO: change error message
- 'error_msg' => 'LOGIN_ERROR_EXTERNAL_AUTH_APACHE',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
+ $service_credentials = $this->services[$service_name]->get_credentials($service_name);
$storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $service_name, $this->auth_provider_oauth_table);
$service = $this->get_service($service_name, $storage, $service_credentials, $this->get_scopes($service_name));