1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-28 12:30:42 +02:00

[ticket/12352] Revert to db auth provider if default does not exist

This will make sure that we will not encounter a non-existing auth provider.
We will revert to the default db auth provider if the one set in the config
does not exist in our auth provider collection.

PHPBB3-12352
This commit is contained in:
Marc Alexander
2014-05-01 14:23:39 +02:00
parent 68f59defb0
commit ed1d4fe4a0
4 changed files with 32 additions and 4 deletions

View File

@@ -2854,7 +2854,16 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
$s_hidden_fields['credential'] = $credential;
}
$auth_provider = $phpbb_container->get('auth.provider.' . $config['auth_method']);
$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_data = $auth_provider->get_login_data();
if ($auth_provider_data)