Handle hostnames with upper-case letters
[webmin.git] / itsecur-firewall / list_groups.cgi
1 #!/usr/bin/perl
2 # list_groups.cgi
3 # Displays a list of host and network groups
4
5 require './itsecur-lib.pl';
6 &can_use_error("groups");
7 &header($text{'groups_title'}, "",
8         undef, undef, undef, undef, &apply_button());
9 print "<hr>\n";
10
11 @groups = &list_groups();
12 $edit = &can_edit("groups");
13 if (@groups) {
14         print "<a href='edit_group.cgi?new=1'>$text{'groups_add'}</a><br>\n"
15                 if ($edit);
16         print "<table border>\n";
17         print "<tr $tb> <td><b>$text{'group_name'}</b></td> ",
18               "<td><b>$text{'group_members'}</b></td> </tr>\n";
19         foreach $g (@groups) {
20                 print "<tr $cb>\n";
21                 print "<td><a href='edit_group.cgi?idx=$g->{'index'}'>",
22                       "$g->{'name'}</a></td>\n";
23                 @mems = @{$g->{'members'}};
24                 if (@mems > 5) {
25                         @mems = (@mems[0..4], "...");
26                         }
27                 print "<td>",join(" , ",
28                                   map { &group_name($_) } @mems),"</td>\n";
29                 print "</tr>\n";
30                 }
31         print "</table>\n";
32         }
33 else {
34         print "<b>$text{'groups_none'}</b><p>\n";
35         }
36 print "<a href='edit_group.cgi?new=1'>$text{'groups_add'}</a><p>\n"
37         if ($edit);
38
39 print "<hr>\n";
40 &footer("", $text{'index_return'});