Use limit and offset for subadmin users

This commit is contained in:
Michael Gapczynski 2012-08-11 16:24:50 -04:00
parent a1c88a3e39
commit 651245effa
2 changed files with 3 additions and 3 deletions

View file

@ -33,11 +33,11 @@ $users = array();
if (OC_Group::inGroup(OC_User::getUser(), 'admin')) {
$batch = OC_User::getUsers('', 10, $offset);
foreach ($batch as $user) {
$users[] = array('name' => $user, 'groups' => join(', ', OC_Group::getUserGroups($user)), 'subadmin' => implode(', ',OC_SubAdmin::getSubAdminsGroups($user)), 'quota' => OC_Preferences::getValue($user, 'files', 'quota', 'default'));
$users[] = array('name' => $user, 'groups' => join(', ', OC_Group::getUserGroups($user)), 'subadmin' => join(', ',OC_SubAdmin::getSubAdminsGroups($user)), 'quota' => OC_Preferences::getValue($user, 'files', 'quota', 'default'));
}
} else {
$groups = OC_SubAdmin::getSubAdminsGroups(OC_User::getUser());
$batch = OC_Group::usersInGroups($groups);
$batch = OC_Group::usersInGroups($groups, '', 10, $offset);
foreach ($batch as $user) {
$users[] = array('name' => $user, 'groups' => join(', ', OC_Group::getUserGroups($user)), 'quota' => OC_Preferences::getValue($user, 'files', 'quota', 'default'));
}

View file

@ -26,7 +26,7 @@ if($isadmin){
$subadmins = OC_SubAdmin::getAllSubAdmins();
}else{
$accessiblegroups = OC_SubAdmin::getSubAdminsGroups(OC_User::getUser());
$accessibleusers = OC_Group::usersInGroups($accessiblegroups);
$accessibleusers = OC_Group::usersInGroups($accessiblegroups, '', 30);
$subadmins = false;
}