Handle hostnames with upper-case letters
[webmin.git] / qmailadmin / old_edit_rfile.cgi
1 #!/usr/local/bin/perl
2 # edit_rfile.cgi
3 # Display the contents of an autoreply file
4
5 require './qmail-lib.pl';
6 &ReadParse();
7
8 &ui_print_header(undef, $text{'rfile_title'}, "");
9 open(FILE, $in{'file'});
10 while(<FILE>) {
11         if (/^Reply-Tracking:\s*(.*)/) {
12                 $replies = $1;
13                 }
14         elsif (/^Reply-Period:\s*(.*)/) {
15                 $period = $1;
16                 }
17         else {
18                 push(@lines, $_);
19                 }
20         }
21 close(FILE);
22
23 print "<b>",&text('rfile_desc', "<tt>$in{'file'}</tt>"),"</b><p>\n";
24 print "$text{'rfile_desc2'}<p>\n";
25
26 print "<form action=save_rfile.cgi method=post enctype=multipart/form-data>\n";
27 print "<input type=hidden name=file value=\"$in{'file'}\">\n";
28 print "<input type=hidden name=name value=\"$in{'name'}\">\n";
29 print "<textarea name=text rows=20 cols=80 $config{'wrap_mode'}>",
30         join("", @lines),"</textarea><p>\n";
31
32 print $text{'rfile_replies'},"\n";
33 printf "<input type=radio name=replies_def value=1 %s> %s\n",
34         $replies eq '' ? "checked" : "", $text{'rfile_none'};
35 printf "<input type=radio name=replies_def value=0 %s> %s\n",
36         $replies eq '' ? "" :"checked", $text{'rfile_file'};
37 printf "<input name=replies size=30 value='%s'> %s<br>\n",
38         $replies, &file_chooser_button("replies");
39 print "&nbsp;" x 3;
40 print $text{'rfile_period'},"\n";
41 printf "<input type=radio name=period_def value=1 %s> %s\n",
42         $period eq '' ? "checked" : "", $text{'rfile_default'};
43 printf "<input type=radio name=period_def value=0 %s>\n",
44         $period eq '' ? "" :"checked";
45 printf "<input name=period size=5 value='%s'> %s<p>\n",
46         $period, $text{'rfile_secs'};
47
48 print "<input type=submit value=\"$text{'save'}\"> ",
49       "<input type=reset value=\"$text{'rfile_undo'}\">\n";
50 print "</form>\n";
51
52 &ui_print_footer("edit_alias.cgi?name=$in{'name'}", $text{'aform_return'});
53