summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-07-05 13:45:21 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-07-05 13:45:21 +0200
commit352c1415be55ae5797685d2ea22fcd07cdfbf4ec (patch)
treea101003c9a15dd89b99a63914444e241241d23de /apps/files/ajax
parentd1d68855850022ee4dd91105f00a947029f2e4c8 (diff)
downloadnextcloud-server-352c1415be55ae5797685d2ea22fcd07cdfbf4ec.tar.gz
nextcloud-server-352c1415be55ae5797685d2ea22fcd07cdfbf4ec.zip
proper fix for getting the shared item if no user is logged in
Diffstat (limited to 'apps/files/ajax')
-rw-r--r--apps/files/ajax/upload.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index 733ed95974f..54604d10563 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -26,15 +26,18 @@ if (empty($_POST['dirToken'])) {
if (!($linkItem['permissions'] & OCP\PERMISSION_CREATE)) {
OCP\JSON::checkLoggedIn();
} else {
+ // Setup FS with owner
+ OC_Util::tearDownFS();
+ OC_Util::setupFS($linkItem['uid_owner']);
+
// translate linkItem to the real folder name on the file system
- $sharedItem = OCP\Share::getItemShared($linkItem['item_type'], $linkItem['item_source']);
+ $sharedItem = OCP\Share::getSharedItem($linkItem['item_type'], $linkItem['item_source'], $linkItem['uid_owner']);
if (!$sharedItem || empty($sharedItem) || $sharedItem === false) {
OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Unable to set upload directory.')))));
die();
}
// The token defines the target directory (security reasons)
- $sharedItem = array_pop($sharedItem);
$dir = sprintf(
"/%s/%s",
$sharedItem['path'],
@@ -45,8 +48,6 @@ if (empty($_POST['dirToken'])) {
OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Unable to set upload directory.')))));
die();
}
- // Setup FS with owner
- OC_Util::setupFS($linkItem['uid_owner']);
}
}