aboutsummaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-05-16 16:13:31 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-05-23 09:08:31 +0200
commit6d56f3557d3eba4f41d0381c6f8fc8fda036a3b4 (patch)
tree92a5389dd0f90945b8429104e34550540be83fd1 /apps/provisioning_api
parent474cbda59a4c5c4a225918724a871451a0f49a7f (diff)
downloadnextcloud-server-6d56f3557d3eba4f41d0381c6f8fc8fda036a3b4.tar.gz
nextcloud-server-6d56f3557d3eba4f41d0381c6f8fc8fda036a3b4.zip
feat: Add back searching in disabled user list
When disabled users where moved to their own endpoint we overlooked search, so adding it back. The search is done case-insensitive in uid and display name. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/provisioning_api')
-rw-r--r--apps/provisioning_api/lib/Controller/UsersController.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php
index 2e27d875ab4..5770ca39bda 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/apps/provisioning_api/lib/Controller/UsersController.php
@@ -225,13 +225,14 @@ class UsersController extends AUserData {
*
* Get the list of disabled users and their details
*
+ * @param string $search Text to search for
* @param ?int $limit Limit the amount of users returned
* @param int $offset Offset
* @return DataResponse<Http::STATUS_OK, array{users: array<string, Provisioning_APIUserDetails|array{id: string}>}, array{}>
*
* 200: Disabled users details returned
*/
- public function getDisabledUsersDetails(?int $limit = null, int $offset = 0): DataResponse {
+ public function getDisabledUsersDetails(string $search = '', ?int $limit = null, int $offset = 0): DataResponse {
$currentUser = $this->userSession->getUser();
if ($currentUser === null) {
return new DataResponse(['users' => []]);
@@ -249,7 +250,7 @@ class UsersController extends AUserData {
$uid = $currentUser->getUID();
$subAdminManager = $this->groupManager->getSubAdmin();
if ($this->groupManager->isAdmin($uid)) {
- $users = $this->userManager->getDisabledUsers($limit, $offset);
+ $users = $this->userManager->getDisabledUsers($limit, $offset, $search);
$users = array_map(fn (IUser $user): string => $user->getUID(), $users);
} elseif ($subAdminManager->isSubAdmin($currentUser)) {
$subAdminOfGroups = $subAdminManager->getSubAdminsGroups($currentUser);
@@ -263,7 +264,7 @@ class UsersController extends AUserData {
array_map(
fn (IUser $user): string => $user->getUID(),
array_filter(
- $group->searchUsers('', ($tempLimit === null ? null : $tempLimit - count($users))),
+ $group->searchUsers($search, ($tempLimit === null ? null : $tempLimit - count($users))),
fn (IUser $user): bool => !$user->isEnabled()
)
)