User: remove determineDisplayName

This commit is contained in:
Robin Appelman 2013-06-03 13:15:42 +02:00
parent 3e00a3603c
commit 00b4bfcbf5
1 changed files with 9 additions and 19 deletions

View File

@ -274,22 +274,6 @@ class OC_User {
} }
} }
/**
* @brief get display name
* @param $uid The username
* @return string display name or uid if no display name is defined
*
*/
private static function determineDisplayName($uid) {
$user = self::getManager()->get($uid);
if ($user) {
return $user->getDisplayName();
} else {
return $uid;
}
}
/** /**
* @brief Logs the current user out and kills all the session data * @brief Logs the current user out and kills all the session data
* *
@ -342,11 +326,17 @@ class OC_User {
/** /**
* @brief get the display name of the user currently logged in. * @brief get the display name of the user currently logged in.
* @param string $uid
* @return string uid or false * @return string uid or false
*/ */
public static function getDisplayName($user = null) { public static function getDisplayName($uid = null) {
if ($uid) {
$user = self::getManager()->get($uid);
if ($user) { if ($user) {
return self::determineDisplayName($user); return $user->getDisplayName();
} else {
return $uid;
}
} else { } else {
$user = self::getUserSession()->getUser(); $user = self::getUserSession()->getUser();
if ($user) { if ($user) {