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
parent
commit
cc2d58a850
No known key found for this signature in database GPG Key ID: 60C25B8C072916CF
  1. 7
      apps/provisioning_api/lib/Controller/GroupsController.php
  2. 4
      lib/private/Group/Group.php

7
apps/provisioning_api/lib/Controller/GroupsController.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) {

4
lib/private/Group/Group.php

@ -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;
}
/**

Loading…
Cancel
Save