Loading lib/Command/MapActiveAttributetoLDAP.php +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ class MapActiveAttributetoLDAP extends Command { try { $this->userService->mapActiveAttributesInLDAP($username, $isEnabled); } catch (Exception $e) { $this->logger->error('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); $this->logger->logException('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); } } }); Loading lib/Listeners/UserChangedListener.php +1 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ class UserChangedListener implements IEventListener { try { $this->userService->mapActiveAttributesInLDAP($username, $newValue); } catch (Exception $e) { $this->logger->error('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); $this->logger->logException('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); } } } Loading lib/Service/UserService.php +3 −0 Original line number Diff line number Diff line Loading @@ -520,16 +520,19 @@ class UserService { throw new AddUsernameToCommonStoreException("Error adding username '$username' to common data store."); } } public function mapActiveAttributesInLDAP(string $username, bool $isEnabled): void { $userActiveAttributes = $this->getActiveAttributes($isEnabled); $this->updateAttributesInLDAP($username, $userActiveAttributes); } private function getActiveAttributes(bool $isEnabled): array { return [ 'active' => $isEnabled ? 'TRUE' : 'FALSE', 'mailActive' => $isEnabled ? 'TRUE' : 'FALSE', ]; } public function updateAttributesInLDAP(string $username, array $attributes): void { if (!$this->LDAPConnectionService->isLDAPEnabled()) { return; Loading Loading
lib/Command/MapActiveAttributetoLDAP.php +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ class MapActiveAttributetoLDAP extends Command { try { $this->userService->mapActiveAttributesInLDAP($username, $isEnabled); } catch (Exception $e) { $this->logger->error('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); $this->logger->logException('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); } } }); Loading
lib/Listeners/UserChangedListener.php +1 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ class UserChangedListener implements IEventListener { try { $this->userService->mapActiveAttributesInLDAP($username, $newValue); } catch (Exception $e) { $this->logger->error('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); $this->logger->logException('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); } } } Loading
lib/Service/UserService.php +3 −0 Original line number Diff line number Diff line Loading @@ -520,16 +520,19 @@ class UserService { throw new AddUsernameToCommonStoreException("Error adding username '$username' to common data store."); } } public function mapActiveAttributesInLDAP(string $username, bool $isEnabled): void { $userActiveAttributes = $this->getActiveAttributes($isEnabled); $this->updateAttributesInLDAP($username, $userActiveAttributes); } private function getActiveAttributes(bool $isEnabled): array { return [ 'active' => $isEnabled ? 'TRUE' : 'FALSE', 'mailActive' => $isEnabled ? 'TRUE' : 'FALSE', ]; } public function updateAttributesInLDAP(string $username, array $attributes): void { if (!$this->LDAPConnectionService->isLDAPEnabled()) { return; Loading