aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-03-28 08:23:57 +0200
committerGitHub <noreply@github.com>2018-03-28 08:23:57 +0200
commitb2e34167eb3fa3e6fdfa4ec13353a901e0725ebd (patch)
tree88a923842ad876ab180950e70eb8641e540bcdea /apps/files_sharing
parent1e13b3a8faacdd5d1a90573d12aca8fca5b5d7ae (diff)
parent74f0e3723327fbfb1cd7a96865019ff791b41593 (diff)
downloadnextcloud-server-b2e34167eb3fa3e6fdfa4ec13353a901e0725ebd.tar.gz
nextcloud-server-b2e34167eb3fa3e6fdfa4ec13353a901e0725ebd.zip
Merge pull request #8976 from nextcloud/dep_user_code
Remove deprecated functions from OCP\User
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/ShareBackend/Folder.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/ShareBackend/Folder.php b/apps/files_sharing/lib/ShareBackend/Folder.php
index 0bb67e49b66..8cd639d047d 100644
--- a/apps/files_sharing/lib/ShareBackend/Folder.php
+++ b/apps/files_sharing/lib/ShareBackend/Folder.php
@@ -41,6 +41,9 @@ class Folder extends File implements \OCP\Share_Backend_Collection {
public function getParents($itemSource, $shareWith = null, $owner = null) {
$result = array();
$parent = $this->getParentId($itemSource);
+
+ $userManager = \OC::$server->getUserManager();
+
while ($parent) {
$shares = \OCP\Share::getItemSharedWithUser('folder', $parent, $shareWith, $owner);
if ($shares) {
@@ -49,8 +52,11 @@ class Folder extends File implements \OCP\Share_Backend_Collection {
$share['collection']['path'] = $name;
$share['collection']['item_type'] = 'folder';
$share['file_path'] = $name;
- $displayNameOwner = \OCP\User::getDisplayName($share['uid_owner']);
- $displayNameShareWith = \OCP\User::getDisplayName($share['share_with']);
+
+ $ownerUser = $userManager->get($share['uid_owner']);
+ $displayNameOwner = $ownerUser === null ? $share['uid_owner'] : $ownerUser->getDisplayName();
+ $shareWithUser = $userManager->get($share['share_with']);
+ $displayNameShareWith = $shareWithUser === null ? $share['share_with'] : $shareWithUser->getDisplayName();
$share['displayname_owner'] = $displayNameOwner ? $displayNameOwner : $share['uid_owner'];
$share['share_with_displayname'] = $displayNameShareWith ? $displayNameShareWith : $share['uid_owner'];