Commit 8b6c056e authored by Côme Chilliet's avatar Côme Chilliet
Browse files

🚑 fix(core) Moved load_plist to pluglist class as a static method

issue #5854
parent e7f0631a
......@@ -105,7 +105,7 @@ if (!session::global_is_set('CurrentMainBase')) {
Language::init();
/* Prepare plugin list */
$plist = load_plist();
pluglist::load();
/* Check for register globals */
if (isset($global_check) && $config->get_cfg_value("forceglobals") == "TRUE") {
......
......@@ -74,7 +74,7 @@ class Language
}
session::global_un_set('plist');
session::global_set('lang', $lang);
load_plist();
pluglist::load();
}
}
......
......@@ -510,5 +510,26 @@ class pluglist {
trigger_error('plist not loaded yet');
}
}
/*!
* \brief Loads plist and load it in config object
*/
static function load($ldap_available = TRUE)
{
global $config, $plist;
if (!session::global_is_set('plist')) {
/* Initially load all classes */
load_all_classes();
$plist = new pluglist();
session::global_set('plist', $plist);
$config->loadPlist($plist);
if ($ldap_available) {
$config->get_departments();
$config->make_idepartments();
}
}
return session::global_get('plist');
}
}
?>
......@@ -98,7 +98,7 @@ class standAlonePage {
session::global_un_set('plist');
}
$ui = new userinfoNoAuth(get_class($this));
load_plist();
pluglist::load();
$ssl = $this->checkForSSL();
}
......
......@@ -154,27 +154,6 @@ function plugin_available($plugin)
}
}
/*!
* \brief Loads plist and load it in config object
*/
function load_plist ($ldap_available = TRUE)
{
global $config, $plist;
if (!session::global_is_set('plist')) {
/* Initially load all classes */
load_all_classes();
$plist = new pluglist();
session::global_set('plist', $plist);
$config->loadPlist($plist);
if ($ldap_available) {
$config->get_departments();
$config->make_idepartments();
}
}
return session::global_get('plist');
}
/*!
* \brief Debug level action
*
......
......@@ -126,7 +126,7 @@ class LoginMethod
if (!$plistReloaded) {
session::global_un_set('plist');
}
$plist = load_plist();
pluglist::load();
/* Check that newly installed plugins have their configuration in the LDAP (will reload plist if needed) */
$config->checkLdapConfig();
......
......@@ -28,7 +28,7 @@ class tabs_configInLdap extends simpleTabs_noSpecial
$config->check_and_reload(TRUE);
/* reload plist as well as some plInfo might use $config or get_ou */
session::global_un_set('plist');
load_plist();
pluglist::load();
session::un_set('passwordMethod::get_available_methods');
return $errors;
......
......@@ -276,7 +276,7 @@ class setup
$config->parse_data($xml);
$config->set_current($config->data['MAIN']['DEFAULT']);
session::global_un_set('plist');
load_plist();
pluglist::load();
$this->reBuildConfigStep();
}
......
......@@ -119,7 +119,7 @@ class setupStepConfig extends configInLdap
/* Reload config from LDAP */
$config->set_current($config->current['NAME']);
session::global_un_set('plist');
load_plist();
pluglist::load();
$this->is_completed = TRUE;
$this->parent->reBuildConfigStep(TRUE);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment