Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat(user_ldap): Add a --clearcache option to ldap:test-user-settings
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc authored and AndyScherzinger committed Feb 9, 2025
commit cf283249cc1c38da63d023e35a0b87a50078d902
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
Loading