diff options
Diffstat (limited to 'files/admin.php')
-rw-r--r-- | files/admin.php | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/files/admin.php b/files/admin.php index 861b6037f3c..4ae3ee51236 100644 --- a/files/admin.php +++ b/files/admin.php @@ -25,23 +25,36 @@ // Init owncloud require_once('../lib/base.php'); -OC_User::checkAdminUser(); +OC_Util::checkAdminUser(); $htaccessWorking=(getenv('htaccessWorking')=='true'); -if(isset($_POST['maxUploadSize'])){ - $maxUploadFilesize=$_POST['maxUploadSize']; - OC_Files::setUploadLimit(OC_Helper::computerFileSize($maxUploadFilesize)); -}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); + +$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'])){ + if(($setMaxSize = OC_Files::setUploadLimit(OC_Helper::computerFileSize($_POST['maxUploadSize']))) !== false) { + $maxUploadFilesize = OC_Helper::humanFileSize($setMaxSize); + } + } + if(isset($_POST['maxZipInputSize'])) { + $maxZipInputSize=$_POST['maxZipInputSize']; + OC_Config::setValue('maxZipInputSize', OC_Helper::computerFileSize($maxZipInputSize)); + } + if(isset($_POST['submitFilesAdminSettings'])) { + OC_Config::setValue('allowZipDownload', isset($_POST['allowZipDownload'])); + } } +$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" ); -// return template -$tmpl = new OC_Template( "files", "admin", "user" ); + +$tmpl = new OC_Template( 'files', 'admin' ); $tmpl->assign( 'htaccessWorking', $htaccessWorking ); $tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize); -$tmpl->printPage(); - -?> +$tmpl->assign( 'maxPossibleUploadSize', OC_Helper::humanFileSize(PHP_INT_MAX)); +$tmpl->assign( 'allowZipDownload', $allowZipDownload); +$tmpl->assign( 'maxZipInputSize', $maxZipInputSize); +return $tmpl->fetchPage();
\ No newline at end of file |