diff options
author | Robin Appelman <robin@icewind.nl> | 2024-03-05 14:55:22 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2024-03-06 15:24:48 +0100 |
commit | a598de627c65b1a9774d1bda1826f7b15f2bfd0b (patch) | |
tree | 84a71be90f5412513aa53d22b4e2125e7752edb7 /apps/files_sharing | |
parent | c651e06a6d1296cbca03a706d9cded707e70af74 (diff) | |
download | nextcloud-server-a598de627c65b1a9774d1bda1826f7b15f2bfd0b.tar.gz nextcloud-server-a598de627c65b1a9774d1bda1826f7b15f2bfd0b.zip |
chore: remove long depricated share code
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/ShareBackend/Folder.php | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/apps/files_sharing/lib/ShareBackend/Folder.php b/apps/files_sharing/lib/ShareBackend/Folder.php index 51d0c709d98..f0e44524c8a 100644 --- a/apps/files_sharing/lib/ShareBackend/Folder.php +++ b/apps/files_sharing/lib/ShareBackend/Folder.php @@ -29,65 +29,6 @@ namespace OCA\Files_Sharing\ShareBackend; class Folder extends File implements \OCP\Share_Backend_Collection { - - /** - * get shared parents - * - * @param int $itemSource item source ID - * @param string $shareWith with whom should the item be shared - * @param string $owner owner of the item - * @return array with shares - */ - public function getParents($itemSource, $shareWith = null, $owner = null) { - $result = []; - $parent = $this->getParentId($itemSource); - - $userManager = \OC::$server->getUserManager(); - - while ($parent) { - $shares = \OCP\Share::getItemSharedWithUser('folder', $parent, $shareWith, $owner); - if ($shares) { - foreach ($shares as $share) { - $name = basename($share['path']); - $share['collection']['path'] = $name; - $share['collection']['item_type'] = 'folder'; - $share['file_path'] = $name; - - $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']; - - $result[] = $share; - } - } - $parent = $this->getParentId($parent); - } - - return $result; - } - - /** - * get file cache ID of parent - * - * @param int $child file cache ID of child - * @return mixed parent ID or null - */ - private function getParentId($child) { - $qb = \OC::$server->getDatabaseConnection()->getQueryBuilder(); - $qb->select('parent') - ->from('filecache') - ->where( - $qb->expr()->eq('fileid', $qb->createNamedParameter($child)) - ); - $result = $qb->execute(); - $row = $result->fetch(); - $result->closeCursor(); - return $row ? $row['parent'] : null; - } - public function getChildren($itemSource) { $children = []; $parents = [$itemSource]; |