Skip to content
Snippets Groups Projects
Commit a3c1f70b authored by Robin Appelman's avatar Robin Appelman
Browse files

dont show config option for file upload size if we cant write the new value

parent 549889d3
No related branches found
No related tags found
No related merge requests found
...@@ -51,8 +51,10 @@ $allowZipDownload = intval(OCP\Config::getSystemValue('allowZipDownload', true)) ...@@ -51,8 +51,10 @@ $allowZipDownload = intval(OCP\Config::getSystemValue('allowZipDownload', true))
OCP\App::setActiveNavigationEntry( "files_administration" ); OCP\App::setActiveNavigationEntry( "files_administration" );
$htaccessWritable=is_writable(OC::$SERVERROOT.'/.htaccess');
$tmpl = new OCP\Template( 'files', 'admin' ); $tmpl = new OCP\Template( 'files', 'admin' );
$tmpl->assign( 'htaccessWorking', $htaccessWorking ); $tmpl->assign( 'uploadChangable', $htaccessWorking and $htaccessWritable );
$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize); $tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign( 'maxPossibleUploadSize', OCP\Util::humanFileSize(PHP_INT_MAX)); $tmpl->assign( 'maxPossibleUploadSize', OCP\Util::humanFileSize(PHP_INT_MAX));
$tmpl->assign( 'allowZipDownload', $allowZipDownload); $tmpl->assign( 'allowZipDownload', $allowZipDownload);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<form name="filesForm" action='#' method='post'> <form name="filesForm" action='#' method='post'>
<fieldset class="personalblock"> <fieldset class="personalblock">
<legend><strong><?php echo $l->t('File handling');?></strong></legend> <legend><strong><?php echo $l->t('File handling');?></strong></legend>
<?php if($_['htaccessWorking']):?> <?php if($_['uploadChangable']):?>
<label for="maxUploadSize"><?php echo $l->t( 'Maximum upload size' ); ?> </label><input name='maxUploadSize' id="maxUploadSize" value='<?php echo $_['uploadMaxFilesize'] ?>'/>(<?php echo $l->t('max. possible: '); echo $_['maxPossibleUploadSize'] ?>)<br/> <label for="maxUploadSize"><?php echo $l->t( 'Maximum upload size' ); ?> </label><input name='maxUploadSize' id="maxUploadSize" value='<?php echo $_['uploadMaxFilesize'] ?>'/>(<?php echo $l->t('max. possible: '); echo $_['maxPossibleUploadSize'] ?>)<br/>
<?php endif;?> <?php endif;?>
<input type="checkbox" name="allowZipDownload" id="allowZipDownload" value="1" title="<?php echo $l->t( 'Needed for multi-file and folder downloads.' ); ?>"<?php if ($_['allowZipDownload']) echo ' checked="checked"'; ?> /> <label for="allowZipDownload"><?php echo $l->t( 'Enable ZIP-download' ); ?></label> <br/> <input type="checkbox" name="allowZipDownload" id="allowZipDownload" value="1" title="<?php echo $l->t( 'Needed for multi-file and folder downloads.' ); ?>"<?php if ($_['allowZipDownload']) echo ' checked="checked"'; ?> /> <label for="allowZipDownload"><?php echo $l->t( 'Enable ZIP-download' ); ?></label> <br/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment