diff options
| author | Nils Adermann <naderman@naderman.de> | 2014-11-02 01:25:51 +0100 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2014-11-02 01:25:51 +0100 |
| commit | 0e772afb9db640e54e84cfccaddcf74f3edbb3fb (patch) | |
| tree | 4d944f0f6c18a369683e243bcc8b94ebdb6ae3d2 /phpBB/phpbb/auth | |
| parent | a61299a9408dd3ae4a2fa97fdc2df62ca41ee150 (diff) | |
| parent | b6a4f83c412d4db7596ad677eca5551a5fc715d8 (diff) | |
| download | forums-0e772afb9db640e54e84cfccaddcf74f3edbb3fb.tar forums-0e772afb9db640e54e84cfccaddcf74f3edbb3fb.tar.gz forums-0e772afb9db640e54e84cfccaddcf74f3edbb3fb.tar.bz2 forums-0e772afb9db640e54e84cfccaddcf74f3edbb3fb.tar.xz forums-0e772afb9db640e54e84cfccaddcf74f3edbb3fb.zip | |
Merge branch 'prep-release-3.1.1' into develop-ascraeus
* prep-release-3.1.1:
[ticket/13271] Disable CC sender feature for anonymous users
[prep-release-3.1.1] Add 3.1.1 CHANGELOG
[prep-release-3.1.1] Add 3.1.1 migration file
[ticket/13263] Make sure default style exists and clean up code
[ticket/13263] Only install/set prosilver if no style available
[ticket/13263] Use prosilver as default style if user's style doesn't exist
[ticket/security-164] Correctly format page_name
[ticket/security-164] Sanitize all global variables in symfony_request class
[ticket/13248] Use functional framework login method in tests
[ticket/13248] Correctly pass provider name
[ticket/13248] Always use provider collection for getting provider
[ticket/13248] Allow specifying different auth provider in provider collection
[ticket/13248] Use auth provider collection for getting provider
[ticket/13262] Mention htaccess file when updating from 3.0 to 3.1
[ticket/13267] Update Automatic Update instructions to include vendor directory
[ticket/13268] Properly append ternary result in get_existing_indexes()
[prep-release-3.1.1] Update version number to 3.1.1
Conflicts:
build/build.xml
phpBB/includes/constants.php
phpBB/install/schemas/schema_data.sql
Diffstat (limited to 'phpBB/phpbb/auth')
| -rw-r--r-- | phpBB/phpbb/auth/auth.php | 6 | ||||
| -rw-r--r-- | phpBB/phpbb/auth/provider_collection.php | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/phpBB/phpbb/auth/auth.php b/phpBB/phpbb/auth/auth.php index 38755ccf99..b59f0e60ec 100644 --- a/phpBB/phpbb/auth/auth.php +++ b/phpBB/phpbb/auth/auth.php @@ -927,11 +927,11 @@ class auth */ function login($username, $password, $autologin = false, $viewonline = 1, $admin = 0) { - global $config, $db, $user, $phpbb_root_path, $phpEx, $phpbb_container; + global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container; - $method = trim(basename($config['auth_method'])); + $provider_collection = $phpbb_container->get('auth.provider_collection'); - $provider = $phpbb_container->get('auth.provider.' . $method); + $provider = $provider_collection->get_provider(); if ($provider) { $login = $provider->login($username, $password); diff --git a/phpBB/phpbb/auth/provider_collection.php b/phpBB/phpbb/auth/provider_collection.php index a74a2135dc..8e7e9e2cc1 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 !== '') ? $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')) |
