2 # Show a form for restoring some or all firewall objects
4 require './itsecur-lib.pl';
5 &can_edit_error("restore");
7 &header($text{'restore_title'}, "",
8 undef, undef, undef, undef, &apply_button());
11 ($mode, @dest) = &parse_backup_dest($config{'backup_dest'});
12 print "<form action=restore.cgi enctype=multipart/form-data method=post>\n";
13 print "<table border>\n";
14 print "<tr $tb> <td><b>$text{'restore_header'}</b></td> </tr>\n";
15 print "<tr $cb> <td><table>\n";
18 print "<tr> <td valign=top><b>$text{'restore_src'}</b></td> <td>\n";
19 printf "<input type=radio name=src_def value=1 %s> %s\n",
20 $mode != 1 ? "checked" : "", $text{'restore_src1'};
21 print "<input name=file type=file size=20><br>\n";
22 printf "<input type=radio name=src_def value=0 %s> %s\n",
23 $mode == 1 ? "checked" : "", $text{'restore_src0'};
24 printf "<input name=src size=40 value='%s'> %s</td> </tr>\n",
25 $mode == 1 ? $dest[0] : undef, &file_chooser_button("src");
28 print "<tr> <td valign=top><b>$text{'restore_pass'}</b></td> <td>\n";
29 printf "<input type=radio name=pass_def value=1 %s> %s\n",
30 $config{'backup_pass'} ? "" : "checked", $text{'backup_nopass'};
31 printf "<input type=radio name=pass_def value=0 %s>\n",
32 $config{'backup_pass'} ? "checked" : "";
33 printf "<input type=password name=pass value='%s'></td> </tr>\n",
34 $config{'backup_pass'};
36 # Show what to restore
37 %what = map { $_, 1 } split(/\s+/, $config{'backup_what'});
38 print "<tr> <td valign=top><b>$text{'restore_what'}</b></td> <td>\n";
39 foreach $w (@backup_opts) {
40 printf "<input type=checkbox name=what value=%s %s> %s<br>\n",
41 $w, $what{$w} ? "checked" : "", $text{$w."_title"};
43 if (defined(&select_all_link)) {
44 print &select_all_link("what", 0),"\n";
45 print &select_invert_link("what", 0),"\n";
47 print "</td> </tr>\n";
49 print "</table></td></tr></table>\n";
50 print "<input type=submit value='$text{'restore_ok'}'></form>\n";
53 &footer("", $text{'index_return'});