aboutsummaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/lib/Controller/UsersController.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-10-17 15:44:42 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-10-30 19:32:25 +0100
commit90fe35dfdf719d0e80e907474b3326a7733a1976 (patch)
tree4b4b7e3b0fcd86885c33e6efe687ad6d0b0cd3a2 /apps/provisioning_api/lib/Controller/UsersController.php
parent40c2764434e6ef99ffe7a6e1ac392e9d2bcb3d43 (diff)
downloadnextcloud-server-90fe35dfdf719d0e80e907474b3326a7733a1976.tar.gz
nextcloud-server-90fe35dfdf719d0e80e907474b3326a7733a1976.zip
fix(provisioning_api): Fix getting disabled users for group adminsbackport/48766/stable28
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/provisioning_api/lib/Controller/UsersController.php')
-rw-r--r--apps/provisioning_api/lib/Controller/UsersController.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php
index e1c60f3eb67..ee8dcf9fb29 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/apps/provisioning_api/lib/Controller/UsersController.php
@@ -277,21 +277,21 @@ class UsersController extends AUserData {
/* We have to handle offset ourselve for correctness */
$tempLimit = ($limit === null ? null : $limit + $offset);
foreach ($subAdminOfGroups as $group) {
- $users = array_merge(
+ $users = array_unique(array_merge(
$users,
array_map(
fn (IUser $user): string => $user->getUID(),
array_filter(
- $group->searchUsers($search, ($tempLimit === null ? null : $tempLimit - count($users))),
+ $group->searchUsers($search),
fn (IUser $user): bool => !$user->isEnabled()
)
)
- );
+ ));
if (($tempLimit !== null) && (count($users) >= $tempLimit)) {
break;
}
}
- $users = array_slice($users, $offset);
+ $users = array_slice($users, $offset, $limit);
}
$usersDetails = [];