diff --git a/supann/personal/supann/class_supannAccountStatus.inc b/supann/personal/supann/class_supannAccountStatus.inc index 320a99e5cee5bd53555205d89d55de0b393c2384..7293cf1f6172b65487eeeccb49d7024d0353a263 100644 --- a/supann/personal/supann/class_supannAccountStatus.inc +++ b/supann/personal/supann/class_supannAccountStatus.inc @@ -209,15 +209,8 @@ class supannAccountStatus extends simplePlugin implements UserTabLockingAction { foreach ($this->supannRessourceEtatDate as $line) { list($label, $state, $substate, $start, $end) = $this->attributesAccess['supannRessourceEtatDate']->attribute->readValues($line); - - switch ($label) { - case 'COMPTE': - $this->processAccountState($state); - break; - - case 'MAIL': - $this->processMailState(); - break; + if ($label === 'COMPTE') { + $this->processAccountState($state); } } @@ -228,31 +221,20 @@ class supannAccountStatus extends simplePlugin implements UserTabLockingAction * @param string $state * @return void * Note : The concept of locking account is based on the modification of password hash. - * The passwordMethod class will trigger fillLockingLDAPAttrs methods of each plugins to lock what needs to be locked. + * The passwordMethod class will not trigger fillLockingLDAPAttrs methods of each plugin to lock everything. + * It only locked the account access by password modification - fillLockingLDAPAttrs is only available via general lock. */ protected function processAccountState(string $state): void { if ($state === 'A') { // Unlock account - userManagement::lockUser('unlock', $this->parent->getBaseObject()->userPassword, $this->dn); + userManagement::lockUser('unlock', $this->parent->getBaseObject()->userPassword, $this->dn, FALSE); } elseif (in_array($state, ['S', 'I'], true)) { // Lock account userManagement::lockUser('lock', $this->parent->getBaseObject()->userPassword, $this->dn); } } - /** - * @return void - * Part of the locking mechanism, this is for mail, the logic is within its plugin. At time of processing, the mail - * tab is not aware of supann change. Only upon user refresh will it notices and act upon it. Potentially locking its - * own resources or web services attached. (The change of attribute for another tab before save is tricky (v1.5). - */ - protected function processMailState(): void - { - // Refresh user info regardless of state - userManagement::refreshUserInfo($this->dn); - } - public function fillLockingLDAPAttrs (string $mode, array &$modify) { if (empty($this->supannRessourceEtatDate)) {