diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-01-28 17:28:20 +0100 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-01-28 17:28:20 +0100 |
commit | cd4e044f66c62fc070b48fea40f9a96585f93269 (patch) | |
tree | 0d9053af331547985a2c7fe399c193bbbed5157f | |
parent | 75c8d74c945293a65f0009caeb5a1ba33f21e37b (diff) | |
download | nextcloud-server-cd4e044f66c62fc070b48fea40f9a96585f93269.tar.gz nextcloud-server-cd4e044f66c62fc070b48fea40f9a96585f93269.zip |
public upload is also possible with encryption enabled, since OC6
-rw-r--r-- | apps/files_sharing/lib/api.php | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php index cb3d3e42c34..f828a4e840d 100644 --- a/apps/files_sharing/lib/api.php +++ b/apps/files_sharing/lib/api.php @@ -220,9 +220,7 @@ class Api { $shareWith = isset($_POST['password']) ? $_POST['password'] : null; //check public link share $publicUploadEnabled = \OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes'); - $encryptionEnabled = \OC_App::isEnabled('files_encryption'); - if(isset($_POST['publicUpload']) && - ($encryptionEnabled || $publicUploadEnabled !== 'yes')) { + if(isset($_POST['publicUpload']) && $publicUploadEnabled !== 'yes') { return new \OC_OCS_Result(null, 403, "public upload disabled by the administrator"); } $publicUpload = isset($_POST['publicUpload']) ? $_POST['publicUpload'] : 'false'; @@ -321,11 +319,8 @@ class Api { $permissions = isset($params['_put']['permissions']) ? (int)$params['_put']['permissions'] : null; $publicUploadStatus = \OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes'); - $encryptionEnabled = \OC_App::isEnabled('files_encryption'); - $publicUploadEnabled = false; - if(!$encryptionEnabled && $publicUploadStatus === 'yes') { - $publicUploadEnabled = true; - } + $publicUploadEnabled = ($publicUploadStatus === 'yes') ? true : false; + // only change permissions for public shares if public upload is enabled // and we want to set permissions to 1 (read only) or 7 (allow upload) @@ -363,8 +358,7 @@ class Api { private static function updatePublicUpload($share, $params) { $publicUploadEnabled = \OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes'); - $encryptionEnabled = \OC_App::isEnabled('files_encryption'); - if($encryptionEnabled || $publicUploadEnabled !== 'yes') { + if($publicUploadEnabled !== 'yes') { return new \OC_OCS_Result(null, 403, "public upload disabled by the administrator"); } |