Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomneedham <tom@owncloud.com>2014-02-18 13:50:46 +0400
committertomneedham <tom@owncloud.com>2014-02-18 13:50:46 +0400
commit2f1a24eee74d0bf7bf5d734d1abd99a7bc68052c (patch)
tree40fed570f80057dac479e76a77c7b426428cc7aa /lib/private/ocs
parent5a8d37023a84d933eaa5113400014805048a689b (diff)
Add displayname for admins
Diffstat (limited to 'lib/private/ocs')
-rw-r--r--lib/private/ocs/cloud.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/private/ocs/cloud.php b/lib/private/ocs/cloud.php
index cbbf3b626f5..784a5b0869e 100644
--- a/lib/private/ocs/cloud.php
+++ b/lib/private/ocs/cloud.php
@@ -61,17 +61,25 @@ class OC_OCS_Cloud {
* the user from whom the information will be returned
*/
public static function getUser($parameters) {
+ $return = array();
// Check if they are viewing information on themselves
if($parameters['userid'] === OC_User::getUser()) {
// Self lookup
$storage = OC_Helper::getStorageInfo('/');
- $quota = array(
+ $return['quota'] = array(
'free' => $storage['free'],
'used' => $storage['used'],
'total' => $storage['total'],
'relative' => $storage['relative'],
);
- return new OC_OCS_Result(array('quota' => $quota));
+ }
+ if(OC_User::isAdminUser(OC_User::getUser())
+ || OC_Subadmin::isUserAccessible(OC_User::getUser(), $parameters['userid'])) {
+ // Is an admin/subadmin so can see display name
+ $return['displayname'] = OC_User::getDisplayName($parameters['userid']);
+ }
+ if(count($return)) {
+ return new OC_OCS_Result($return);
} else {
// No permission to view this user data
return new OC_OCS_Result(null, 997);