Merge pull request #48449 from nextcloud/backport/48437/stable29

This commit is contained in:
Kate 2024-09-30 18:10:24 +02:00 committed by GitHub
commit 39a708b2e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -168,13 +168,13 @@ class UsersController extends Controller {
}, 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)) {
@ -184,7 +184,7 @@ class UsersController extends Controller {
}
$userCount += $this->userManager->countUsersOfGroups($groupsInfo->getGroups());
$disabledUsers = $this->userManager->countDisabledUsersOfGroups($groupsNames);
$disabledUsers = $this->userManager->countDisabledUsersOfGroups($groupsIds);
}
$userCount -= $disabledUsers;