1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/12352] Use custom provider collection for auth providers

Using this custom provider collection, we can properly check whether the
configured auth provider does exist. The method get_provider() has been added
for returning the default auth provider or the standard db auth provider if
the specified one does not exist.
Additionally, the method get_provider() will throw an RuntimeException if
none of the above exist.

PHPBB3-12352
This commit is contained in:
Marc Alexander
2014-05-31 22:43:07 +02:00
parent 306beab4cb
commit 6f5f0d6d8d
5 changed files with 73 additions and 32 deletions

View File

@@ -2855,15 +2855,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
}
$provider_collection = $phpbb_container->get('auth.provider_collection');
$auth_method = $config['auth_method'];
// Revert to db auth provider if selected method does not exist
if (!isset($provider_collection['auth.provider.' . $config['auth_method']]))
{
$auth_method = 'db';
}
$auth_provider = $provider_collection['auth.provider.' . $auth_method];
$auth_provider = $provider_collection->get_provider();
$auth_provider_data = $auth_provider->get_login_data();
if ($auth_provider_data)