summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-01-28 11:25:12 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2014-01-28 13:31:43 +0100
commit7f83f2a8f2e6e3f280c3562ebdbeae9331ab5f01 (patch)
tree39a3c6ac46a9f90d090d2472bb717147e5182b0e /apps/files_sharing
parent0a77d411780aa0b5c4c45373ea4aca05dc5dd5ec (diff)
downloadnextcloud-server-7f83f2a8f2e6e3f280c3562ebdbeae9331ab5f01.tar.gz
nextcloud-server-7f83f2a8f2e6e3f280c3562ebdbeae9331ab5f01.zip
use more accurate error codes
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/api.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php
index 84e90c71681..cb3d3e42c34 100644
--- a/apps/files_sharing/lib/api.php
+++ b/apps/files_sharing/lib/api.php
@@ -162,7 +162,7 @@ class Api {
$view = new \OC\Files\View('/'.\OCP\User::getUser().'/files');
if(!$view->is_dir($path)) {
- return new \OC_OCS_Result(null, 404, "not a directory");
+ return new \OC_OCS_Result(null, 400, "not a directory");
}
$content = $view->getDirectoryContent($path);
@@ -223,7 +223,7 @@ class Api {
$encryptionEnabled = \OC_App::isEnabled('files_encryption');
if(isset($_POST['publicUpload']) &&
($encryptionEnabled || $publicUploadEnabled !== 'yes')) {
- return new \OC_OCS_Result(null, 404, "public upload disabled by the administrator");
+ return new \OC_OCS_Result(null, 403, "public upload disabled by the administrator");
}
$publicUpload = isset($_POST['publicUpload']) ? $_POST['publicUpload'] : 'false';
// read, create, update (7) if public upload is enabled or
@@ -231,7 +231,7 @@ class Api {
$permissions = $publicUpload === 'true' ? 7 : 1;
break;
default:
- return new \OC_OCS_Result(null, 404, "unknown share type");
+ return new \OC_OCS_Result(null, 400, "unknown share type");
}
try {
@@ -243,7 +243,7 @@ class Api {
$permissions
);
} catch (\Exception $e) {
- return new \OC_OCS_Result(null, 404, $e->getMessage());
+ return new \OC_OCS_Result(null, 403, $e->getMessage());
}
if ($token) {
@@ -365,7 +365,7 @@ class Api {
$publicUploadEnabled = \OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes');
$encryptionEnabled = \OC_App::isEnabled('files_encryption');
if($encryptionEnabled || $publicUploadEnabled !== 'yes') {
- return new \OC_OCS_Result(null, 404, "public upload disabled by the administrator");
+ return new \OC_OCS_Result(null, 403, "public upload disabled by the administrator");
}
if ($share['item_type'] !== 'folder' ||