Browse Source
Keep userids as keys on group search
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
pull/9884/head
John Molakvoæ (skjnldsv)
8 years ago
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
2 changed files with
6 additions and
5 deletions
-
apps/provisioning_api/lib/Controller/GroupsController.php
-
lib/private/Group/Group.php
|
|
|
@ -177,12 +177,13 @@ class GroupsController extends AUserData { |
|
|
|
* @NoAdminRequired |
|
|
|
* |
|
|
|
* @param string $groupId |
|
|
|
* @param string $search |
|
|
|
* @param int $limit |
|
|
|
* @param int $offset |
|
|
|
* @return DataResponse |
|
|
|
* @throws OCSException |
|
|
|
*/ |
|
|
|
public function getGroupUsersDetails(string $groupId, int $limit = null, int $offset = 0): DataResponse { |
|
|
|
public function getGroupUsersDetails(string $groupId, string $search = '', int $limit = null, int $offset = 0): DataResponse { |
|
|
|
$user = $this->userSession->getUser(); |
|
|
|
$isSubadminOfGroup = false; |
|
|
|
|
|
|
|
@ -197,9 +198,9 @@ class GroupsController extends AUserData { |
|
|
|
// Check subadmin has access to this group
|
|
|
|
if($this->groupManager->isAdmin($user->getUID()) |
|
|
|
|| $isSubadminOfGroup) { |
|
|
|
$users = $this->groupManager->get($groupId)->getUsers(); |
|
|
|
$users = $this->groupManager->get($groupId)->searchUsers($search, $limit, $offset); |
|
|
|
|
|
|
|
// Extract required number
|
|
|
|
$users = array_slice($users, $offset, $limit); |
|
|
|
$users = array_keys($users); |
|
|
|
$usersDetails = []; |
|
|
|
foreach ($users as $userId) { |
|
|
|
|
|
|
|
@ -211,10 +211,10 @@ class Group implements IGroup { |
|
|
|
$userIds = $backend->usersInGroup($this->gid, $search, $limit, $offset); |
|
|
|
$users += $this->getVerifiedUsers($userIds); |
|
|
|
if (!is_null($limit) and $limit <= 0) { |
|
|
|
return array_values($users); |
|
|
|
return $users; |
|
|
|
} |
|
|
|
} |
|
|
|
return array_values($users); |
|
|
|
return $users; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|