Skip to content

Commit

Permalink
Merge pull request #889 from nextcloud/debug/log-group-ops
Browse files Browse the repository at this point in the history
debug(Groups): log group handling upon login
  • Loading branch information
blizzz authored Oct 8, 2024
2 parents e08e742 + fb558e9 commit 986cfb9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/GroupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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)) {
Expand Down Expand Up @@ -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()]);
}
Expand Down

0 comments on commit 986cfb9

Please # to comment.