allow to get the display name from an abitrary user

This commit is contained in:
Björn Schießle 2013-01-25 13:00:17 +01:00
parent 64e853394c
commit b4291f1e8e
2 changed files with 6 additions and 4 deletions

View File

@ -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);
}
/**

View File

@ -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{