diff --git a/apps/files/admin.php b/apps/files/admin.php index 02c3147dba..bf12af7410 100644 --- a/apps/files/admin.php +++ b/apps/files/admin.php @@ -34,17 +34,7 @@ if($_POST && OC_Util::isCallRegistered()) { $maxUploadFilesize = OCP\Util::humanFileSize($setMaxSize); } } - if(isset($_POST['maxZipInputSize'])) { - $maxZipInputSize=$_POST['maxZipInputSize']; - OCP\Config::setSystemValue('maxZipInputSize', OCP\Util::computerFileSize($maxZipInputSize)); - } - if(isset($_POST['submitFilesAdminSettings'])) { - OCP\Config::setSystemValue('allowZipDownload', isset($_POST['allowZipDownload'])); - } } -$maxZipInputSizeDefault = OCP\Util::computerFileSize('800 MB'); -$maxZipInputSize = OCP\Util::humanFileSize(OCP\Config::getSystemValue('maxZipInputSize', $maxZipInputSizeDefault)); -$allowZipDownload = intval(OCP\Config::getSystemValue('allowZipDownload', true)); OCP\App::setActiveNavigationEntry( "files_administration" ); @@ -56,6 +46,4 @@ $tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize); // max possible makes only sense on a 32 bit system $tmpl->assign( 'displayMaxPossibleUploadSize', PHP_INT_SIZE===4); $tmpl->assign( 'maxPossibleUploadSize', OCP\Util::humanFileSize(PHP_INT_MAX)); -$tmpl->assign( 'allowZipDownload', $allowZipDownload); -$tmpl->assign( 'maxZipInputSize', $maxZipInputSize); return $tmpl->fetchPage(); diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php new file mode 100644 index 0000000000..5f054f266b --- /dev/null +++ b/apps/files/appinfo/update.php @@ -0,0 +1,8 @@ +assign("allowShareWithLink", $config->getAppValue('core', 'shareapi_allow $tmpl->assign("encryptionInitStatus", $encryptionInitStatus); $tmpl->assign('appNavigation', $nav); $tmpl->assign('appContents', $contentItems); -$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $tmpl->printPage(); diff --git a/apps/files/js/admin.js b/apps/files/js/admin.js index 842b73c0ca..dcfec824cf 100644 --- a/apps/files/js/admin.js +++ b/apps/files/js/admin.js @@ -25,12 +25,4 @@ $(document).ready(function() { // To get rid of onClick() switchPublicFolder(); }); - - $('#allowZipDownload').bind('change', function() { - if($('#allowZipDownload').attr('checked')) { - $('#maxZipInputSize').removeAttr('disabled'); - } else { - $('#maxZipInputSize').attr('disabled', 'disabled'); - } - }); }); diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 3df62f3751..de02bf5e73 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -275,14 +275,8 @@ }); this.setDefault('dir', 'Open'); - var downloadScope; - if ($('#allowZipDownload').val() == 1) { - downloadScope = 'all'; - } else { - downloadScope = 'file'; - } - this.register(downloadScope, 'Download', OC.PERMISSION_READ, function () { + this.register('all', 'Download', OC.PERMISSION_READ, function () { return OC.imagePath('core', 'actions/download'); }, function (filename, context) { var dir = context.dir || context.fileList.getCurrentDirectory(); diff --git a/apps/files/list.php b/apps/files/list.php index e583839b25..5ecbd1c7fa 100644 --- a/apps/files/list.php +++ b/apps/files/list.php @@ -33,6 +33,5 @@ $uploadLimit=OCP\Util::uploadLimit(); $tmpl = new OCP\Template('files', 'list', ''); $tmpl->assign('uploadLimit', $uploadLimit); // PHP upload limit $tmpl->assign('publicUploadEnabled', $publicUploadEnabled); -$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $tmpl->printPage(); diff --git a/apps/files/templates/admin.php b/apps/files/templates/admin.php index 5f7d3261d6..a75f0c9487 100644 --- a/apps/files/templates/admin.php +++ b/apps/files/templates/admin.php @@ -10,16 +10,6 @@
- checked="checked" /> -
- - ' - title="t( '0 is unlimited' )); ?>" - disabled="disabled" />
- t( 'Maximum input size for ZIP files' )); ?>
- diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php index 17bf3b3de8..eddcd9f623 100644 --- a/apps/files/templates/list.php +++ b/apps/files/templates/list.php @@ -61,13 +61,11 @@ t( 'Name' )); ?> - - - Download" /> - t('Download'))?> - - + + Download" /> + t('Download'))?> + @@ -89,7 +87,6 @@ -
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index 8a86cb3806..4782c4dbe3 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -160,17 +160,12 @@ if (isset($path)) { $folder->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize)); $folder->assign('freeSpace', $freeSpace); $folder->assign('uploadLimit', $uploadLimit); // PHP upload limit - $folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $folder->assign('usedSpacePercent', 0); $folder->assign('trash', false); $tmpl->assign('folder', $folder->fetchPage()); - $allowZip = OCP\Config::getSystemValue('allowZipDownload', true); - $tmpl->assign('allowZipDownload', intval($allowZip)); - $tmpl->assign('showDownloadButton', intval($allowZip)); $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=' . urlencode($getPath)); } else { - $tmpl->assign('showDownloadButton', true); $tmpl->assign('dir', $dir); // Show file preview if viewer is available diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 234b6d0983..7b5f603a10 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -15,12 +15,10 @@ src="" alt="getName()); ?>" />
- "/> t('Download'))?> -
diff --git a/lib/private/files.php b/lib/private/files.php index 7c437a16a9..739dae6418 100644 --- a/lib/private/files.php +++ b/lib/private/files.php @@ -108,7 +108,6 @@ class OC_Files { $xsendfile = false; } } else { - self::validateZipDownload($dir, $files); $zip = new ZipStreamer(false); } OC_Util::obEnd(); @@ -221,53 +220,6 @@ class OC_Files { } } - /** - * checks if the selected files are within the size constraint. If not, outputs an error page. - * - * @param string $dir - * @param array|string $files - */ - static function validateZipDownload($dir, $files) { - if (!OC_Config::getValue('allowZipDownload', true)) { - $l = OC_L10N::get('lib'); - header("HTTP/1.0 409 Conflict"); - OC_Template::printErrorPage( - $l->t('ZIP download is turned off.'), - $l->t('Files need to be downloaded one by one.') - . '
' . $l->t('Back to Files') . '' - ); - exit; - } - - $zipLimit = OC_Config::getValue('maxZipInputSize', OC_Helper::computerFileSize('800 MB')); - if ($zipLimit > 0) { - $totalsize = 0; - if(!is_array($files)) { - $files = array($files); - } - foreach ($files as $file) { - $path = $dir . '/' . $file; - if(\OC\Files\Filesystem::is_dir($path)) { - foreach (\OC\Files\Filesystem::getDirectoryContent($path) as $i) { - $totalsize += $i['size']; - } - } else { - $totalsize += \OC\Files\Filesystem::filesize($path); - } - } - if ($totalsize > $zipLimit) { - $l = OC_L10N::get('lib'); - header("HTTP/1.0 409 Conflict"); - OC_Template::printErrorPage( - $l->t('Selected files too large to generate zip file.'), - $l->t('Please download the files separately in smaller chunks or kindly ask your administrator.') - . '
' . $l->t('Back to Files') . '' - ); - exit; - } - } - } - /** * set the maximum upload size limit for apache hosts using .htaccess *