Fix username for subadmins and only send subadmin groups

Fix #9748
remotes/origin/fix-10825
Joas Schilling 2014-07-21 11:20:55 +07:00
parent ddd8eae932
commit e6c75aa974
1 changed files with 5 additions and 2 deletions

@ -76,10 +76,13 @@ if (OC_User::isAdminUser(OC_User::getUser())) {
$batch = OC_Group::usersInGroups($groups, $pattern, $limit, $offset);
foreach ($batch as $uid) {
$user = $userManager->get($uid);
// Only add the groups, this user is a subadmin of
$userGroups = array_intersect(OC_Group::getUserGroups($uid), OC_SubAdmin::getSubAdminsGroups(OC_User::getUser()));
$users[] = array(
'name' => $user,
'name' => $uid,
'displayname' => $user->getDisplayName(),
'groups' => join(', ', OC_Group::getUserGroups($uid)),
'groups' => join(', ', $userGroups),
'quota' => OC_Preferences::getValue($uid, 'files', 'quota', 'default'),
'storageLocation' => $user->getHome(),
'lastLogin' => $user->getLastLogin(),