3 # Display a form for doing batch creation, updates or deletion from a text file
5 require './user-lib.pl';
6 $access{'batch'} || &error($text{'batch_ecannot'});
7 &ui_print_header(undef, $text{'batch_title'}, "");
10 print &ui_hidden_start($text{'batch_instr'}, "instr", 0, "batch_form.cgi");
11 print "$text{'batch_desc'}\n";
12 $pft = &passfiles_type();
13 print "<p><tt>",$text{'batch_desc'.$pft},"</tt><p>\n";
14 print "$text{'batch_descafter'}<br>\n";
15 print "$text{'batch_descafter2'}\n";
16 print &ui_hidden_end("instr");
18 print &ui_form_start("batch_exec.cgi", "form-data");
19 print &ui_table_start($text{'batch_header'}, undef, 2);
22 print &ui_table_row($text{'batch_source'},
23 &ui_radio_table("source", 0,
24 [ [ 0, $text{'batch_source0'}, &ui_upload("file") ],
25 [ 1, $text{'batch_source1'}, &ui_textbox("local", undef, 40)." ".
26 &file_chooser_button("local") ],
27 [ 2, $text{'batch_source2'}, &ui_textarea("text", undef, 5, 60) ]
30 if ($access{'cothers'} == 1 || $access{'mothers'} == 1 ||
31 $access{'dothers'} == 1) {
33 print &ui_table_row($text{'batch_others'},
34 &ui_yesno_radio("others", int($config{'default_other'})));
37 # Only run post-command at end?
38 print &ui_table_row($text{'batch_batch'},
39 &ui_yesno_radio("batch", 0));
41 if ($access{'makehome'}) {
43 print &ui_table_row($text{'batch_makehome'},
44 &ui_yesno_radio("makehome", 1));
47 if ($access{'copy'} && $config{'user_files'} =~ /\S/) {
49 print &ui_table_row($text{'batch_copy'},
50 &ui_yesno_radio("copy", 1));
53 if ($access{'movehome'}) {
55 print &ui_table_row($text{'batch_movehome'},
56 &ui_yesno_radio("movehome", 1));
59 if ($access{'chuid'}) {
60 # Update UIDs on files
61 print &ui_table_row($text{'batch_chuid'},
62 &ui_radio("chuid", 1, [ [ 0, $text{'no'} ],
64 [ 2, $text{'uedit_allfiles'} ] ]));
67 if ($access{'chgid'}) {
68 # Update GIDs on files
69 print &ui_table_row($text{'batch_chgid'},
70 &ui_radio("chgid", 1, [ [ 0, $text{'no'} ],
72 [ 2, $text{'uedit_allfiles'} ] ]));
76 print &ui_table_row($text{'batch_delhome'},
77 &ui_yesno_radio("delhome", 1));
80 print &ui_table_row($text{'batch_crypt'},
81 &ui_yesno_radio("crypt", 0));
83 print &ui_table_end();
84 print &ui_form_end([ [ undef, $text{'batch_upload'} ] ]);
86 &ui_print_footer("", $text{'index_return'});