diff options
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> |