mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/13248] Allow specifying different auth provider in provider collection
PHPBB3-13248
This commit is contained in:
parent
6b057e026c
commit
c3f5dc75be
1 changed files with 5 additions and 3 deletions
|
@ -38,6 +38,7 @@ class provider_collection extends \phpbb\di\service_collection
|
|||
/**
|
||||
* Get an auth provider.
|
||||
*
|
||||
* @param string $provider_name The name of the auth provider
|
||||
* @return object Default auth provider selected in config if it
|
||||
* does exist. Otherwise the standard db auth
|
||||
* provider.
|
||||
|
@ -46,11 +47,12 @@ class provider_collection extends \phpbb\di\service_collection
|
|||
* auth provider exist. The db auth provider
|
||||
* should always exist in a phpBB installation.
|
||||
*/
|
||||
public function get_provider()
|
||||
public function get_provider($provider_name = '')
|
||||
{
|
||||
if ($this->offsetExists('auth.provider.' . basename(trim($this->config['auth_method']))))
|
||||
$provider_name = ($provider_name !== '') ?: basename(trim($this->config['auth_method']));
|
||||
if ($this->offsetExists('auth.provider.' . $provider_name))
|
||||
{
|
||||
return $this->offsetGet('auth.provider.' . basename(trim($this->config['auth_method'])));
|
||||
return $this->offsetGet('auth.provider.' . $provider_name);
|
||||
}
|
||||
// Revert to db auth provider if selected method does not exist
|
||||
else if ($this->offsetExists('auth.provider.db'))
|
||||
|
|
Loading…
Add table
Reference in a new issue