diff options
author | Marc Alexander <admin@m-a-styles.de> | 2014-05-01 14:23:39 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2014-06-01 21:31:04 +0200 |
commit | ed1d4fe4a03c55bbc997f11afa11a87b4fe78c4d (patch) | |
tree | 25f29200b3fab2d6426f17e4f75e677fffc08c7e /phpBB/includes/functions.php | |
parent | 68f59defb041a719519547fdd34f25258a60a38e (diff) | |
download | forums-ed1d4fe4a03c55bbc997f11afa11a87b4fe78c4d.tar forums-ed1d4fe4a03c55bbc997f11afa11a87b4fe78c4d.tar.gz forums-ed1d4fe4a03c55bbc997f11afa11a87b4fe78c4d.tar.bz2 forums-ed1d4fe4a03c55bbc997f11afa11a87b4fe78c4d.tar.xz forums-ed1d4fe4a03c55bbc997f11afa11a87b4fe78c4d.zip |
[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
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index c423e29d9d..31a6246d34 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -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) |