mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Config option to disable directory listijng https://github.com/webmin/webmin/issues/874
This commit is contained in:
@@ -2259,6 +2259,9 @@ if (-d _) {
|
||||
}
|
||||
if (-d _) {
|
||||
# This is definitely a directory.. list it
|
||||
if ($config{'nolistdir'}) {
|
||||
&http_error(500, "Directory is missing an index file");
|
||||
}
|
||||
print DEBUG "handle_request: listing directory\n";
|
||||
local $resp = "HTTP/1.0 $ok_code $ok_message\r\n".
|
||||
"Date: $datestr\r\n".
|
||||
|
||||
@@ -47,6 +47,9 @@ $miniserv{'gzip'} = $in{'gzip'};
|
||||
# Save redirect type
|
||||
$gconfig{'relative_redir'} = $in{'redir'};
|
||||
|
||||
# Save directory list option
|
||||
$miniserv{'nolistdir'} = !$in{'listdir'};
|
||||
|
||||
# Save global config
|
||||
&lock_file("$config_directory/config");
|
||||
&write_file("$config_directory/config", \%gconfig);
|
||||
|
||||
@@ -60,6 +60,10 @@ print &ui_table_row($text{'advanced_redir'},
|
||||
[ [ 1, $text{'advanced_redir1'} ],
|
||||
[ 0, $text{'advanced_redir0'} ] ]), undef, [ "valign=middle","valign=middle" ]);
|
||||
|
||||
# Allow directory listing
|
||||
print &ui_table_row($text{'advanced_listdir'},
|
||||
&ui_yesno_radio("listdir", !$miniserv{'nolistdir'}));
|
||||
|
||||
print &ui_table_end();
|
||||
print &ui_form_end([ [ "save", $text{'save'} ] ]);
|
||||
|
||||
|
||||
@@ -886,6 +886,7 @@ advanced_egzip=Gzip compression cannot be enabled unless the $1 perl module is i
|
||||
advanced_redir=URL format for redirects
|
||||
advanced_redir1=Path only
|
||||
advanced_redir0=Protocol, host, port and path
|
||||
advanced_listdir=List directories without an index file?
|
||||
|
||||
syslog_errorlog=Webmin error log
|
||||
|
||||
|
||||
Reference in New Issue
Block a user