1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-12 18:45:20 +02:00

[feature/oauth] Fix a bunch of errors in oauth.php

PHPBB3-11673
This commit is contained in:
Joseph Warner 2013-07-18 21:02:00 -04:00
parent b67032fb02
commit f852485513

View File

@ -128,7 +128,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
// Requst the name of the OAuth service // Requst the name of the OAuth service
$service_name = $this->request->variable('oauth_service', '', false, phpbb_request_interface::POST); $service_name = $this->request->variable('oauth_service', '', false, phpbb_request_interface::POST);
$service_name = strtolower($service_name); $service_name = strtolower($service_name);
if ($service_name === '' && isset($this->services[$service_name])) if ($service_name === '' || !array_key_exists($service_name, $this->service_providers))
{ {
return array( return array(
'status' => LOGIN_ERROR_EXTERNAL_AUTH, 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
@ -139,15 +139,15 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
} }
// Get the service credentials for the given service // Get the service credentials for the given service
$service_credentials = $this->services[$service_name]->get_credentials(); $service_credentials = $this->service_providers[$service_name]->get_credentials();
$storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $service_name, $this->auth_provider_oauth_token_storage_table); $storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $service_name, $this->auth_provider_oauth_token_storage_table);
$service = $this->get_service($service_name, $storage, $service_credentials, $this->services[$service_name]->get_auth_scope()); $service = $this->get_service($service_name, $storage, $service_credentials, $this->service_providers[$service_name]->get_auth_scope());
if ($this->request->is_set('code', phpbb_request_interface::GET)) if ($this->request->is_set('code', phpbb_request_interface::GET))
{ {
$this->services[$service_name]->set_external_service_provider($service); $this->service_providers[$service_name]->set_external_service_provider($service);
$unique_id = $this->services[$service_name]->perform_auth_login(); $unique_id = $this->service_providers[$service_name]->perform_auth_login();
// Check to see if this provider is already assosciated with an account // Check to see if this provider is already assosciated with an account
$data = array( $data = array(