diff options
author | Joseph Warner <hardolaf@hardolaf.com> | 2013-07-13 18:30:41 -0400 |
---|---|---|
committer | Joseph Warner <hardolaf@hardolaf.com> | 2013-07-14 14:22:43 -0400 |
commit | 3c8187c277446ac07e5ff08c05a6e535f401ae2d (patch) | |
tree | fbd28e21a600a2386128a705148acbad4a9bfefc /phpBB | |
parent | 68a80f8ea8d61a8ad60f046a2ef68124d2abc801 (diff) | |
download | forums-3c8187c277446ac07e5ff08c05a6e535f401ae2d.tar forums-3c8187c277446ac07e5ff08c05a6e535f401ae2d.tar.gz forums-3c8187c277446ac07e5ff08c05a6e535f401ae2d.tar.bz2 forums-3c8187c277446ac07e5ff08c05a6e535f401ae2d.tar.xz forums-3c8187c277446ac07e5ff08c05a6e535f401ae2d.zip |
[feature/oauth] Have array of services not just one in oauth
PHPBB3-11673
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/auth/provider/oauth.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/phpBB/includes/auth/provider/oauth.php b/phpBB/includes/auth/provider/oauth.php index c7f60c5ae4..c59c573c52 100644 --- a/phpBB/includes/auth/provider/oauth.php +++ b/phpBB/includes/auth/provider/oauth.php @@ -61,11 +61,11 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base protected $auth_provider_oauth_table; /** - * Cached service once it has been created + * Cached services once they has been created * - * @var \OAuth\Common\Service\ServiceInterface|null + * @var array Contains \OAuth\Common\Service\ServiceInterface or null */ - protected $service; + protected $services; /** * Cached current uri object @@ -90,6 +90,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base $this->request = $request; $this->user = $user; $this->auth_provider_oauth_table = $auth_provider_oauth_table; + $this->services = array(); } /** @@ -181,9 +182,9 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base */ protected function get_service($service_name, array $service_credentials, array $scopes = array()) { - if ($this->service) + if ($this->services[$service_name]) { - return $this->service; + return $this->services[$service_name]; } $storage = new phpbb_auth_oauth_token_storage($this->db, $this->user, $service_name, $this->auth_provider_oauth_table); @@ -198,8 +199,8 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base ); $service_factory = new \OAuth\ServiceFactory(); - $this->service = $service_factory->createService($service_name, $credentials, $storage, $scopes); + $this->service[$service_name] = $service_factory->createService($service_name, $credentials, $storage, $scopes); - return $this->service; + return $this->service[$service_name]; } } |