summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-02-18 14:34:08 +0100
committerArthur Schiwon <blizzz@owncloud.com>2014-06-02 12:52:53 +0200
commitdc28f589517e05ef29c6c06145ab4944c0aa2994 (patch)
tree644b62800222885f96d7c854cab11ad869f52198 /settings
parentdc1523355b351cc0adf3e5893294cafe2651d8a0 (diff)
downloadnextcloud-server-dc28f589517e05ef29c6c06145ab4944c0aa2994.tar.gz
nextcloud-server-dc28f589517e05ef29c6c06145ab4944c0aa2994.zip
add Storage Location col
Diffstat (limited to 'settings')
-rw-r--r--settings/ajax/createuser.php5
-rw-r--r--settings/ajax/userlist.php23
-rw-r--r--settings/js/users.js9
-rw-r--r--settings/templates/users.php2
-rw-r--r--settings/users.php3
5 files changed, 28 insertions, 14 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));
diff --git a/settings/js/users.js b/settings/js/users.js
index 4609a56b494..5d4fbed2a2b 100644
--- a/settings/js/users.js
+++ b/settings/js/users.js
@@ -125,7 +125,7 @@ var UserList = {
}
},
- add: function (username, displayname, groups, subadmin, quota, sort) {
+ add: function (username, displayname, groups, subadmin, quota, storageLocation, sort) {
var tr = $('tbody tr').first().clone();
var subadminsEl;
var subadminSelect;
@@ -184,6 +184,7 @@ var UserList = {
quotaSelect.append('<option value="' + escapeHTML(quota) + '" selected="selected">' + escapeHTML(quota) + '</option>');
}
}
+ tr.find('td.storageLocation').text(storageLocation);
$(tr).appendTo('tbody');
if (sort) {
@@ -279,7 +280,7 @@ var UserList = {
if($('tr[data-uid="' + user.name + '"]').length > 0) {
return true;
}
- var tr = UserList.add(user.name, user.displayname, user.groups, user.subadmin, user.quota, false);
+ alert(user.storageLocation);
tr.addClass('appear transparent');
trs.push(tr);
loadedUsers++;
@@ -574,7 +575,7 @@ $(document).ready(function () {
}, 10000);
}
if($('tr[data-uid="' + username + '"]').length === 0) {
- UserList.add(username, username, result.data.groups, null, 'default', true);
+ UserList.add(username, username, result.data.groups, null, 'default', result.data.storageLocation, true);
}
}
}
@@ -620,7 +621,7 @@ $(document).ready(function () {
}
)
});
- // Implements User Search
+ // Implements User Search
$('#usersearchform input').keyup(function() {
var inputVal = $(this).val(), regex = new RegExp(inputVal, "i");;
$('table tbody tr td.name').each(function (key,element) {
diff --git a/settings/templates/users.php b/settings/templates/users.php
index 7cb40ebbd27..8c624ff655c 100644
--- a/settings/templates/users.php
+++ b/settings/templates/users.php
@@ -138,6 +138,7 @@ $_['subadmingroups'] = array_flip($items);
<th id="headerSubAdmins"><?php p($l->t('Group Admin')); ?></th>
<?php endif;?>
<th id="headerQuota"><?php p($l->t('Storage')); ?></th>
+ <th id="headerStorageLocation"><?php p($l->t('Storage Location')); ?></th>
<th id="headerRemove">&nbsp;</th>
</tr>
</thead>
@@ -214,6 +215,7 @@ $_['subadmingroups'] = array_flip($items);
</option>
</select>
</td>
+ <td class="storageLocation"><?php p($user["storageLocation"]); ?></td>
<td class="remove">
<?php if($user['name']!=OC_User::getUser()):?>
<a href="#" class="action delete" original-title="<?php p($l->t('Delete'))?>">
diff --git a/settings/users.php b/settings/users.php
index a3faa51ea0e..e1b3083ed3e 100644
--- a/settings/users.php
+++ b/settings/users.php
@@ -17,6 +17,7 @@ OC_App::setActiveNavigationEntry( 'core_users' );
$users = array();
$groups = array();
+$userManager = \OC_User::getManager();
if (isset($_GET['offset'])) {
$offset = $_GET['offset'];
@@ -66,6 +67,7 @@ foreach($accessibleusers as $uid => $displayName) {
$name = $name . ' ('.$uid.')';
}
+ $user = $userManager->get($uid);
$users[] = array(
"name" => $uid,
"displayName" => $displayName,
@@ -73,6 +75,7 @@ foreach($accessibleusers as $uid => $displayName) {
'quota' => $quota,
'isQuotaUserDefined' => $isQuotaUserDefined,
'subadmin' => OC_SubAdmin::getSubAdminsGroups($uid),
+ 'storageLocation' => $user->getHome(),
);
}