Skip to content

Commit d80858c

Browse files
come-ncbackportbot[bot]
authored andcommitted
feat(user_ldap): Add a --clearcache option to ldap:test-user-settings
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com> [skip ci]
1 parent 91dda00 commit d80858c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

apps/user_ldap/lib/Command/TestUserSettings.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ protected function configure(): void {
4646
InputOption::VALUE_REQUIRED,
4747
'A group DN to check if the user is a member or not'
4848
)
49+
->addOption(
50+
'clearcache',
51+
null,
52+
InputOption::VALUE_NONE,
53+
'Clear the cache of the LDAP connection before the beginning of tests'
54+
)
4955
;
5056
}
5157

@@ -54,6 +60,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5460
$uid = $input->getArgument('user');
5561
$access = $this->backend->getLDAPAccess($uid);
5662
$connection = $access->getConnection();
63+
if ($input->getOption('clearcache')) {
64+
$connection->clearCache();
65+
}
5766
$configPrefix = $connection->getConfigPrefix();
5867
$knownDn = '';
5968
if ($access->stringResemblesDN($uid)) {

0 commit comments

Comments
 (0)