diff --git a/html/setup.php b/html/setup.php index f8afdd83f191ffa8c6b40593ed2fa3460e69da62..a39929fecdd9d526d6f040d444eaf2cbc1ef2aac 100755 --- a/html/setup.php +++ b/html/setup.php @@ -106,10 +106,10 @@ if (!session::is_set('config')) { $config = new config(''); session::set('config', $config); } -//$config = session::get('config'); +$config = session::get('config'); IconTheme::loadThemes('themes'); /* Fake user bypassing acl system */ -//$ui = new userinfoNoAuth('setup'); +$ui = new userinfoNoAuth('setup'); /* Call setup */ setup::mainInc(); /** diff --git a/include/class_config.inc b/include/class_config.inc index f60571fb77fc176f62e2fa270b0a8d01cc0fcbfa..025e689e435b68c01cc506f234f1f0623980df3a 100755 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -124,7 +124,7 @@ class config * * This function checks if the configuration has changed, since it was * read the last time and reloads it. It uses the file mtime to check - * weither the file changed or not. + * if the file changed or not. */ function check_and_reload ($force = FALSE) { @@ -457,7 +457,7 @@ class config Lock::deleteByObject($dn); } - function load_inldap_config () + function load_inldap_config (): void { $ldap = $this->get_ldap_link(); $ldap->cat(CONFIGRDN.$this->current['BASE']); diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 00815d13c032a4dc3e9d56178fdeaa98e362a2cc..b06e6803cbf52aeb60dcdf7cfe93b4c2aece04f1 100755 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -260,6 +260,8 @@ class user extends simplePlugin function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) { global $config; + // Force to read ldap configuration saved in LDAP in case config is not up to date. + $config->load_inldap_config(); parent::__construct($dn, $object, $parent, $mainTab); if ($this->is_template && !$this->initially_was_account) { @@ -400,10 +402,11 @@ class user extends simplePlugin * @return void * Note : Create a snapshot of current data before save, verifying if data have changed before taking a snap. */ - public function generateAutomaticSnapshot () + public function generateAutomaticSnapshot (): void { // Get the hash of current data before modifications. global $config; + $ldap = $config->get_ldap_link(); $currentSnapHash = md5((string) $ldap->generateLdif($this->dn, '(!(objectClass=gosaDepartment))', 'sub')); @@ -411,6 +414,7 @@ class user extends simplePlugin $snapshotHandler = new SnapshotHandler(); $existingSnapshots = $snapshotHandler->getAvailableSnapsShots($this->dn); $sameHashExist = FALSE; + foreach ($existingSnapshots as $snap) { if (!empty($snap['fdSnapshotHash'][0]) && $snap['fdSnapshotHash'][0] === $currentSnapHash) { $sameHashExist = TRUE;