diff options
Diffstat (limited to 'settings/ajax')
-rw-r--r-- | settings/ajax/createuser.php | 5 | ||||
-rw-r--r-- | settings/ajax/userlist.php | 23 |
2 files changed, 18 insertions, 10 deletions
diff --git a/settings/ajax/createuser.php b/settings/ajax/createuser.php index 94b56fa0349..946081e566a 100644 --- a/settings/ajax/createuser.php +++ b/settings/ajax/createuser.php @@ -43,12 +43,15 @@ try { OC_Group::addToGroup( $username, $i ); } + $userManager = \OC_User::getManager(); + $user = $userManager->get($username); OC_JSON::success(array("data" => array( // returns whether the home already existed "homeExists" => $homeExists, "username" => $username, - "groups" => OC_Group::getUserGroups( $username )))); + "groups" => OC_Group::getUserGroups( $username ), + 'storageLocation' => $user->getHome()))); } catch (Exception $exception) { OC_JSON::error(array("data" => array( "message" => $exception->getMessage()))); } diff --git a/settings/ajax/userlist.php b/settings/ajax/userlist.php index 4abf54b8987..b73826393d9 100644 --- a/settings/ajax/userlist.php +++ b/settings/ajax/userlist.php @@ -33,25 +33,30 @@ if (isset($_GET['limit'])) { $limit = 10; } $users = array(); +$userManager = \OC_User::getManager(); if (OC_User::isAdminUser(OC_User::getUser())) { $batch = OC_User::getDisplayNames('', $limit, $offset); - foreach ($batch as $user => $displayname) { + foreach ($batch as $uid => $displayname) { + $user = $userManager->get($uid); $users[] = array( - 'name' => $user, + 'name' => $uid, 'displayname' => $displayname, - 'groups' => join(', ', OC_Group::getUserGroups($user)), - 'subadmin' => join(', ', OC_SubAdmin::getSubAdminsGroups($user)), - 'quota' => OC_Preferences::getValue($user, 'files', 'quota', 'default')); + 'groups' => join(', ', OC_Group::getUserGroups($uid)), + 'subadmin' => join(', ', OC_SubAdmin::getSubAdminsGroups($uid)), + 'quota' => OC_Preferences::getValue($uid, 'files', 'quota', 'default'), + 'storageLocation' => $user->getHome()); } } else { $groups = OC_SubAdmin::getSubAdminsGroups(OC_User::getUser()); $batch = OC_Group::usersInGroups($groups, '', $limit, $offset); - foreach ($batch as $user) { + foreach ($batch as $uid) { + $user = $userManager->get($uid); $users[] = array( 'name' => $user, - 'displayname' => OC_User::getDisplayName($user), - 'groups' => join(', ', OC_Group::getUserGroups($user)), - 'quota' => OC_Preferences::getValue($user, 'files', 'quota', 'default')); + 'displayname' => $user->getDisplayName(), + 'groups' => join(', ', OC_Group::getUserGroups($uid)), + 'quota' => OC_Preferences::getValue($uid, 'files', 'quota', 'default'), + 'storageLocation' => $user->getHome()); } } OC_JSON::success(array('data' => $users)); |