summaryrefslogtreecommitdiffstats
path: root/lib/private/Share/Share.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-03-25 20:42:03 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-03-25 20:42:03 +0200
commit7ebd96416ca9150a4d524547a18b5fce269016ca (patch)
treee83a6c34e9955c9b1a2894e9dac40417245db28c /lib/private/Share/Share.php
parent6c8caa1641732c57fe59483fc2cdd5bcd7bd0163 (diff)
downloadnextcloud-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/private/Share/Share.php')
-rw-r--r--lib/private/Share/Share.php6
1 files changed, 4 insertions, 2 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) {