MDL-29667 Plugins overview shows incorrect availability for auth & enrol plugins

We store the enabled plugins as array values but later look them up as array
keys. Just flip the array when we build it.
This commit is contained in:
Iñaki Arenaza 2011-10-27 12:09:23 +02:00 committed by Rajesh Taneja
parent ea75a579d1
commit 9c867cfef8

View file

@ -1462,7 +1462,7 @@ class plugintype_auth extends plugintype_base implements plugin_information {
} }
if (is_null($enabled)) { if (is_null($enabled)) {
$enabled = explode(',', $CFG->auth); $enabled = array_flip(explode(',', $CFG->auth));
} }
return isset($enabled[$this->name]); return isset($enabled[$this->name]);
@ -1499,7 +1499,7 @@ class plugintype_enrol extends plugintype_base implements plugin_information {
static $enabled = null; static $enabled = null;
if (is_null($enabled)) { if (is_null($enabled)) {
$enabled = explode(',', $CFG->enrol_plugins_enabled); $enabled = array_flip(explode(',', $CFG->enrol_plugins_enabled));
} }
return isset($enabled[$this->name]); return isset($enabled[$this->name]);