diff options
author | yemkareems <yemkareems@gmail.com> | 2024-07-04 14:41:05 +0530 |
---|---|---|
committer | yemkareems <yemkareems@gmail.com> | 2024-07-08 15:42:55 +0530 |
commit | ae95e467871cbf54df55b1b4f3f512d66b8b8880 (patch) | |
tree | 33985890c25c5939e1015e96a064857bf78722ee /apps/provisioning_api | |
parent | ceedfb46162e53d39460d25b781ddc21c5a9313f (diff) | |
download | nextcloud-server-ae95e467871cbf54df55b1b4f3f512d66b8b8880.tar.gz nextcloud-server-ae95e467871cbf54df55b1b4f3f512d66b8b8880.zip |
fix: limit and fixLimit removed. negative limit handled in controller. removed getUsersSortedByLastLogin from Manager and instead used the config in controller
Signed-off-by: yemkareems <yemkareems@gmail.com>
Diffstat (limited to 'apps/provisioning_api')
-rw-r--r-- | apps/provisioning_api/lib/Controller/UsersController.php | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index 66cce405335..1d3c1006a59 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -266,9 +266,7 @@ class UsersController extends AUserData { } /** - * @NoAdminRequired - * - * Get the list of last logged-in users and their details + * Gets the list of users sorted by lastLogin, from most recent to least recent * * @param string $search Text to search for * @param ?int $limit Limit the amount of users returned @@ -278,8 +276,8 @@ class UsersController extends AUserData { * 200: Users details returned based on last logged in information */ public function getLastLoggedInUsers(string $search = '', - ?int $limit = null, - int $offset = 0, + ?int $limit = null, + int $offset = 0, ): DataResponse { $currentUser = $this->userSession->getUser(); if ($currentUser === null) { @@ -295,11 +293,7 @@ class UsersController extends AUserData { $users = []; // For Admin alone user sorting based on lastLogin. For sub admin and groups this is not supported - $uid = $currentUser->getUID(); - if ($this->groupManager->isAdmin($uid)) { - $users = $this->userManager->getUsersSortedByLastLogin($limit, $offset, $search); - $users = array_map(fn (IUser $user): string => $user->getUID(), $users); - } + $users = $this->config->getLastLoggedInUsers($limit, $offset, $search); $usersDetails = []; foreach ($users as $userId) { |