From 1bd27891e2d0f62f4ab9588dec9ca12b79e50030 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Fri, 13 Apr 2012 10:43:19 +0200 Subject: make upload size settings work probably. do not replace whole .htaccess, only replace what is needed. Consistent, human readable input on admin settings page. --- files/admin.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'files') diff --git a/files/admin.php b/files/admin.php index 289d95cb912..04ef6a4e828 100644 --- a/files/admin.php +++ b/files/admin.php @@ -29,10 +29,14 @@ OC_Util::checkAdminUser(); $htaccessWorking=(getenv('htaccessWorking')=='true'); +$upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize')); +$post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size')); +$maxUploadFilesize = OC_Helper::humanFileSize(min($upload_max_filesize, $post_max_size)); if($_POST) { if(isset($_POST['maxUploadSize'])){ - $maxUploadFilesize=$_POST['maxUploadSize']; - OC_Files::setUploadLimit(OC_Helper::computerFileSize($maxUploadFilesize)); + if(($setMaxSize = OC_Files::setUploadLimit(OC_Helper::computerFileSize($_POST['maxUploadSize']))) !== false) { + $maxUploadFilesize = OC_Helper::humanFileSize($setMaxSize); + } } if(isset($_POST['maxZipInputSize'])) { $maxZipInputSize=$_POST['maxZipInputSize']; @@ -42,10 +46,7 @@ if($_POST) { OC_Config::setValue('allowZipDownload', isset($_POST['allowZipDownload'])); } } -$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_Config::getValue('maxZipInputSize', OC_Helper::computerFileSize('800 MB'))); +$maxZipInputSize = OC_Helper::humanFileSize(OC_Config::getValue('maxZipInputSize', OC_Helper::computerFileSize('800 MB'))); $allowZipDownload = intval(OC_Config::getValue('allowZipDownload', true)); OC_App::setActiveNavigationEntry( "files_administration" ); -- cgit v1.2.3