aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMaksim Sukharev <antreesy.web@gmail.com>2024-09-28 18:46:16 +0200
committerMaksim Sukharev <antreesy.web@gmail.com>2024-09-28 18:46:16 +0200
commit2b2b4e9e96a3bd07dc099f1500f0854527585b0e (patch)
treed238e0b21536b8656932af1234e7c84c83ec559a /apps
parent31ad1c5f552265d3e58496cde85914e58f0e3e2d (diff)
downloadnextcloud-server-2b2b4e9e96a3bd07dc099f1500f0854527585b0e.tar.gz
nextcloud-server-2b2b4e9e96a3bd07dc099f1500f0854527585b0e.zip
fix: correctly count disabled users for subadminsfix/noid/count-disabled-correct
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/lib/Controller/UsersController.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/settings/lib/Controller/UsersController.php b/apps/settings/lib/Controller/UsersController.php
index 71f256f57d6..88a2a6ba6eb 100644
--- a/apps/settings/lib/Controller/UsersController.php
+++ b/apps/settings/lib/Controller/UsersController.php
@@ -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;