From 3a9e3f1db49d73eb0b4eaf2425c98fd010e24bf4 Mon Sep 17 00:00:00 2001 From: Kristian Ringer Date: Mon, 23 Nov 2020 13:05:14 +1100 Subject: [PATCH] MDL-64865 auth: Log changing auth config in get_enabled_auth_plugins --- lib/moodlelib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index b0f51149c83..59fcd1c132f 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -3906,13 +3906,19 @@ function get_enabled_auth_plugins($fix=false) { if ($fix) { $auths = array_unique($auths); + $oldauthconfig = implode(',', $auths); foreach ($auths as $k => $authname) { - if (!exists_auth_plugin($authname) or in_array($authname, $default)) { + $authplugindoesnotexist = !exists_auth_plugin($authname); + if ($authplugindoesnotexist || in_array($authname, $default)) { + if ($authplugindoesnotexist) { + debugging(get_string('authpluginnotfound', 'debug', $authname)); + } unset($auths[$k]); } } $newconfig = implode(',', $auths); if (!isset($CFG->auth) or $newconfig != $CFG->auth) { + add_to_config_log('auth', $oldauthconfig, $newconfig, 'core'); set_config('auth', $newconfig); } }