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
Next Next commit
Fix check-group --update for deleted groups
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Aug 10, 2023
commit b8a0954f553674379983506e050abe2418b04d7d
12 changes: 10 additions & 2 deletions apps/user_ldap/lib/Command/CheckGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$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.');
Expand Down