Skip to content

Commit

Permalink
Merge pull request #48448 from nextcloud/backport/48437/stable28
Browse files Browse the repository at this point in the history
  • Loading branch information
provokateurin authored Sep 30, 2024
2 parents 31212bb + b4f28b3 commit 06c7baf
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 @@ -214,13 +214,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 @@ -229,7 +229,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 06c7baf

Please sign in to comment.