diff --git a/html/setup.php b/html/setup.php index a39929fecdd9d526d6f040d444eaf2cbc1ef2aac..2ef305939a68bf8d7c69cc188497846cadcaf896 100755 --- a/html/setup.php +++ b/html/setup.php @@ -56,8 +56,10 @@ session_cache_expire(60 * 24); ini_set("session.gc_maxlifetime", 24 * 60 * 60); /* Start session */ -session::start(); +session_start(); // Start or resume the session + session::set('DEBUGLEVEL', 0); +session::set('SETUP_INIT', TRUE); CSRFProtection::check(); diff --git a/include/class_config.inc b/include/class_config.inc index e569a72a8b38344a08dbe403d0bb1447f7a0c9a0..9f9028a032ac331a56efddfc7cb01e0e6e827a2c 100755 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -105,25 +105,28 @@ class config * @return void * Note : Magic method allowing to regenerate required data set in $_SESSION during restoration. */ - public function __unserialize(array $data): void + public function __unserialize (array $data): void { - $this->config_found = $data['config_found']; - $this->tags = $data['tags']; - $this->level = $data['level']; + $this->config_found = $data['config_found']; + $this->tags = $data['tags']; + $this->level = $data['level']; $this->currentLocation = $data['currentLocation']; - $this->current = $data['current']; - $this->referrals = $data['referrals']; - $this->data = $data['data']; + $this->current = $data['current']; + $this->referrals = $data['referrals']; + $this->data = $data['data']; // We reset the value of hooks (avoiding duplication). $this->data['HOOKS'] = []; // Recreate the XML parser $this->parser = xml_parser_create(); - // Update config from backend - $this->load_inldap_config(); + // Update config from backend only if not currently performing FD installation. + if ($_SESSION['SETUP_INIT'] === FALSE) { + $this->load_inldap_config(); + } } + /*! * \brief Check and reload the configuration * @@ -351,6 +354,7 @@ class config if (($this->ldapLink === NULL) || ($this->ldapLink->cid === FALSE)) { /* Build new connection */ + $this->ldapLink = LDAP::init($this->current['SERVER'], $this->current['BASE'], $this->current['ADMINDN'], $this->get_credentials($this->current['ADMINPASSWORD'])); diff --git a/include/management/columns/class_supannEtatDateColumn.inc b/include/management/columns/class_supannEtatDateColumn.inc index 538d3d0aa7b3486b8bb9f1ec3d9b13199c99135c..c2dfe073bd83af7c1749523b2873f90e531aec97 100644 --- a/include/management/columns/class_supannEtatDateColumn.inc +++ b/include/management/columns/class_supannEtatDateColumn.inc @@ -63,7 +63,7 @@ class SupannEtatDateColumn extends LinkColumn try { return (new DateTimeImmutable())->setDate($year, $month, $day); - } catch (\Exception $e) { + } catch (\Exception) { } } return NULL; diff --git a/include/simpleplugin/class_simplePlugin.inc b/include/simpleplugin/class_simplePlugin.inc index 96e360307ea50f6411b7114a65627f9c46ed4e01..153be210b17ad65e92bf9479275a997f7904ec8a 100755 --- a/include/simpleplugin/class_simplePlugin.inc +++ b/include/simpleplugin/class_simplePlugin.inc @@ -307,7 +307,6 @@ class simplePlugin implements SimpleTab } } - public static function setUserLocked (bool $locked): void { self::$user_locked = $locked; diff --git a/setup/class_setupStep.inc b/setup/class_setupStep.inc index 6c9222bbe849bc381748d14b9f61eaf8bd4322e3..ac0d6a34c41482d3d42a93d5225b5d62288e4331 100755 --- a/setup/class_setupStep.inc +++ b/setup/class_setupStep.inc @@ -44,26 +44,28 @@ class setupStep extends simplePlugin public function __serialize(): array { - return [ - 's_short_name' => $this->s_short_name, - 's_title' => $this->s_title, - 's_description' => $this->s_description, - 'is_active' => $this->is_active, - 'is_enabled' => $this->is_enabled, - 'is_completed' => $this->is_completed, - 'header_image' => $this->header_image, - ]; + $data = []; + + foreach (get_object_vars($this) as $key => $value) { + if (is_resource($value)) { + continue; + } + + if ($value instanceof \LDAP\Connection) { + continue; + } + + $data[$key] = $value; + } + + return $data; } public function __unserialize(array $data): void { - $this->s_short_name = $data['s_short_name'] ?? 'Still undefined'; - $this->s_title = $data['s_title'] ?? 'Still undefined'; - $this->s_description = $data['s_description'] ?? 'Still undefined'; - $this->is_active = $data['is_active'] ?? FALSE; - $this->is_enabled = $data['is_enabled'] ?? FALSE; - $this->is_completed = $data['is_completed'] ?? FALSE; - $this->header_image = $data['header_image'] ?? ''; + foreach ($data as $key => $value) { + $this->$key = $value; + } } function update_strings () diff --git a/setup/class_setupStepWelcome.inc b/setup/class_setupStepWelcome.inc index 94ddfcba340bc78514b2bf4248ed969f82429a50..1e28e375f0e958b47ec40bbc083296dd8f0d7e4b 100755 --- a/setup/class_setupStepWelcome.inc +++ b/setup/class_setupStepWelcome.inc @@ -38,7 +38,6 @@ class setupStepWelcome extends setupStep function __construct ($parent) { parent::__construct($parent); - $this->is_enabled = TRUE; $this->is_active = TRUE; $this->authPath = CACHE_DIR.'fusiondirectory.auth';