aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-08-07 14:06:15 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-08-10 10:57:37 +0200
commitb8a0954f553674379983506e050abe2418b04d7d (patch)
tree3c59fe876297b59e9645d69d2c2927e4149e8897 /apps/user_ldap
parent5425f7d3bda18e02e504a1b10905e21939296be5 (diff)
downloadnextcloud-server-b8a0954f553674379983506e050abe2418b04d7d.tar.gz
nextcloud-server-b8a0954f553674379983506e050abe2418b04d7d.zip
Fix check-group --update for deleted groups
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/Command/CheckGroup.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/Command/CheckGroup.php b/apps/user_ldap/lib/Command/CheckGroup.php
index d55b846020a..68f96512a9b 100644
--- a/apps/user_ldap/lib/Command/CheckGroup.php
+++ b/apps/user_ldap/lib/Command/CheckGroup.php
@@ -100,11 +100,19 @@ class CheckGroup extends Command {
$output->writeln('The group is still available on LDAP.');
if ($input->getOption('update')) {
$this->backend->getLDAPAccess($gid)->connection->clearCache();
- $this->updateGroup($gid, $output, $wasMapped);
+ if ($wasMapped) {
+ $this->service->handleKnownGroups([$gid]);
+ } else {
+ $this->service->handleCreatedGroups([$gid]);
+ }
}
return 0;
} elseif ($wasMapped) {
- $output->writeln('The group does not exists on LDAP anymore.');
+ $output->writeln('The group does not exist on LDAP anymore.');
+ if ($input->getOption('update')) {
+ $this->backend->getLDAPAccess($gid)->connection->clearCache();
+ $this->service->handleRemovedGroups([$gid]);
+ }
return 0;
} else {
throw new \Exception('The given group is not a recognized LDAP group.');