summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2014-06-03 01:47:40 +0200
committerJan-Christoph Borchardt <hey@jancborchardt.net>2014-06-03 01:47:40 +0200
commit627090265026fd9d09a8c903ff3600dc8311bd8c (patch)
treecf3d3d964f12123f3195e4358a7b65ec3d41a83c /apps
parentf12a5248a3ee4fd71ade32580afdf0455fbc6764 (diff)
parentda090099f414ad4f0163ddfd21f1560f897f58d4 (diff)
downloadnextcloud-server-627090265026fd9d09a8c903ff3600dc8311bd8c.tar.gz
nextcloud-server-627090265026fd9d09a8c903ff3600dc8311bd8c.zip
Merge pull request #8821 from owncloud/kill-zip-download-restriction
drop allowZIPdownload and maxZIPSize as options
Diffstat (limited to 'apps')
-rw-r--r--apps/files/admin.php12
-rw-r--r--apps/files/appinfo/update.php8
-rw-r--r--apps/files/appinfo/version2
-rw-r--r--apps/files/index.php1
-rw-r--r--apps/files/js/admin.js8
-rw-r--r--apps/files/js/fileactions.js8
-rw-r--r--apps/files/list.php1
-rw-r--r--apps/files/templates/admin.php10
-rw-r--r--apps/files/templates/list.php13
-rw-r--r--apps/files_sharing/public.php5
-rw-r--r--apps/files_sharing/templates/public.php2
-rw-r--r--apps/files_sharing/tests/js/appSpec.js2
12 files changed, 16 insertions, 56 deletions
diff --git a/apps/files/admin.php b/apps/files/admin.php
index 02c3147dba5..bf12af74105 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 00000000000..de635e5ce6b
--- /dev/null
+++ b/apps/files/appinfo/update.php
@@ -0,0 +1,8 @@
+<?php
+
+// this drops the keys below, because they aren't needed anymore
+// core related
+if (version_compare(\OCP\Config::getSystemValue('version', '0.0.0'), '7.0.0', '<')) {
+ \OCP\Config::deleteSystemValue('allowZipDownload');
+ \OCP\Config::deleteSystemValue('maxZipInputSize');
+}
diff --git a/apps/files/appinfo/version b/apps/files/appinfo/version
index 2bf1ca5f549..18efdb9ae67 100644
--- a/apps/files/appinfo/version
+++ b/apps/files/appinfo/version
@@ -1 +1 @@
-1.1.7
+1.1.8
diff --git a/apps/files/index.php b/apps/files/index.php
index 95ae7977ecc..ba46866ab19 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -123,6 +123,5 @@ $tmpl->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 842b73c0cae..dcfec824cfe 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 3df62f37518..de02bf5e730 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 e583839b251..5ecbd1c7fa0 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 5f7d3261d6c..a75f0c94878 100644
--- a/apps/files/templates/admin.php
+++ b/apps/files/templates/admin.php
@@ -10,16 +10,6 @@
<?php endif;?>
<br/>
<?php endif;?>
- <input type="checkbox" name="allowZipDownload" id="allowZipDownload" value="1"
- title="<?php p($l->t( 'Needed for multi-file and folder downloads.' )); ?>"
- <?php if ($_['allowZipDownload']): ?> checked="checked"<?php endif; ?> />
- <label for="allowZipDownload"><?php p($l->t( 'Enable ZIP-download' )); ?></label><br/>
-
- <input type="text" name="maxZipInputSize" id="maxZipInputSize" style="width:180px;" value='<?php p($_['maxZipInputSize']) ?>'
- title="<?php p($l->t( '0 is unlimited' )); ?>"
- <?php if (!$_['allowZipDownload']): ?> disabled="disabled"<?php endif; ?> /><br />
- <em><?php p($l->t( 'Maximum input size for ZIP files' )); ?> </em><br />
-
<input type="hidden" value="<?php p($_['requesttoken']); ?>" name="requesttoken" />
<input type="submit" name="submitFilesAdminSettings" id="submitFilesAdminSettings"
value="<?php p($l->t( 'Save' )); ?>"/>
diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php
index 17bf3b3de83..eddcd9f6236 100644
--- a/apps/files/templates/list.php
+++ b/apps/files/templates/list.php
@@ -61,13 +61,11 @@
<label for="select_all_files"></label>
<a class="name sort columntitle" data-sort="name"><span><?php p($l->t( 'Name' )); ?></span><span class="sort-indicator"></span></a>
<span id="selectedActionsList" class="selectedActions">
- <?php if($_['allowZipDownload']) : ?>
- <a href="" class="download">
- <img class="svg" alt="Download"
- src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>" />
- <?php p($l->t('Download'))?>
- </a>
- <?php endif; ?>
+ <a href="" class="download">
+ <img class="svg" alt="Download"
+ src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>" />
+ <?php p($l->t('Download'))?>
+ </a>
</span>
</div>
</th>
@@ -89,7 +87,6 @@
<tfoot>
</tfoot>
</table>
-<input type="hidden" name="allowZipDownload" id="allowZipDownload" value="<?php p($_['allowZipDownload']); ?>" />
<input type="hidden" name="dir" id="dir" value="" />
<div id="editor"></div><!-- FIXME Do not use this div in your app! It is deprecated and will be removed in the future! -->
<div id="uploadsize-message" title="<?php p($l->t('Upload too large'))?>">
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 8a86cb3806a..4782c4dbe32 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 234b6d09838..7b5f603a105 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -15,12 +15,10 @@
src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="<?php p($theme->getName()); ?>" /></a>
<div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div>
<div class="header-right">
- <?php if ($_['showDownloadButton']): ?>
<a href="<?php p($_['downloadURL']); ?>" id="download" class="button">
<img class="svg" alt="" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"/>
<?php p($l->t('Download'))?>
</a>
- <?php endif ?>
</div>
</div></header>
<div id="content">
diff --git a/apps/files_sharing/tests/js/appSpec.js b/apps/files_sharing/tests/js/appSpec.js
index ad95ee53942..3a1b495a16b 100644
--- a/apps/files_sharing/tests/js/appSpec.js
+++ b/apps/files_sharing/tests/js/appSpec.js
@@ -67,7 +67,7 @@ describe('OCA.Sharing.App tests', function() {
expect(fileActions.actions.all).toBeDefined();
expect(fileActions.actions.all.Delete).toBeDefined();
expect(fileActions.actions.all.Rename).toBeDefined();
- expect(fileActions.actions.file.Download).toBeDefined();
+ expect(fileActions.actions.all.Download).toBeDefined();
expect(fileActions.defaults.dir).toEqual('Open');
});