[Pkg-owncloud-commits] [owncloud] 21/50: Add displayname for admins

David Prévot taffit at moszumanska.debian.org
Fri Oct 17 03:12:13 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v6.0.6RC1
in repository owncloud.

commit e962c190c74b168fc519e93e7fbaf03be5407b26
Author: tomneedham <tom at owncloud.com>
Date:   Tue Feb 18 09:50:46 2014 +0000

    Add displayname for admins
---
 lib/private/ocs/cloud.php | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lib/private/ocs/cloud.php b/lib/private/ocs/cloud.php
index cbbf3b6..784a5b0 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);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list