mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix: correctly count disabled users for subadmins
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
This commit is contained in:
parent
31ad1c5f55
commit
2b2b4e9e96
1 changed files with 4 additions and 4 deletions
|
|
@ -147,13 +147,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)) {
|
||||
|
|
@ -163,7 +163,7 @@ class UsersController extends Controller {
|
|||
}
|
||||
|
||||
$userCount += $this->userManager->countUsersOfGroups($groupsInfo->getGroups());
|
||||
$disabledUsers = $this->userManager->countDisabledUsersOfGroups($groupsNames);
|
||||
$disabledUsers = $this->userManager->countDisabledUsersOfGroups($groupsIds);
|
||||
}
|
||||
|
||||
$userCount -= $disabledUsers;
|
||||
|
|
|
|||
Loading…
Reference in a new issue