Skip to content

Commit

Permalink
feat(user_ldap): Add a --clearcache option to ldap:test-user-settings
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc authored and AndyScherzinger committed Feb 9, 2025
1 parent 27673a3 commit cf28324
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/user_ldap/lib/Command/TestUserSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
;
}

Expand All @@ -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)) {
Expand Down

0 comments on commit cf28324

Please sign in to comment.