diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-05-29 17:43:13 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-05-29 17:43:13 +0200 |
commit | 6b34ba8a8ef94c36c73dc68eb6cfe9b12335f7a4 (patch) | |
tree | 9d35064afa69d955e1158794cd836ce5a28f5149 /files | |
parent | f48344df309819d4f121dfc0b98aca142db3ed14 (diff) | |
download | nextcloud-server-6b34ba8a8ef94c36c73dc68eb6cfe9b12335f7a4.tar.gz nextcloud-server-6b34ba8a8ef94c36c73dc68eb6cfe9b12335f7a4.zip |
Make max upload filesize configurable for apache hosts
Diffstat (limited to 'files')
-rw-r--r-- | files/admin.php | 11 | ||||
-rw-r--r-- | files/settings.php | 2 | ||||
-rw-r--r-- | files/templates/admin.php | 6 |
3 files changed, 17 insertions, 2 deletions
diff --git a/files/admin.php b/files/admin.php index 0333e2c6cb1..59b822468ed 100644 --- a/files/admin.php +++ b/files/admin.php @@ -26,15 +26,26 @@ require_once('../lib/base.php'); require( 'template.php' ); + // Check if we are a user if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' )){ header( "Location: ".OC_HELPER::linkTo( "index.php" )); exit(); } +$htaccessWorking=(getenv('htaccessWorking')=='true'); +if(isset($_POST['maxUploadSize'])){ + $maxUploadFilesize=$_POST['maxUploadSize']; + OC_FILES::setUploadLimit(OC_HELPER::computerFileSize($maxUploadFilesize)); +}else{ + $maxUploadFilesize = ini_get('upload_max_filesize').'B'; +} + OC_APP::setActiveNavigationEntry( "files_administration" ); // return template $tmpl = new OC_TEMPLATE( "files", "admin", "admin" ); +$tmpl->assign( 'htaccessWorking', $htaccessWorking ); +$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize); $tmpl->printPage(); ?> diff --git a/files/settings.php b/files/settings.php index 6d237ed6152..23aed4d1b86 100644 --- a/files/settings.php +++ b/files/settings.php @@ -57,7 +57,7 @@ foreach( explode( "/", $dir ) as $i ){ // return template $tmpl = new OC_TEMPLATE( "files", "index", "user" ); -$tmpl->assign( "files", $files ); +$tmpl->assign( 'files', $files ); $tmpl->assign( "breadcrumb", $breadcrumb ); $tmpl->printPage(); diff --git a/files/templates/admin.php b/files/templates/admin.php index 65a540ac914..f768931eb2f 100644 --- a/files/templates/admin.php +++ b/files/templates/admin.php @@ -1,4 +1,7 @@ -<form> +<form action='#' method='post'> + <?php if($_['htaccessWorking']):?> + Maximum upload size <input name='maxUploadSize' value='<?php echo $_['uploadMaxFilesize'] ?>'/><br/> + <?php endif;?> <input type="checkbox" /> Allow public folders<br> (if public is enabled)<br> @@ -9,4 +12,5 @@ <input type="checkbox" /> Allow downloading shared files<br> <input type="checkbox" /> Allow uploading in shared directory<br> + <input type='submit' value='Save'/> </form> |