2 # Show a form for importing rules in CSV format
4 require './itsecur-lib.pl';
5 &can_edit_error("import");
7 &header($text{'import_title'}, "",
8 undef, undef, undef, undef, &apply_button());
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;
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";
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");
32 print "</table></td></tr></table>\n";
33 print "<input type=submit value='$text{'import_ok'}'></form>\n";
37 &footer("", $text{'index_return'});