summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-01-21 11:32:30 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-01-21 11:32:30 +0100
commit23a4d0d44ef8b918f054e7ad608d04b2e9a68995 (patch)
tree97e921688f32f8b5a707e4d81d5486d9793a3558 /apps
parent0f794b6889d05508c86449dacdee3e05bd47d071 (diff)
downloadnextcloud-server-23a4d0d44ef8b918f054e7ad608d04b2e9a68995.tar.gz
nextcloud-server-23a4d0d44ef8b918f054e7ad608d04b2e9a68995.zip
OC_Util::setupFS($user) will create a data dir for the given string - no matter if the user really exists - OCP\JSON::checkUserExists($owner); introduces a ready to use check which will bail out with an JSON error
Diffstat (limited to 'apps')
-rw-r--r--apps/files/ajax/upload.php1
-rw-r--r--apps/files/triggerupdate.php1
-rw-r--r--apps/files_sharing/ajax/publicpreview.php3
-rw-r--r--apps/files_sharing/appinfo/update.php1
-rw-r--r--apps/files_sharing/public.php6
5 files changed, 8 insertions, 4 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index 0e905f993ac..bdaf6a77d14 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -34,6 +34,7 @@ if (empty($_POST['dirToken'])) {
// resolve reshares
$rootLinkItem = OCP\Share::resolveReShare($linkItem);
+ OCP\JSON::checkUserExists($rootLinkItem['uid_owner']);
// Setup FS with owner
OC_Util::tearDownFS();
OC_Util::setupFS($rootLinkItem['uid_owner']);
diff --git a/apps/files/triggerupdate.php b/apps/files/triggerupdate.php
index 0e29edbba35..a37b9823add 100644
--- a/apps/files/triggerupdate.php
+++ b/apps/files/triggerupdate.php
@@ -6,6 +6,7 @@ if (OC::$CLI) {
if (count($argv) === 2) {
$file = $argv[1];
list(, $user) = explode('/', $file);
+ OCP\JSON::checkUserExists($owner);
OC_Util::setupFS($user);
$view = new \OC\Files\View('');
/**
diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php
index 54a9806e8bf..a52f522afac 100644
--- a/apps/files_sharing/ajax/publicpreview.php
+++ b/apps/files_sharing/ajax/publicpreview.php
@@ -39,6 +39,7 @@ if(!isset($linkedItem['uid_owner']) || !isset($linkedItem['file_source'])) {
$rootLinkItem = OCP\Share::resolveReShare($linkedItem);
$userId = $rootLinkItem['uid_owner'];
+OCP\JSON::checkUserExists($rootLinkItem['uid_owner']);
\OC_Util::setupFS($userId);
\OC\Files\Filesystem::initMountPoints($userId);
$view = new \OC\Files\View('/' . $userId . '/files');
@@ -88,4 +89,4 @@ try{
} catch (\Exception $e) {
\OC_Response::setStatus(500);
\OC_Log::write('core', $e->getmessage(), \OC_Log::DEBUG);
-} \ No newline at end of file
+}
diff --git a/apps/files_sharing/appinfo/update.php b/apps/files_sharing/appinfo/update.php
index 0d827da28ea..4b716e764f4 100644
--- a/apps/files_sharing/appinfo/update.php
+++ b/apps/files_sharing/appinfo/update.php
@@ -44,6 +44,7 @@ if (version_compare($installedVersion, '0.3', '<')) {
$shareType = OCP\Share::SHARE_TYPE_USER;
$shareWith = $row['uid_shared_with'];
}
+ OCP\JSON::checkUserExists($row['uid_owner']);
OC_User::setUserId($row['uid_owner']);
//we need to setup the filesystem for the user, otherwise OC_FileSystem::getRoot will fail and break
OC_Util::setupFS($row['uid_owner']);
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index d050efd5b32..80dd708ee51 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -43,10 +43,10 @@ if (isset($_GET['t'])) {
$shareOwner = $linkItem['uid_owner'];
$path = null;
$rootLinkItem = OCP\Share::resolveReShare($linkItem);
- $fileOwner = $rootLinkItem['uid_owner'];
- if (isset($fileOwner)) {
+ if (isset($rootLinkItem['uid_owner'])) {
+ OCP\JSON::checkUserExists($rootLinkItem['uid_owner']);
OC_Util::tearDownFS();
- OC_Util::setupFS($fileOwner);
+ OC_Util::setupFS($rootLinkItem['uid_owner']);
$path = \OC\Files\Filesystem::getPath($linkItem['file_source']);
}
}