]> source.dussan.org Git - nextcloud-server.git/commitdiff
use true/false instead of yes/no for publicUpload and subfiles parameter
authorBjoern Schiessle <schiessle@owncloud.com>
Fri, 4 Oct 2013 10:16:47 +0000 (12:16 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Fri, 4 Oct 2013 10:16:47 +0000 (12:16 +0200)
apps/files_sharing/lib/api.php

index 8615d51160f6963b48042ffdd8bf8b1ced4f676e..e6624624898233966e897cab41d553214e8d94b1 100644 (file)
@@ -36,7 +36,7 @@ class Api {
                if (isset($_GET['path'])) {
                        $params['itemSource'] = self::getFileId($_GET['path']);
                        $params['path'] = $_GET['path'];
-                       if (isset($_GET['subfiles']) && $_GET['subfiles'] === 'yes') {
+                       if (isset($_GET['subfiles']) && $_GET['subfiles'] === 'true') {
                                return self::getSharesFromFolder($params);
                        }
                        return self::getShare($params);
@@ -160,10 +160,10 @@ class Api {
                                                ($encryptionEnabled || $publicUploadEnabled !== 'yes')) {
                                        return new \OC_OCS_Result(null, 404, "public upload disabled by the administrator");
                                }
-                               $publicUpload = isset($_POST['publicUpload']) ? $_POST['publicUpload'] : 'no';
+                               $publicUpload = isset($_POST['publicUpload']) ? $_POST['publicUpload'] : 'false';
                                // read, create, update (7) if public upload is enabled or
                                // read (1) if public upload is disabled
-                               $permissions = $publicUpload === 'yes' ? 7 : 1;
+                               $permissions = $publicUpload === 'true' ? 7 : 1;
                                break;
                        default:
                                return new \OC_OCS_Result(null, 404, "unknown share type");
@@ -310,7 +310,7 @@ class Api {
 
                // read, create, update (7) if public upload is enabled or
                // read (1) if public upload is disabled
-               $params['_put']['permissions'] = $params['_put']['publicUpload'] === 'yes' ? 7 : 1;
+               $params['_put']['permissions'] = $params['_put']['publicUpload'] === 'true' ? 7 : 1;
 
                return self::updatePermissions($share, $params);