@ -225,13 +225,14 @@ class UsersController extends AUserData {
*
*
* Get the list of disabled users and their details
* 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 $limit Limit the amount of users returned
* @param int $offset Offset
* @param int $offset Offset
* @return DataResponse< Http::STATUS_OK , array { users: array < string , Provisioning_APIUserDetails | array { id: string } > }, array{}>
* @return DataResponse< Http::STATUS_OK , array { users: array < string , Provisioning_APIUserDetails | array { id: string } > }, array{}>
*
*
* 200: Disabled users details returned
* 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();
$currentUser = $this->userSession->getUser();
if ($currentUser === null) {
if ($currentUser === null) {
return new DataResponse(['users' => []]);
return new DataResponse(['users' => []]);
@ -249,7 +250,7 @@ class UsersController extends AUserData {
$uid = $currentUser->getUID();
$uid = $currentUser->getUID();
$subAdminManager = $this->groupManager->getSubAdmin();
$subAdminManager = $this->groupManager->getSubAdmin();
if ($this->groupManager->isAdmin($uid)) {
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);
$users = array_map(fn (IUser $user): string => $user->getUID(), $users);
} elseif ($subAdminManager->isSubAdmin($currentUser)) {
} elseif ($subAdminManager->isSubAdmin($currentUser)) {
$subAdminOfGroups = $subAdminManager->getSubAdminsGroups($currentUser);
$subAdminOfGroups = $subAdminManager->getSubAdminsGroups($currentUser);
@ -263,7 +264,7 @@ class UsersController extends AUserData {
array_map(
array_map(
fn (IUser $user): string => $user->getUID(),
fn (IUser $user): string => $user->getUID(),
array_filter(
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()
fn (IUser $user): bool => !$user->isEnabled()
)
)
)
)