diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-03-28 08:23:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-28 08:23:57 +0200 |
commit | b2e34167eb3fa3e6fdfa4ec13353a901e0725ebd (patch) | |
tree | 88a923842ad876ab180950e70eb8641e540bcdea /apps/files_sharing | |
parent | 1e13b3a8faacdd5d1a90573d12aca8fca5b5d7ae (diff) | |
parent | 74f0e3723327fbfb1cd7a96865019ff791b41593 (diff) | |
download | nextcloud-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.php | 10 |
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']; |