From b4291f1e8e2326f5f1cbd97fa130d547f949b62d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= Date: Fri, 25 Jan 2013 13:00:17 +0100 Subject: [PATCH] allow to get the display name from an abitrary user --- lib/public/user.php | 4 ++-- lib/user.php | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/public/user.php b/lib/public/user.php index a93e3a674a..411098ed5a 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 4cdf07dc3f..65f899aa27 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{