summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-10-17 15:44:42 +0200
committerGit'Fellow <12234510+solracsf@users.noreply.github.com>2024-10-31 07:51:26 +0100
commitd07a92d85993c03a318a4fc9a399b54d4077ea80 (patch)
treef15fa9bcbb1d6cb334856aa95aa79b6cd4f0210a
parent794ab730e77115e38dba7dab4a70b630a4fc73ae (diff)
downloadnextcloud-server-d07a92d85993c03a318a4fc9a399b54d4077ea80.tar.gz
nextcloud-server-d07a92d85993c03a318a4fc9a399b54d4077ea80.zip
fix(provisioning_api): Fix getting disabled users for group adminsbackport/48766/stable29
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 5770ca39bda..16c436e7f7a 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/apps/provisioning_api/lib/Controller/UsersController.php
@@ -259,21 +259,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 = [];