summaryrefslogtreecommitdiffstats
path: root/files
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2012-04-13 10:43:19 +0200
committerArthur Schiwon <blizzz@owncloud.com>2012-04-13 10:43:44 +0200
commit1bd27891e2d0f62f4ab9588dec9ca12b79e50030 (patch)
tree7a1dff4be437e60fa270a5953756e6f1ec2468ba /files
parent1d8fdf52d52f4a73cb0a59b5d2c3a088ae1e9247 (diff)
downloadnextcloud-server-1bd27891e2d0f62f4ab9588dec9ca12b79e50030.tar.gz
nextcloud-server-1bd27891e2d0f62f4ab9588dec9ca12b79e50030.zip
make upload size settings work probably. do not replace whole .htaccess, only replace what is needed. Consistent, human readable input on admin settings page.
Diffstat (limited to 'files')
-rw-r--r--files/admin.php13
1 files changed, 7 insertions, 6 deletions
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" );