From: skodak Date: Mon, 26 Mar 2007 19:00:21 +0000 (+0000) Subject: MDL-9053 - detect + fix broken $CFG->auth setting from the login page; merged from... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a353ad7fe44cd53038b5fb3d33fd494807754978;p=moodle.git MDL-9053 - detect + fix broken $CFG->auth setting from the login page; merged from MOODLE_18_STABLE --- diff --git a/login/index.php b/login/index.php index 43eebe1f3e..03068a6c9d 100644 --- a/login/index.php +++ b/login/index.php @@ -44,7 +44,7 @@ /// Load alternative login screens if necessary -$authsequence = explode(',', $CFG->auth); // auths, in sequence +$cfgauthsequence = explode(',', $CFG->auth); // auths, in sequence if (!isset($CFG->registerauth)) { set_config('registerauth', ''); @@ -55,11 +55,28 @@ if (!isset($CFG->auth_instructions)) { } -// auth plugins can override these - SSO anyone? +$authsequence = array(); +$fixauthseq = false; + +// fix auth sequence if needed to prevent fatal errors during login +foreach($cfgauthsequence as $authname) { + if (exists_auth_plugin($authname)) { + $authsequence[] = $authname; + continue; + } else { + $fixauthseq = true; + } +} +if ($fixauthseq) { + set_config('auth', implode(',', $authsequence)); +} + +// auth plugins may override these - SSO anyone? $frm = false; $user = false; foreach($authsequence as $authname) { + // manual and auth is not processed here $authplugin = get_auth_plugin($authname); $authplugin->prelogin_hook(); }