summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-01-25 13:00:17 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-01-25 13:00:17 +0100
commitb4291f1e8e2326f5f1cbd97fa130d547f949b62d (patch)
tree49115d1ea0c90119213b4231f5183004b8c6dab1
parent64e853394c120888a7555901a52c5868f33aef3c (diff)
downloadnextcloud-server-b4291f1e8e2326f5f1cbd97fa130d547f949b62d.tar.gz
nextcloud-server-b4291f1e8e2326f5f1cbd97fa130d547f949b62d.zip
allow to get the display name from an abitrary user
-rw-r--r--lib/public/user.php4
-rw-r--r--lib/user.php6
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/public/user.php b/lib/public/user.php
index a93e3a674a8..411098ed5aa 100644
--- a/lib/public/user.php
+++ b/lib/public/user.php
@@ -56,8 +56,8 @@ class User {
* @brief get the user display name of the user currently logged in.
* @return string display name
*/
- public static function getDisplayName() {
- return \OC_USER::getDisplayName();
+ public static function getDisplayName($user=null) {
+ return \OC_USER::getDisplayName($user);
}
/**
diff --git a/lib/user.php b/lib/user.php
index 4cdf07dc3ff..65f899aa27c 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -350,8 +350,10 @@ class OC_User {
* @brief get the display name of the user currently logged in.
* @return string uid or false
*/
- public static function getDisplayName() {
- if( isset($_SESSION['display_name']) AND $_SESSION['display_name'] ) {
+ public static function getDisplayName($user=null) {
+ if ( $user ) {
+ return self::determineDisplayName($user);
+ } else if( isset($_SESSION['display_name']) AND $_SESSION['display_name'] ) {
return $_SESSION['display_name'];
}
else{