diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-25 20:42:03 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-25 20:42:03 +0200 |
commit | 7ebd96416ca9150a4d524547a18b5fce269016ca (patch) | |
tree | e83a6c34e9955c9b1a2894e9dac40417245db28c /lib | |
parent | 6c8caa1641732c57fe59483fc2cdd5bcd7bd0163 (diff) | |
download | nextcloud-server-7ebd96416ca9150a4d524547a18b5fce269016ca.tar.gz nextcloud-server-7ebd96416ca9150a4d524547a18b5fce269016ca.zip |
Remove deprecated OCP\User::getDisplayname
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Share/Share.php | 6 | ||||
-rw-r--r-- | lib/private/legacy/user.php | 2 | ||||
-rw-r--r-- | lib/public/User.php | 12 |
3 files changed, 6 insertions, 14 deletions
diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index 90a05ac51a8..4211d6c8fc2 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -1238,7 +1238,8 @@ class Share extends Constants { $row['share_with_displayname'] = $row['share_with']; if ( isset($row['share_with']) && $row['share_with'] != '' && $row['share_type'] === self::SHARE_TYPE_USER) { - $row['share_with_displayname'] = \OCP\User::getDisplayName($row['share_with']); + $shareWithUser = \OC::$server->getUserManager()->get($row['share_with']); + $row['share_with_displayname'] = $shareWithUser === null ? $row['share_with'] : $shareWithUser->getDisplayName(); } else if(isset($row['share_with']) && $row['share_with'] != '' && $row['share_type'] === self::SHARE_TYPE_REMOTE) { $addressBookEntries = \OC::$server->getContactsManager()->search($row['share_with'], ['CLOUD']); @@ -1251,7 +1252,8 @@ class Share extends Constants { } } if ( isset($row['uid_owner']) && $row['uid_owner'] != '') { - $row['displayname_owner'] = \OCP\User::getDisplayName($row['uid_owner']); + $ownerUser = \OC::$server->get($row['uid_owner']); + $row['displayname_owner'] = $ownerUser === null ? $row['uid_owner'] : $ownerUser->getDisplayName(); } if ($row['permissions'] > 0) { diff --git a/lib/private/legacy/user.php b/lib/private/legacy/user.php index 07aa5a92f9a..9c877f22a46 100644 --- a/lib/private/legacy/user.php +++ b/lib/private/legacy/user.php @@ -312,6 +312,8 @@ class OC_User { * * @param string $uid * @return string|bool uid or false + * @deprecated 8.1.0 fetch \OCP\IUser (has getDisplayName()) by using method + * get() of \OCP\IUserManager - \OC::$server->getUserManager() */ public static function getDisplayName($uid = null) { if ($uid) { diff --git a/lib/public/User.php b/lib/public/User.php index 6e4e1d52a72..ba9039054be 100644 --- a/lib/public/User.php +++ b/lib/public/User.php @@ -58,18 +58,6 @@ class User { } /** - * Get the user display name of the user currently logged in. - * @param string|null $user user id or null for current user - * @return string display name - * @deprecated 8.1.0 fetch \OCP\IUser (has getDisplayName()) by using method - * get() of \OCP\IUserManager - \OC::$server->getUserManager() - * @since 5.0.0 - */ - public static function getDisplayName( $user = null ) { - return \OC_User::getDisplayName( $user ); - } - - /** * Check if the user is logged in * @return boolean * @since 5.0.0 |