diff options
author | Marc Alexander <admin@m-a-styles.de> | 2014-10-30 14:24:33 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2014-11-01 21:54:14 +0100 |
commit | c3f5dc75bed689956b7d4ed1e5b7e0d2c80257c9 (patch) | |
tree | cbe4d81f343e005ca64e99a20b5c26ca2e910476 /phpBB/phpbb | |
parent | 6b057e026cfb9603c6260d619e0a37e3679aa0d5 (diff) | |
download | forums-c3f5dc75bed689956b7d4ed1e5b7e0d2c80257c9.tar forums-c3f5dc75bed689956b7d4ed1e5b7e0d2c80257c9.tar.gz forums-c3f5dc75bed689956b7d4ed1e5b7e0d2c80257c9.tar.bz2 forums-c3f5dc75bed689956b7d4ed1e5b7e0d2c80257c9.tar.xz forums-c3f5dc75bed689956b7d4ed1e5b7e0d2c80257c9.zip |
[ticket/13248] Allow specifying different auth provider in provider collection
PHPBB3-13248
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/auth/provider_collection.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/phpBB/phpbb/auth/provider_collection.php b/phpBB/phpbb/auth/provider_collection.php index a74a2135dc..bf724419b7 100644 --- a/phpBB/phpbb/auth/provider_collection.php +++ b/phpBB/phpbb/auth/provider_collection.php @@ -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')) |