Handle hostnames with upper-case letters
[webmin.git] / cluster-useradmin / group_form.cgi
1 #!/usr/local/bin/perl
2 # group_form.cgi
3 # Display a form for creating a new group
4
5 require './cluster-useradmin-lib.pl';
6 &ReadParse();
7 &ui_print_header(undef, $text{'gedit_title2'}, "", "create_group");
8 @hosts = &list_useradmin_hosts();
9 @servers = &list_servers();
10
11 print "<form action=\"create_group.cgi\" method=post>\n";
12 print "<table border width=100%>\n";
13 print "<tr $tb> <td><b>$text{'gedit_details'}</b></td> </tr>\n";
14 print "<tr $cb> <td><table width=100%>\n";
15
16 print "<tr> <td valign=top><b>$text{'gedit_group'}</b></td>\n";
17 print "<td valign=top><input name=group size=10></td>\n";
18
19 print "<td valign=top><b>$text{'gedit_gid'}</b></td>\n";
20 foreach $h (@hosts) {
21         foreach $g (@{$h->{'groups'}}) {
22                 $used{$g->{'gid'}}++;
23                 }
24         }
25 $newgid = $uconfig{'base_gid'};
26 while($used{$newgid}) {
27         $newgid++;
28         }
29 print "<td valign=top><input name=gid size=10 value='$newgid'></td>\n";
30 print "</tr>\n";
31
32 print "<tr> <td valign=top><b>$text{'pass'}</b></td> <td valign=top>\n";
33 print "<input type=radio name=passmode value=0 checked> $text{'none2'}<br>\n";
34 print "<input type=radio name=passmode value=1> $text{'encrypted'}\n";
35 print "<input name=encpass size=13><br>\n";
36 print "<input type=radio name=passmode value=2> $text{'clear'}\n";
37 print "<input name=pass size=15></td>\n";
38
39 print "<td valign=top><b>$text{'gedit_members'}</b></td>\n";
40 print "<td><table><tr><td><textarea wrap=auto name=members rows=5 cols=10>",
41       "</textarea></td>\n";
42 print "<td valign=top><input type=button onClick='ifield = document.forms[0].members; chooser = window.open(\"my_user_chooser.cgi?multi=1&user=\"+escape(ifield.value), \"chooser\", \"toolbar=no,menubar=no,scrollbars=yes,width=500,height=200\"); chooser.ifield = ifield' value=\"...\"></td></tr></table></td> </tr>\n";
43 print "</table></td></tr></table><p>\n";
44
45 print "<table border width=100%>\n";
46 print "<tr $tb> <td><b>$text{'uedit_oncreate'}</b></td> </tr>\n";
47 print "<tr $cb> <td><table>\n";
48
49 print "<tr> <td><b>$text{'gedit_cothers'}</b></td>\n";
50 print "<td><input type=radio name=others value=1 checked> $text{'yes'}</td>\n";
51 print "<td><input type=radio name=others value=0> $text{'no'}</td> </tr>\n";
52
53 # Show server selection input
54 &create_on_input($text{'uedit_servers'});
55
56 print "</table></td> </tr></table><p>\n";
57
58 print "<input type=submit value=\"$text{'create'}\"></form><p>\n";
59
60 &ui_print_footer("", $text{'index_return'});
61