Handle hostnames with upper-case letters
[webmin.git] / proftpd / 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 './proftpd-lib.pl';
6 &ReadParse();
7 &ui_print_header(undef, $text{'manual_configs'}, "",
8         undef, undef, undef, undef, &restart_button());
9
10 $conf = &get_config();
11 @files = &unique(map { $_->{'file'} } @$conf);
12 $in{'file'} = $files[0] if (!$in{'file'});
13 print "<form action=allmanual_form.cgi>\n";
14 print "<input type=submit value='$text{'manual_file'}'>\n";
15 print "<select name=file>\n";
16 foreach $f (@files) {
17         printf "<option %s>%s\n",
18                 $f eq $in{'file'} ? 'selected' : '', $f;
19         $found++ if ($f eq $in{'file'});
20         }
21 print "</select></form>\n";
22 $found || &error($text{'manual_efile'});
23
24 print "<form action=allmanual_save.cgi method=post ",
25       "enctype=multipart/form-data>\n";
26 print "<input type=hidden name=file value='$in{'file'}'>\n";
27 print "<textarea name=data rows=20 cols=80>";
28 open(FILE, $in{'file'});
29 while(<FILE>) { print &html_escape($_); }
30 close(FILE);
31 print "</textarea><br>\n";
32 print "<input type=submit value='$text{'save'}'>\n";
33
34 &ui_print_footer("", $text{'index_return'});
35