Handle hostnames with upper-case letters
[webmin.git] / useradmin / export_form.cgi
1 #!/usr/local/bin/perl
2 # export_form.cgi
3 # Display a form for exporting a batch file
4
5 require './user-lib.pl';
6 $access{'export'} || &error($text{'export_ecannot'});
7 &ui_print_header(undef, $text{'export_title'}, "", "export");
8
9 print "$text{'export_desc'}<p>\n";
10 print &ui_form_start("export_exec.cgi");
11 print &ui_table_start($text{'export_header'}, undef, 2);
12
13 # Destination
14 if ($access{'export'} == 2) {
15         # Can be to a file
16         print &ui_table_row($text{'export_to'},
17                 &ui_radio_table("to", 0,
18                         [ [ 0, $text{'export_show'} ],
19                           [ 1, $text{'export_file'},
20                                 &ui_filebox("file", undef, 30) ] ]));
21         }
22 else {
23         # Always in browser
24         print &ui_table_row($text{'export_to'}, $text{'export_show'});
25         }
26
27 # Export type
28 $pft = &passfiles_type();
29 print &ui_table_row($text{'export_pft'},
30         &ui_select("pft", $pft,
31                 [ map { [ $_, $text{'pft_'.$_} ] }
32                       map { /^pft_(\d+)$/ ? ( $1 ) : ( ) }
33                           sort { $a cmp $b } (keys %text) ]));
34
35 # Users to include
36 print &ui_table_row($text{'export_who'},
37         &ui_radio_table("mode", 0,
38                 [ [ 0, $text{'export_who'} ],
39                   [ 2, $text{'acl_uedit_only'},
40                         &ui_textbox("can", undef, 40)." ".
41                         &user_chooser_button("can", 1) ],
42                   [ 3, $text{'acl_uedit_except'},
43                         &ui_textbox("cannot", undef, 40)." ".
44                         &user_chooser_button("cannot", 1) ],
45                   [ 4, $text{'acl_uedit_uid'},
46                         &ui_textbox("uid", undef, 6)." - ".
47                         &ui_textbox("uid2", undef, 6) ],
48                   [ 5, $text{'acl_uedit_group'},
49                         &ui_textbox("group", undef, 40)." ".
50                         &group_chooser_button("group", 1)."<br>".
51                         &ui_checkbox("sec", 1, $text{'acl_uedit_sec'}, 0) ],
52                   [ 8, $text{'acl_uedit_gid'},
53                         &ui_textbox("gid", undef, 6)." - ".
54                         &ui_textbox("gid2", undef, 6) ],
55                  ]));
56
57 print &ui_table_end();
58 print &ui_form_end([ [ undef, $text{'export_ok'} ] ]);
59
60 &ui_print_footer("", $text{'index_return'});
61