3 # Display a form for doing batch creation, updates or deletion from a text file
5 require './ldap-useradmin-lib.pl';
6 $access{'batch'} || &error($text{'batch_ecannot'});
7 &ui_print_header(undef, $text{'batch_title'}, "");
9 $ldap = &ldap_connect();
10 $schema = $ldap->schema();
11 $pft = $schema->attribute("shadowLastChange") ? 2 : 0;
14 print &ui_hidden_start($text{'batch_instr'}, "instr", 0, "batch_form.cgi");
15 print "$text{'batch_desc'}\n";
16 print "<p><tt>",$text{'batch_desc'.$pft},"</tt><p>\n";
17 print "$text{'batch_descafter'}<br>\n";
18 print "$text{'batch_descafter2'}<br>\n";
19 print &ui_hidden_end("instr");
21 print &ui_form_start("batch_exec.cgi", "form-data");
22 print &ui_table_start($text{'batch_header'}, undef, 2);
25 print &ui_table_row($text{'batch_source'},
26 &ui_radio_table("source", 0,
27 [ [ 0, $text{'batch_source0'}, &ui_upload("file") ],
28 [ 1, $text{'batch_source1'}, &ui_textbox("local", undef, 40)." ".
29 &file_chooser_button("local") ],
30 [ 2, $text{'batch_source2'}, &ui_textarea("text", undef, 5, 60) ]
34 print &ui_table_row($text{'batch_others'},
35 &ui_yesno_radio("others", $config{'default_other'}));
37 # Only run post-command at end?
38 print &ui_table_row($text{'batch_batch'},
39 &ui_yesno_radio("batch", 0));
42 print &ui_table_row($text{'batch_makehome'},
43 &ui_yesno_radio("makehome", 1));
46 print &ui_table_row($text{'batch_copy'},
47 &ui_yesno_radio("copy", 1));
50 print &ui_table_row($text{'batch_movehome'},
51 &ui_yesno_radio("movehome", 1));
53 # Update UIDs on files
54 print &ui_table_row($text{'batch_chuid'},
55 &ui_radio("chuid", 1, [ [ 0, $text{'no'} ],
57 [ 2, $text{'uedit_allfiles'} ] ]));
59 # Update GIDs on files
60 print &ui_table_row($text{'batch_chgid'},
61 &ui_radio("chgid", 1, [ [ 0, $text{'no'} ],
63 [ 2, $text{'uedit_allfiles'} ] ]));
66 print &ui_table_row($text{'batch_delhome'},
67 &ui_yesno_radio("delhome", 1));
70 print &ui_table_row($text{'batch_crypt'},
71 &ui_yesno_radio("crypt", 0));
73 #Force change password at next login
74 print &ui_table_row($text{'uedit_forcechange'},
75 &ui_yesno_radio("forcechange", 0));
77 # Create Samba account
78 print &ui_table_row($text{'batch_samba'},
79 &ui_yesno_radio("samba", $config{'samba_def'} ? 1 : 0));
81 print &ui_table_end();
82 print &ui_form_end([ [ undef, $text{'batch_upload'} ] ]);
84 &ui_print_footer("", $text{'index_return'});