Skip to content

Commit d07a92d

Browse files
come-ncsolracsf
authored andcommitted
fix(provisioning_api): Fix getting disabled users for group admins
Signed-off-by: Côme Chilliet <[email protected]>
1 parent 794ab73 commit d07a92d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/provisioning_api/lib/Controller/UsersController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,21 +259,21 @@ public function getDisabledUsersDetails(string $search = '', ?int $limit = null,
259259
/* We have to handle offset ourselve for correctness */
260260
$tempLimit = ($limit === null ? null : $limit + $offset);
261261
foreach ($subAdminOfGroups as $group) {
262-
$users = array_merge(
262+
$users = array_unique(array_merge(
263263
$users,
264264
array_map(
265265
fn (IUser $user): string => $user->getUID(),
266266
array_filter(
267-
$group->searchUsers($search, ($tempLimit === null ? null : $tempLimit - count($users))),
267+
$group->searchUsers($search),
268268
fn (IUser $user): bool => !$user->isEnabled()
269269
)
270270
)
271-
);
271+
));
272272
if (($tempLimit !== null) && (count($users) >= $tempLimit)) {
273273
break;
274274
}
275275
}
276-
$users = array_slice($users, $offset);
276+
$users = array_slice($users, $offset, $limit);
277277
}
278278

279279
$usersDetails = [];

0 commit comments

Comments
 (0)