Handle hostnames with upper-case letters
[webmin.git] / itsecur-firewall / list_welf.cgi
1 #!/usr/bin/perl
2 # Show a form for exporting a log in WELF format
3
4 require './itsecur-lib.pl';
5 &can_edit_error("report");
6 &ReadParse();
7 &header($text{'welf_title'}, "",
8         undef, undef, undef, undef, &apply_button());
9 print "<hr>\n";
10
11 print "<form action=welf.cgi/logs.welf method=post>\n";
12 foreach $i (keys %in) {
13         print "<input type=hidden name=$i value='",
14               &html_escape($in{$i}),"'>\n";
15         }
16
17 print "<table border>\n";
18 print "<tr $tb> <td><b>$text{'welf_header'}</b></td> </tr>\n";
19 print "<tr $cb> <td><table>\n";
20
21 # Show destination
22 ($mode, @dest) = &parse_backup_dest($config{'welf_dest'});
23 print "<tr> <td valign=top><b>$text{'welf_dest'}</b></td>\n";
24 print "<td><table cellpadding=0 cellspacing=0>\n";
25 printf "<tr> <td><input type=radio name=dest_mode value=0 %s></td> <td>%s</td> </tr>\n",
26         $mode == 0 ? "checked" : "", $text{'backup_dest0'};
27
28 printf "<tr> <td><input type=radio name=dest_mode value=1 %s></td> <td>%s</td>\n",
29         $mode == 1 ? "checked" : "", $text{'backup_dest1'};
30 printf "<td colspan=3><input name=dest size=40 value='%s'> %s</td> </tr>\n",
31         $mode == 1 ? $dest[0] : "", &file_chooser_button("dest");
32
33 printf "<tr> <td><input type=radio name=dest_mode value=3 %s></td> <td>%s</td>\n",
34         $mode == 3 ? "checked" : "", $text{'backup_dest3'};
35 printf "<td colspan=3><input name=email size=40 value='%s'></td> </tr>\n",
36         $mode == 3 ? $dest[0] : "";
37
38 printf "<tr> <td><input type=radio name=dest_mode value=2 %s></td>\n",
39         $mode == 2 ? "checked" : "";
40 printf "<td>%s</td> <td><input name=ftphost size=20 value='%s'></td>\n",
41         $text{'backup_dest2'}, $mode == 2 ? $dest[2] : "";
42 printf "<td>%s</td> <td><input name=ftpfile size=20 value='%s'></td> </tr>\n",
43         $text{'backup_ftpfile'}, $mode == 2 ? $dest[3] : "";
44 printf "<tr> <td></td> <td>%s</td> <td><input name=ftpuser size=15 value='%s'></td>\n",
45         $text{'backup_ftpuser'}, $mode == 2 ? $dest[0] : "";
46 printf "<td>%s</td> <td><input name=ftppass type=password size=15 value='%s'></td> </tr>\n",
47         $text{'backup_ftppass'}, $mode == 2 ? $dest[1] : "";
48 print "</table></td> </tr>\n";
49
50 print "</table></td></tr></table>\n";
51 print "<input type=submit value='$text{'welf_ok'}'></form>\n";
52
53 print "<hr>\n";
54 &footer("", $text{'index_return'});
55