Handle hostnames with upper-case letters
[webmin.git] / apache / allmanual_form.cgi
1 #!/usr/local/bin/perl
2 # allmanual_form.cgi
3 # Display a text box for manually editing directives from one of the files
4
5 require './apache-lib.pl';
6 &ReadParse();
7 $access{'types'} eq '*' && $access{'virts'} eq '*' ||
8         &error($text{'manual_ecannot'});
9 &ui_print_header(undef, $text{'manual_configs'}, "");
10
11 $conf = &get_config();
12 @files = grep { -f $_ } &unique(map { $_->{'file'} } @$conf);
13 $in{'file'} = $files[0] if (!$in{'file'});
14 print "<form action=allmanual_form.cgi>\n";
15 print "<input type=submit value='$text{'manual_file'}'>\n";
16 print "<select name=file>\n";
17 foreach $f (@files) {
18         printf "<option %s>%s\n",
19                 $f eq $in{'file'} ? 'selected' : '', $f;
20         $found++ if ($f eq $in{'file'});
21         }
22 print "</select></form>\n";
23 $found || &error($text{'manual_efile'});
24
25 print &ui_form_start("allmanual_save.cgi", "form-data");
26 print &ui_hidden("file", $in{'file'}),"\n";
27 $data = &read_file_contents($in{'file'});
28 print &ui_textarea("data", $data, 20, 80, undef, undef,
29                    "style='width:100%'"),"<br>\n";
30 print &ui_form_end([ [ "save", $text{'save'} ] ]);
31
32 &ui_print_footer("", $text{'index_return'});
33