diff --git a/apps/settings/lib/Controller/UsersController.php b/apps/settings/lib/Controller/UsersController.php index f80b45c2b40f2..e517e51959383 100644 --- a/apps/settings/lib/Controller/UsersController.php +++ b/apps/settings/lib/Controller/UsersController.php @@ -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)) { @@ -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;