Only request "IndexIgnore" if mod_autoindex is loaded

Signed-off-by: Robert Scheck <robert@fedoraproject.org>
This commit is contained in:
Robert Scheck 2017-02-16 11:45:11 +01:00
parent f25c89461c
commit 25a2cb8c6e
4 changed files with 8 additions and 0 deletions

View File

@ -11,4 +11,6 @@ Satisfy All
</ifModule> </ifModule>
# section for Apache 2.2 and 2.4 # section for Apache 2.2 and 2.4
<ifModule mod_autoindex.c>
IndexIgnore * IndexIgnore *
</ifModule>

View File

@ -9,4 +9,6 @@ deny from all
</ifModule> </ifModule>
# section for Apache 2.2 and 2.4 # section for Apache 2.2 and 2.4
<ifModule mod_autoindex.c>
IndexIgnore * IndexIgnore *
</ifModule>

View File

@ -9,4 +9,6 @@ deny from all
</ifModule> </ifModule>
# section for Apache 2.2 and 2.4 # section for Apache 2.2 and 2.4
<ifModule mod_autoindex.c>
IndexIgnore * IndexIgnore *
</ifModule>

View File

@ -492,7 +492,9 @@ class Setup {
$content.= "Satisfy All\n"; $content.= "Satisfy All\n";
$content.= "</ifModule>\n\n"; $content.= "</ifModule>\n\n";
$content.= "# section for Apache 2.2 and 2.4\n"; $content.= "# section for Apache 2.2 and 2.4\n";
$content.= "<ifModule mod_autoindex.c>\n";
$content.= "IndexIgnore *\n"; $content.= "IndexIgnore *\n";
$content.= "</ifModule>\n";
$baseDir = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); $baseDir = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data');
file_put_contents($baseDir . '/.htaccess', $content); file_put_contents($baseDir . '/.htaccess', $content);