Skip to content

Commit

Permalink
Merge pull request #48447 from nextcloud/backport/48437/stable30
Browse files Browse the repository at this point in the history
  • Loading branch information
provokateurin authored Sep 30, 2024
2 parents 6949e21 + 962a971 commit 2bc1165
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/settings/lib/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ public function usersList(): TemplateResponse {
}, 0);
} else {
// User is subadmin !
// Map group list to names to retrieve the countDisabledUsersOfGroups
// Map group list to ids to retrieve the countDisabledUsersOfGroups
$userGroups = $this->groupManager->getUserGroups($user);
$groupsNames = [];
$groupsIds = [];

foreach ($groups as $key => $group) {
// $userCount += (int)$group['usercount'];
$groupsNames[] = $group['name'];
$groupsIds[] = $group['id'];
// we prevent subadmins from looking up themselves
// so we lower the count of the groups he belongs to
if (array_key_exists($group['id'], $userGroups)) {
Expand All @@ -163,7 +163,7 @@ public function usersList(): TemplateResponse {
}

$userCount += $this->userManager->countUsersOfGroups($groupsInfo->getGroups());
$disabledUsers = $this->userManager->countDisabledUsersOfGroups($groupsNames);
$disabledUsers = $this->userManager->countDisabledUsersOfGroups($groupsIds);
}

$userCount -= $disabledUsers;
Expand Down

0 comments on commit 2bc1165

Please sign in to comment.