diff --git a/lib/private/group/metadata.php b/lib/private/group/metadata.php index 57abbe20c64..687a735347c 100644 --- a/lib/private/group/metadata.php +++ b/lib/private/group/metadata.php @@ -168,7 +168,21 @@ class MetaData { if($this->isAdmin) { return $this->groupManager->search($search); } else { - return \OC_SubAdmin::getSubAdminsGroups($this->user); + $groupIds = \OC_SubAdmin::getSubAdminsGroups($this->user); + + /* \OC_SubAdmin::getSubAdminsGroups() returns an array of GIDs, but this + * method is expected to return an array with the GIDs as keys and group objects as + * values, so we need to convert this information. + */ + $groups = array(); + foreach($groupIds as $gid) { + $group = $this->groupManager->get($gid); + if (!is_null($group)) { + $groups[$gid] = $group; + } + } + + return $groups; } } } diff --git a/settings/users.php b/settings/users.php index 29a63a4496a..bc6c2ea7e7c 100644 --- a/settings/users.php +++ b/settings/users.php @@ -35,7 +35,14 @@ if($isAdmin) { $accessibleUsers = OC_User::getDisplayNames('', 30); $subadmins = OC_SubAdmin::getAllSubAdmins(); }else{ - $accessibleUsers = OC_Group::displayNamesInGroups($groups, '', 30); + /* Retrieve group IDs from $groups array, so we can pass that information into OC_Group::displayNamesInGroups() */ + $gids = array(); + foreach($groups as $group) { + if (isset($group['id'])) { + $gids[] = $group['id']; + } + } + $accessibleUsers = OC_Group::displayNamesInGroups($gids, '', 30); $subadmins = false; }