Handle hostnames with upper-case letters
[webmin.git] / postgresql / restore_form.cgi
1 #!/usr/local/bin/perl
2 # restore_form.cgi
3 # Display a form for restore a database
4
5 require './postgresql-lib.pl' ;
6
7 &ReadParse ( ) ;
8
9 &error_setup ( $text{'restore_err'} ) ;
10 $access{'restore'} || &error($text{'restore_ecannot'});
11 &can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'});
12 &has_command($config{'rstr_cmd'}) ||
13         &error(&text('restore_ecmd', "<tt>$config{'rstr_cmd'}</tt>"));
14
15 $desc = "<tt>$in{'db'}</tt>";
16 &ui_print_header($desc, $text{'restore_title'}, "", "restore_form" ) ;
17
18 print &ui_form_start("restore.cgi", "form-data");
19 print &ui_hidden("db", $in{'db'}),"\n";
20 print &ui_table_start($text{'restore_header'}, undef, 2);
21
22 print &ui_table_row($text{'restore_src'},
23         &ui_radio("src", 0,
24                 [ [ 0, &text('restore_src0',
25                              &ui_textbox("path", $config{'repository'}, 50).
26                              &file_chooser_button("path")).
27                        "<br>" ],
28                   [ 1, &text('restore_src1',
29                              &ui_upload("data")) ] ]));
30
31 print &ui_table_row($text{'restore_only'},
32                     &ui_yesno_radio("only", 0));
33
34 print &ui_table_row($text{'restore_clean'},
35                     &ui_yesno_radio("clean", 0));
36
37 print &ui_table_row($text{'restore_tables'},
38                     &ui_opt_textbox("tables", undef, 60,
39                                     $text{'restore_tables1'}."<br>",
40                                     $text{'restore_tables0'}));
41
42 print &ui_table_end();
43 print &ui_form_end([ [ "go", $text{'restore_go'} ] ]);
44
45 &ui_print_footer("edit_dbase.cgi?db=$in{'db'}", $text{'dbase_return'},
46         "", $text{'index_return'});