From fb558e981304f625f2e09d56329f24cdb5bf790c Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Wed, 18 Sep 2024 17:40:56 +0200 Subject: [PATCH] debug(Groups): log group handling upon login Signed-off-by: Arthur Schiwon --- lib/GroupManager.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/GroupManager.php b/lib/GroupManager.php index c0cad4a1..0b3c3468 100644 --- a/lib/GroupManager.php +++ b/lib/GroupManager.php @@ -70,6 +70,7 @@ public function __construct( private function getGroupsToRemove(array $samlGroupNames, array $assignedGroups): array { $groupsToRemove = []; foreach ($assignedGroups as $group) { + \OCP\Log\logger('user_saml')->debug('Checking group {group} for removal', ['group' => $group->getGID()]); if (in_array($group->getGID(), $samlGroupNames, true)) { continue; } @@ -91,6 +92,7 @@ private function getGroupsToRemove(array $samlGroupNames, array $assignedGroups) private function getGroupsToAdd(array $samlGroupNames, array $assignedGroupIds): array { $groupsToAdd = []; foreach ($samlGroupNames as $groupName) { + \OCP\Log\logger('user_saml')->debug('Checking group {group} for addition', ['group' => $groupName]); $group = $this->groupManager->get($groupName); // if user is not assigned to the group or the provided group has a non SAML backend if (!in_array($groupName, $assignedGroupIds) || !$this->hasSamlBackend($group)) { @@ -296,7 +298,9 @@ protected function mayModifyGroup(?IGroup $group): bool { && $this->isGroupInTransitionList($group->getGID()); if ($isInTransition) { + \OCP\Log\logger('user_saml')->debug('Checking group {group} for foreign members', ['group' => $group->getGID()]); $hasOnlySamlUsers = !$this->hasGroupForeignMembers($group); + \OCP\Log\logger('user_saml')->debug('Completed checking group {group} for foreign members', ['group' => $group->getGID()]); if (!$hasOnlySamlUsers) { $this->updateCandidatePool([$group->getGID()]); }