]> source.dussan.org Git - nextcloud-server.git/commitdiff
fixed max possible upload size for files app in admin screen
authorMichael Göhler <somebody.here@gmx.de>
Sat, 6 Oct 2012 22:03:47 +0000 (00:03 +0200)
committerMichael Göhler <somebody.here@gmx.de>
Sat, 6 Oct 2012 22:31:07 +0000 (00:31 +0200)
used get_cfg_var() to get the real limit from php.ini instead of .ht_access
dont know why we used PHP_INT_MAX here...

apps/files/admin.php

index a8f2deffc927a0d8fb70c658f57046fa80179e4c..547f2bd7ddba5483693a8198c08fa848749a4edc 100644 (file)
@@ -30,8 +30,11 @@ OCP\User::checkAdminUser();
 $htaccessWorking=(getenv('htaccessWorking')=='true');
 
 $upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
+$upload_max_filesize_possible = OCP\Util::computerFileSize(get_cfg_var('upload_max_filesize'));
 $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
+$post_max_size_possible = OCP\Util::computerFileSize(get_cfg_var('post_max_size'));
 $maxUploadFilesize = OCP\Util::humanFileSize(min($upload_max_filesize, $post_max_size));
+$maxUploadFilesizePossible = OCP\Util::humanFileSize(min($upload_max_filesize_possible, $post_max_size_possible));
 if($_POST) {
        if(isset($_POST['maxUploadSize'])) {
                if(($setMaxSize = OC_Files::setUploadLimit(OCP\Util::computerFileSize($_POST['maxUploadSize']))) !== false) {
@@ -56,7 +59,8 @@ $htaccessWritable=is_writable(OC::$SERVERROOT.'/.htaccess');
 $tmpl = new OCP\Template( 'files', 'admin' );
 $tmpl->assign( 'uploadChangable', $htaccessWorking and $htaccessWritable );
 $tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
-$tmpl->assign( 'maxPossibleUploadSize', OCP\Util::humanFileSize(PHP_INT_MAX));
+$tmpl->assign( 'maxPossibleUploadSize', $maxUploadFilesizePossible);
 $tmpl->assign( 'allowZipDownload', $allowZipDownload);
 $tmpl->assign( 'maxZipInputSize', $maxZipInputSize);
-return $tmpl->fetchPage();
\ No newline at end of file
+return $tmpl->fetchPage();
+