Handle hostnames with upper-case letters
[webmin.git] / itsecur-firewall / list_import.cgi
1 #!/usr/bin/perl
2 # Show a form for importing rules in CSV format
3
4 require './itsecur-lib.pl';
5 &can_edit_error("import");
6 &check_zip();
7 &header($text{'import_title'}, "",
8         undef, undef, undef, undef, &apply_button());
9
10 foreach $i (1 .. (&supports_time() ? 4 : 3)) {
11         $prog = $i == 1 ? "import_rules.cgi" :
12                 $i == 2 ? "import_servs.cgi" :
13                 $i == 3 ? "import_groups.cgi" :
14                 $i == 4 ? "import_times.cgi" : undef;
15         print "<hr>\n";
16         print $text{'import_desc'.$i},"<p>\n";
17         print "<form action=$prog enctype=multipart/form-data method=post>\n";
18         print "<table border>\n";
19         print "<tr $tb> <td><b>",$text{'import_header'.$i},"</b></td> </tr>\n";
20         print "<tr $cb> <td><table>\n";
21
22         # Show source
23         print "<tr> <td valign=top><b>$text{'import_src'}</b></td> <td>\n";
24         printf "<input type=radio name=src_def value=1 %s> %s\n",
25                 $mode != 1 ? "checked" : "", $text{'restore_src1'};
26         print "<input name=file type=file size=20><br>\n";
27         printf "<input type=radio name=src_def value=0 %s> %s\n",
28                 $mode == 1 ? "checked" : "", $text{'restore_src0'};
29         printf "<input name=src size=40 value='%s'> %s</td> </tr>\n",
30                 $mode == 1 ? $dest[0] : undef, &file_chooser_button("src");
31
32         print "</table></td></tr></table>\n";
33         print "<input type=submit value='$text{'import_ok'}'></form>\n";
34         }
35
36 print "<hr>\n";
37 &footer("", $text{'index_return'});
38