From cf283249cc1c38da63d023e35a0b87a50078d902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 30 Jan 2025 15:07:15 +0100 Subject: [PATCH] feat(user_ldap): Add a --clearcache option to ldap:test-user-settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/user_ldap/lib/Command/TestUserSettings.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/user_ldap/lib/Command/TestUserSettings.php b/apps/user_ldap/lib/Command/TestUserSettings.php index 78188332a4211..88524eded02cc 100644 --- a/apps/user_ldap/lib/Command/TestUserSettings.php +++ b/apps/user_ldap/lib/Command/TestUserSettings.php @@ -46,6 +46,12 @@ protected function configure(): void { InputOption::VALUE_REQUIRED, 'A group DN to check if the user is a member or not' ) + ->addOption( + 'clearcache', + null, + InputOption::VALUE_NONE, + 'Clear the cache of the LDAP connection before the beginning of tests' + ) ; } @@ -54,6 +60,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $uid = $input->getArgument('user'); $access = $this->backend->getLDAPAccess($uid); $connection = $access->getConnection(); + if ($input->getOption('clearcache')) { + $connection->clearCache(); + } $configPrefix = $connection->getConfigPrefix(); $knownDn = ''; if ($access->stringResemblesDN($uid)) {