Handle hostnames with upper-case letters
[webmin.git] / rbac / list_profs.cgi
1 #!/usr/local/bin/perl
2 # Show a table of all profiles
3
4 require './rbac-lib.pl';
5 $access{'profs'} || &error($text{'profs_ecannot'});
6 &ui_print_header(undef, $text{'profs_title'}, "", "profs");
7
8 $profs = &list_prof_attrs();
9 if (@$profs) {
10         print "<a href='edit_prof.cgi?new=1'>$text{'profs_add'}</a><br>\n"
11                 if ($access{'profs'} == 1);
12         print &ui_columns_start(
13                 [ $text{'profs_name'},
14                   $text{'profs_desc'},
15                   $text{'profs_auths'} ]);
16         foreach $p (sort { $a->{'name'} cmp $b->{'name'} } @$profs) {
17                 print &ui_columns_row(
18                         [ $access{'profs'} == 1 ?
19                             "<a href='edit_prof.cgi?idx=$p->{'index'}'>$p->{'name'}</a>" :
20                             $p->{'name'},
21                           &rbac_help_link($p, $p->{'desc'}),
22                           &nice_comma_list($p->{'attr'}->{'auths'}),
23                         ]);
24                 }
25         print &ui_columns_end();
26         }
27 else {
28         print "<b>$text{'profs_none'}</b><p>\n";
29         }
30 print "<a href='edit_prof.cgi?new=1'>$text{'profs_add'}</a><br>\n"
31         if ($access{'profs'} == 1);
32
33 &ui_print_footer("", $text{"index_return"});