summaryrefslogtreecommitdiffstats
path: root/files/admin.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2012-03-16 16:25:15 +0100
committerArthur Schiwon <blizzz@owncloud.com>2012-03-16 16:25:15 +0100
commita77edf88c6da02456569b2810830c19f7d2648b3 (patch)
tree8097700f8203206a1a53543393169e7c737d48eb /files/admin.php
parentcfc41942e443a585e549d194f2411586df18f450 (diff)
downloadnextcloud-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/admin.php')
-rw-r--r--files/admin.php18
1 files changed, 12 insertions, 6 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