3 # Display a text box for manually editing directives from one of the files
5 require './proftpd-lib.pl';
7 &ui_print_header(undef, $text{'manual_configs'}, "",
8 undef, undef, undef, undef, &restart_button());
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";
17 printf "<option %s>%s\n",
18 $f eq $in{'file'} ? 'selected' : '', $f;
19 $found++ if ($f eq $in{'file'});
21 print "</select></form>\n";
22 $found || &error($text{'manual_efile'});
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($_); }
31 print "</textarea><br>\n";
32 print "<input type=submit value='$text{'save'}'>\n";
34 &ui_print_footer("", $text{'index_return'});