forked from webmin/webmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist_restore.cgi
executable file
·49 lines (40 loc) · 1.69 KB
/
list_restore.cgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/perl
# Show a form for restoring some or all firewall objects
require './itsecur-lib.pl';
&can_edit_error("restore");
&check_zip();
&header($text{'restore_title'}, "",
undef, undef, undef, undef, &apply_button());
print &ui_hr();
my ($mode, @dest) = &parse_backup_dest($config{'backup_dest'});
print &ui_form_start("restore.cgi", "form-data");
print &ui_table_start($text{'restore_header'}, undef, 2);
# Show source
print &ui_table_row($text{'restore_src'},
&ui_radio("src_def",($mode == 1 ? 0 : 1),[
[1,$text{'restore_src1'}." ".&ui_upload("file","",20)."<br>"],
[0,$text{'restore_src0'}." ".&ui_filebox("src",($mode == 1 ? $dest[0] : ""),40)]
])
,undef, ["valign=top","valign=top"]);
# Show password
print &ui_table_row($text{'restore_pass'},
&ui_radio("pass_def",($config{'backup_pass'} ? 0 : 1),[
[1,$text{'backup_nopass'}],[0, &ui_password("pass", $config{'backup_pass'},20) ]
])
,undef, ["valign=middle","valign=middle"]);
# Show what to restore
my %what = map { $_, 1 } split(/\s+/, $config{'backup_what'});
$tx = "";
foreach my $w (@backup_opts) {
$tx .= &ui_checkbox("what", $w, $text{$w."_title"}, ($what{$w} ? 1 : 0) )."<br>";
}
if (defined(&select_all_link)) {
$tx .= &ui_links_row([&select_all_link("what", 0), &select_invert_link("what", 0)]);
}
print &ui_table_row($text{'restore_what'}, $tx, ["valign=top","valign=top"]);
print &ui_table_end();
print "<p>";
print &ui_submit($text{'restore_ok'});
print &ui_form_end(undef,undef,1);
print &ui_hr();
&footer("", $text{'index_return'});