Handle hostnames with upper-case letters
[webmin.git] / samba / list_groups.cgi
1 #!/usr/local/bin/perl
2 # list_group.cgi
3 # List all existing Samba groups
4
5 require './samba-lib.pl';
6
7 $access{'maint_groups'} || &error($text{'groups_ecannot'});
8 &ui_print_header(undef, $text{'groups_title'}, "");
9
10 &check_group_enabled($text{'groups_cannot'});
11
12 @groups = &list_groups();
13 if (@groups) {
14         @groups = sort { lc($a->{'name'}) cmp lc($b->{'name'}) } @groups
15                 if ($config{'sort_mode'});
16         print "<a href='edit_group.cgi?new=1'>$text{'groups_add'}</a><br>\n";
17         print "<table border width=100%>\n";
18         print "<tr $tb> <td><b>$text{'groups_name'}</b></td> ",
19               "<td><b>$text{'groups_unix'}</b></td> ",
20               "<td><b>$text{'groups_type'}</b></td> ",
21               "<td><b>$text{'groups_sid'}</b></td> </tr>\n";
22         foreach $g (@groups) {
23                 print "<tr $cb>\n";
24                 print "<td><a href='edit_group.cgi?idx=$g->{'index'}'>",
25                       "$g->{'name'}</a></td>\n";
26                 print "<td>",$g->{'unix'} == -1 ? $text{'groups_nounix'} :
27                              "<tt>$g->{'unix'}</tt>","</td>\n";
28                 print "<td>",$text{'groups_type_'.$g->{'type'}} ||
29                              $g->{'type'},"</td>\n";
30                 print "<td><tt>$g->{'sid'}</tt></td>\n";
31                 print "</tr>\n";
32                 }
33         print "</table>\n";
34         }
35 else {
36         print "<b>$text{'groups_none'}</b><p>\n";
37         }
38 print "<a href='edit_group.cgi?new=1'>$text{'groups_add'}</a><p>\n";
39
40 &ui_print_footer("", $text{'index_sharelist'});
41