summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/public.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-07-05 17:39:41 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-07-05 17:39:41 +0200
commite159cbf527822edc28522df48b0526419835ca29 (patch)
treee1e64ac3cb2727a8157b2f893016e01e7422195c /apps/files_sharing/public.php
parent0202d47f7ad4a65d4e539421c4f5899404b22bf4 (diff)
downloadnextcloud-server-e159cbf527822edc28522df48b0526419835ca29.tar.gz
nextcloud-server-e159cbf527822edc28522df48b0526419835ca29.zip
on reshares we now recursively move to the root of all reshares - therefore some code has been refactured and added as a new public function
Diffstat (limited to 'apps/files_sharing/public.php')
-rw-r--r--apps/files_sharing/public.php18
1 files changed, 2 insertions, 16 deletions
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index fb18bc26248..7c9158d8002 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -27,23 +27,9 @@ if (isset($_GET['t'])) {
$type = $linkItem['item_type'];
$fileSource = $linkItem['file_source'];
$shareOwner = $linkItem['uid_owner'];
- $fileOwner = null;
$path = null;
- if (isset($linkItem['parent'])) {
- $parent = $linkItem['parent'];
- while (isset($parent)) {
- $query = \OC_DB::prepare('SELECT `parent`, `uid_owner` FROM `*PREFIX*share` WHERE `id` = ?', 1);
- $item = $query->execute(array($parent))->fetchRow();
- if (isset($item['parent'])) {
- $parent = $item['parent'];
- } else {
- $fileOwner = $item['uid_owner'];
- break;
- }
- }
- } else {
- $fileOwner = $shareOwner;
- }
+ $rootLinkItem = OCP\Share::resolveReShare($linkItem);
+ $fileOwner = $rootLinkItem['uid_owner'];
if (isset($fileOwner)) {
OC_Util::tearDownFS();
OC_Util::setupFS($fileOwner);