diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-08 02:27:21 -0700 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-08 02:27:21 -0700 |
commit | 0365d244e0b41785d7853f43d6b60017e9983cae (patch) | |
tree | f29b0f9f45e70f33c2362557f2cd135d7f271cb2 /apps/files_sharing | |
parent | 9b9ea7cd8e9050bd3682c1edd81955469bc8474d (diff) | |
parent | c956a08d2219d623af4ceca644411c8217fe0cbf (diff) | |
download | nextcloud-server-0365d244e0b41785d7853f43d6b60017e9983cae.tar.gz nextcloud-server-0365d244e0b41785d7853f43d6b60017e9983cae.zip |
Merge pull request #3946 from owncloud/fixing-3942-master
handle anonymous upload to reshared folder
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/public.php | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index 96fe12fc86a..9462844a82b 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); @@ -151,7 +137,7 @@ if (isset($path)) { if (\OCP\App::isEnabled('files_encryption')) { $allowPublicUploadEnabled = false; } - if (isset($file)) { + if ($linkItem['item_type'] !== 'folder') { $allowPublicUploadEnabled = false; } $tmpl->assign('allowPublicUploadEnabled', $allowPublicUploadEnabled); |