feat(user_ldap): Add a --clearcache option to ldap:test-user-settings

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/50567/head
Côme Chilliet 2025-01-30 15:07:15 +07:00
parent e094602311
commit 7fa117dd0f
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
1 changed files with 9 additions and 0 deletions

@ -46,6 +46,12 @@ class TestUserSettings extends Command {
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 @@ class TestUserSettings extends Command {
$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)) {