aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-10-17 15:44:42 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-10-29 10:43:48 +0000
commitf7185d8497b9e7317e1a4d98a8e8d9bfd8364510 (patch)
treee9417a84761b44dd59dd52b3b1299bcdbc3e2365
parentb2b1be0475194a3b2fb2a26e62de89b9a1b606d9 (diff)
downloadnextcloud-server-f7185d8497b9e7317e1a4d98a8e8d9bfd8364510.tar.gz
nextcloud-server-f7185d8497b9e7317e1a4d98a8e8d9bfd8364510.zip
fix(provisioning_api): Fix getting disabled users for group adminsbackport/48766/stable30
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-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 b0ddd4329af..7c97641405f 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/apps/provisioning_api/lib/Controller/UsersController.php
@@ -231,21 +231,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 = [];