aboutsummaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/lib
diff options
context:
space:
mode:
authoryemkareems <yemkareems@gmail.com>2024-05-28 16:23:51 +0530
committeryemkareems <yemkareems@gmail.com>2024-07-08 15:42:55 +0530
commit76c875a5882753e37ef39015a1711b68e7ea0d0b (patch)
tree15f233f126587ba56b8c58a435e11c8632dc2550 /apps/provisioning_api/lib
parent33b38c6573cbd197989539601ddfcb4524eb4c48 (diff)
downloadnextcloud-server-76c875a5882753e37ef39015a1711b68e7ea0d0b.tar.gz
nextcloud-server-76c875a5882753e37ef39015a1711b68e7ea0d0b.zip
fix: change orderBy and sort to sortMode and sortOrder. default it to uid asc. enable email search by changing query
Signed-off-by: yemkareems <yemkareems@gmail.com>
Diffstat (limited to 'apps/provisioning_api/lib')
-rw-r--r--apps/provisioning_api/lib/Controller/UsersController.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php
index e0b5b7b28ac..eced881516f 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/apps/provisioning_api/lib/Controller/UsersController.php
@@ -94,7 +94,7 @@ class UsersController extends AUserData {
*
* 200: Users returned
*/
- public function getUsers(string $search = '', ?int $limit = null, int $offset = 0, string $orderBy = 'lastLogin', string $sort = 'DESC'): DataResponse {
+ public function getUsers(string $search = '', ?int $limit = null, int $offset = 0, string $sortMode = 'uid', string $sortOrder = 'asc'): DataResponse {
$user = $this->userSession->getUser();
$users = [];
@@ -102,7 +102,7 @@ class UsersController extends AUserData {
$uid = $user->getUID();
$subAdminManager = $this->groupManager->getSubAdmin();
if ($this->groupManager->isAdmin($uid)) {
- $users = $this->userManager->search($search, $limit, $offset, $orderBy, $sort);
+ $users = $this->userManager->search($search, $limit, $offset, $sortMode, $sortOrder);
} elseif ($subAdminManager->isSubAdmin($user)) {
$subAdminOfGroups = $subAdminManager->getSubAdminsGroups($user);
foreach ($subAdminOfGroups as $key => $group) {
@@ -131,13 +131,13 @@ class UsersController extends AUserData {
* @param string $search Text to search for
* @param int|null $limit Limit the amount of groups returned
* @param int $offset Offset for searching for groups
- * @param string $orderBy Field to order the results with
- * @param string $sort ASC or DESC
+ * @param string $sortMode Field to order the results with
+ * @param string $sortOrder asc or desc
* @return DataResponse<Http::STATUS_OK, array{users: array<string, Provisioning_APIUserDetails|array{id: string}>}, array{}>
*
* 200: Users details returned
*/
- public function getUsersDetails(string $search = '', ?int $limit = null, int $offset = 0, string $orderBy = 'lastLogin', string $sort = 'DESC'): DataResponse {
+ public function getUsersDetails(string $search = '', ?int $limit = null, int $offset = 0, string $sortMode = 'uid', string $sortOrder = 'asc'): DataResponse {
$currentUser = $this->userSession->getUser();
$users = [];
@@ -145,7 +145,7 @@ class UsersController extends AUserData {
$uid = $currentUser->getUID();
$subAdminManager = $this->groupManager->getSubAdmin();
if ($this->groupManager->isAdmin($uid)) {
- $users = $this->userManager->search($search, $limit, $offset, $orderBy, $sort);
+ $users = $this->userManager->search($search, $limit, $offset, $sortMode, $sortOrder);
$users = array_keys($users);
} elseif ($subAdminManager->isSubAdmin($currentUser)) {
$subAdminOfGroups = $subAdminManager->getSubAdminsGroups($currentUser);
@@ -155,7 +155,7 @@ class UsersController extends AUserData {
$users = [];
foreach ($subAdminOfGroups as $group) {
- $users[] = array_keys($this->groupManager->displayNamesInGroup($group, $search, $limit, $offset, $orderBy, $sort));
+ $users[] = array_keys($this->groupManager->displayNamesInGroup($group, $search, $limit, $offset, $sortMode, $sortOrder));
}
$users = array_merge(...$users);
}