Loading lib/Command/MapActiveAttributetoLDAP.php +10 −2 Original line number Diff line number Diff line Loading @@ -4,8 +4,10 @@ declare(strict_types=1); namespace OCA\EcloudAccounts\Command; use Exception; use OCA\EcloudAccounts\AppInfo\Application; use OCA\EcloudAccounts\Service\UserService; use OCP\ILogger; use OCP\IUser; use OCP\IUserManager; use Symfony\Component\Console\Command\Command; Loading @@ -16,10 +18,12 @@ class MapActiveAttributetoLDAP extends Command { private OutputInterface $commandOutput; private IUserManager $userManager; private $userService; private $logger; public function __construct(IUserManager $userManager, UserService $userService) { public function __construct(IUserManager $userManager, ILogger $logger, UserService $userService) { $this->userManager = $userManager; $this->userService = $userService; $this->logger = $logger; parent::__construct(); } Loading @@ -36,7 +40,11 @@ class MapActiveAttributetoLDAP extends Command { if ($this->isUserValid($user)) { $username = $user->getUID(); $isEnabled = $user->isEnabled() ? true : false; try { $this->userService->mapActiveAttributesInLDAP($username, $isEnabled); } catch (Exception $e) { $this->logger->error('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); } } }); $this->commandOutput->writeln('Active attributes mapped successfully.'); Loading lib/Listeners/UserChangedListener.php +5 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,11 @@ class UserChangedListener implements IEventListener { /** @var mixed $newValue */ $newValue = $event->getValue(); if ($feature === self::ENABLED_FEATURE) { try { $this->userService->mapActiveAttributesInLDAP($username, $newValue); } catch (Exception $e) { $this->logger->error('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); } } } Loading Loading
lib/Command/MapActiveAttributetoLDAP.php +10 −2 Original line number Diff line number Diff line Loading @@ -4,8 +4,10 @@ declare(strict_types=1); namespace OCA\EcloudAccounts\Command; use Exception; use OCA\EcloudAccounts\AppInfo\Application; use OCA\EcloudAccounts\Service\UserService; use OCP\ILogger; use OCP\IUser; use OCP\IUserManager; use Symfony\Component\Console\Command\Command; Loading @@ -16,10 +18,12 @@ class MapActiveAttributetoLDAP extends Command { private OutputInterface $commandOutput; private IUserManager $userManager; private $userService; private $logger; public function __construct(IUserManager $userManager, UserService $userService) { public function __construct(IUserManager $userManager, ILogger $logger, UserService $userService) { $this->userManager = $userManager; $this->userService = $userService; $this->logger = $logger; parent::__construct(); } Loading @@ -36,7 +40,11 @@ class MapActiveAttributetoLDAP extends Command { if ($this->isUserValid($user)) { $username = $user->getUID(); $isEnabled = $user->isEnabled() ? true : false; try { $this->userService->mapActiveAttributesInLDAP($username, $isEnabled); } catch (Exception $e) { $this->logger->error('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); } } }); $this->commandOutput->writeln('Active attributes mapped successfully.'); Loading
lib/Listeners/UserChangedListener.php +5 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,11 @@ class UserChangedListener implements IEventListener { /** @var mixed $newValue */ $newValue = $event->getValue(); if ($feature === self::ENABLED_FEATURE) { try { $this->userService->mapActiveAttributesInLDAP($username, $newValue); } catch (Exception $e) { $this->logger->error('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); } } } Loading