diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2012-03-16 16:25:15 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2012-03-16 16:25:15 +0100 |
commit | a77edf88c6da02456569b2810830c19f7d2648b3 (patch) | |
tree | 8097700f8203206a1a53543393169e7c737d48eb /files | |
parent | cfc41942e443a585e549d194f2411586df18f450 (diff) | |
download | nextcloud-server-a77edf88c6da02456569b2810830c19f7d2648b3.tar.gz nextcloud-server-a77edf88c6da02456569b2810830c19f7d2648b3.zip |
check if selected files for zip archive are not too large
offer config option
Diffstat (limited to 'files')
-rw-r--r-- | files/admin.php | 18 | ||||
-rw-r--r-- | files/templates/admin.php | 11 |
2 files changed, 17 insertions, 12 deletions
diff --git a/files/admin.php b/files/admin.php index ea846202ab3..7e410652cfb 100644 --- a/files/admin.php +++ b/files/admin.php @@ -28,13 +28,20 @@ require_once('../lib/base.php'); OC_Util::checkAdminUser(); $htaccessWorking=(getenv('htaccessWorking')=='true'); -if(isset($_POST['maxUploadSize'])){ - $maxUploadFilesize=$_POST['maxUploadSize']; - OC_Files::setUploadLimit(OC_Helper::computerFileSize($maxUploadFilesize)); +if($_POST) { + if(isset($_POST['maxUploadSize'])){ + $maxUploadFilesize=$_POST['maxUploadSize']; + OC_Files::setUploadLimit(OC_Helper::computerFileSize($maxUploadFilesize)); + } + if(isset($_POST['maxZipInputSize'])) { + $maxZipInputSize=$_POST['maxZipInputSize']; + OC_Preferences::setValue('', 'files', 'maxZipInputSize', OC_Helper::computerFileSize($maxZipInputSize)); + } }else{ $upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize')); $post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size')); $maxUploadFilesize = min($upload_max_filesize, $post_max_size); + $maxZipInputSize = OC_Helper::humanfilesize(OC_Preferences::getValue('', 'files', 'maxZipInputSize', OC_Helper::computerFileSize('800 MB'))); } OC_App::setActiveNavigationEntry( "files_administration" ); @@ -42,6 +49,5 @@ OC_App::setActiveNavigationEntry( "files_administration" ); $tmpl = new OC_Template( 'files', 'admin' ); $tmpl->assign( 'htaccessWorking', $htaccessWorking ); $tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize); -return $tmpl->fetchPage(); - -?> +$tmpl->assign( 'maxZipInputSize', $maxZipInputSize); +return $tmpl->fetchPage();
\ No newline at end of file diff --git a/files/templates/admin.php b/files/templates/admin.php index eb655447044..8c3ba56ad52 100644 --- a/files/templates/admin.php +++ b/files/templates/admin.php @@ -3,11 +3,10 @@ <form name="filesForm" action='#' method='post'> <fieldset class="personalblock"> <legend><strong><?php echo $l->t('File handling');?></strong></legend> - <?php if($_['htaccessWorking']):?> - <label for="maxUploadSize"><?php echo $l->t( 'Maximum upload size' ); ?> </label><input name='maxUploadSize' id="maxUploadSize" value='<?php echo $_['uploadMaxFilesize'] ?>'/><br/> - <input type='submit' value='Save'/> - <?php else:?> - No settings currently available. - <?php endif;?> + <?php if($_['htaccessWorking']):?> + <label for="maxUploadSize"><?php echo $l->t( 'Maximum upload size' ); ?> </label><input name='maxUploadSize' id="maxUploadSize" value='<?php echo $_['uploadMaxFilesize'] ?>'/><br/> + <?php endif;?> + <label for="maxZipInputSize"><?php echo $l->t( 'Maximum input size for zip files (affects folder- and multi-file download)' ); ?> </label><input name="maxZipInputSize" id="maxZipInputSize" value='<?php echo $_['maxZipInputSize'] ?>'/><br/> + <input type="submit" value="Save"/> </fieldset> </form> |