- put 'server.error-handler-404' to the right place + beautification

This commit is contained in:
Michael Kaufmann (d00p)
2010-04-13 07:10:30 +00:00
parent cfaae63657
commit 47b2fe7c7c
2 changed files with 13 additions and 14 deletions

View File

@@ -459,27 +459,26 @@ class lighttpd
{ {
if(!empty($row['error404path'])) if(!empty($row['error404path']))
{ {
$error_string.= ' server.error-handler-404 = "' . makeCorrectFile($domain['documentroot'] . '/' . $row['error404path']) . '"' . "\n"; $error_string.= ' server.error-handler-404 = "' . makeCorrectFile($domain['documentroot'] . '/' . $row['error404path']) . '"' . "\n\n";
} }
if($row['options_indexes'] != '0') if($row['options_indexes'] != '0')
{ {
$path = makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1));
mkDirWithCorrectOwnership($domain['documentroot'], $row['path'], $domain['guid'], $domain['guid']);
// We need to remove the last slash, otherwise the regex wouldn't work
$path = substr($path, 0, -1);
$path_options.= '$HTTP["url"] =~ "^' . $path . '($|/)" {' . "\n";
$path_options.= "\t" . 'dir-listing.activate = "enable"' . "\n";
if(!empty($error_string)) if(!empty($error_string))
{ {
$path_options.= $error_string; $path_options.= $error_string;
// reset $error_string here to prevent duplicate entries // reset $error_string here to prevent duplicate entries
$error_string = ''; $error_string = '';
} }
$path_options.= '}' . "\n";
$path = makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1));
mkDirWithCorrectOwnership($domain['documentroot'], $row['path'], $domain['guid'], $domain['guid']);
// We need to remove the last slash, otherwise the regex wouldn't work
$path = substr($path, 0, -1);
$path_options.= ' $HTTP["url"] =~ "^' . $path . '($|/)" {' . "\n";
$path_options.= "\t" . 'dir-listing.activate = "enable"' . "\n";
$path_options.= ' }' . "\n\n";
} }
else else
{ {

View File

@@ -109,10 +109,10 @@ class lighttpd_fcgid extends lighttpd
$php_options_text.= "\t\t".')'."\n"; $php_options_text.= "\t\t".')'."\n";
$php_options_text.= "\t".')'."\n"; $php_options_text.= "\t".')'."\n";
$php_options_text.= "".')'."\n"; $php_options_text.= "\t".')'."\n";
} // foreach extension } // foreach extension
$php_options_text.= "".')'."\n"; $php_options_text.= ' )'."\n";
// create starter // create starter