Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-02-16 14:39:44 +0300
committerVincent Petry <pvince81@owncloud.com>2016-02-17 17:38:21 +0300
commitceaefc2c54f4a5d4528bf2e7ba4607297d2453f4 (patch)
tree65d487575178af524633f0fe8a469848a1c11f7f /apps/files/ajax
parent8f96ef147f7ddf517e83e10b2dab5f4e94da9f06 (diff)
Defer quota check in web UI when overwriting shared file
When receiving a shared file, the quota for that file counts in the owner's storage, not the current user's storage. To make it possible to overwrite the file even when the current user doesn't have enough space, the quota check is deferred for such files.
Diffstat (limited to 'apps/files/ajax')
-rw-r--r--apps/files/ajax/upload.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index 5bf69d3e304..36aaed5ad9e 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -136,8 +136,12 @@ $maxUploadFileSize = $storageStats['uploadMaxFilesize'];
$maxHumanFileSize = OCP\Util::humanFileSize($maxUploadFileSize);
$totalSize = 0;
-foreach ($files['size'] as $size) {
- $totalSize += $size;
+$isReceivedShare = \OC::$server->getRequest()->getParam('isReceivedShare', false) === 'true';
+// defer quota check for received shares
+if (!$isReceivedShare) {
+ foreach ($files['size'] as $size) {
+ $totalSize += $size;
+ }
}
if ($maxUploadFileSize >= 0 and $totalSize > $maxUploadFileSize) {
OCP\JSON::error(array('data' => array('message' => $l->t('Not enough storage available'),