diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-06-03 13:15:42 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-06-03 13:15:42 +0200 |
commit | 00b4bfcbf56e29c905355fc8b4fea71b4075c8ee (patch) | |
tree | 167403a78848dd87da480009ccdb579423b4cc5b /lib | |
parent | 3e00a3603cadf4e9e4b3c87bba0ef604077146fd (diff) | |
download | nextcloud-server-00b4bfcbf56e29c905355fc8b4fea71b4075c8ee.tar.gz nextcloud-server-00b4bfcbf56e29c905355fc8b4fea71b4075c8ee.zip |
User: remove determineDisplayName
Diffstat (limited to 'lib')
-rw-r--r-- | lib/user.php | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/lib/user.php b/lib/user.php index a8b642a1630..a57ee5b13ca 100644 --- a/lib/user.php +++ b/lib/user.php @@ -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 * @@ -342,11 +326,17 @@ class OC_User { /** * @brief get the display name of the user currently logged in. + * @param string $uid * @return string uid or false */ - public static function getDisplayName($user = null) { - if ($user) { - return self::determineDisplayName($user); + public static function getDisplayName($uid = null) { + if ($uid) { + $user = self::getManager()->get($uid); + if ($user) { + return $user->getDisplayName(); + } else { + return $uid; + } } else { $user = self::getUserSession()->getUser(); if ($user) { |