Handle hostnames with upper-case letters
[webmin.git] / rbac / list_users.cgi
1 #!/usr/local/bin/perl
2 # Show a table of all user attributes
3
4 require './rbac-lib.pl';
5 &ui_print_header(undef, $text{'users_title'}, "", "users");
6
7 $users = &list_user_attrs();
8 @canusers = grep { &can_edit_user($_) } @$users;
9 if (@canusers) {
10         print "<a href='edit_user.cgi?new=1'>$text{'users_add'}</a><br>\n";
11         print &ui_columns_start(
12                 [ $text{'users_user'},
13                   $text{'users_type'},
14                   $text{'users_role'},
15                   $text{'users_project'},
16                   $text{'users_profiles'},
17                   $text{'users_auths'} ]);
18         foreach $u (sort { $a->{'user'} cmp $b->{'user'} } @canusers) {
19                 print &ui_columns_row(
20                         [ "<a href='edit_user.cgi?idx=$u->{'index'}'>$u->{'user'}</a>",
21                           $text{'user_t'.$u->{'attr'}->{'type'}} ||
22                             $u->{'attr'}->{'type'} ||
23                             $text{'user_tnormal'},
24                           &nice_comma_list($u->{'attr'}->{'roles'}),
25                           $u->{'attr'}->{'project'},
26                           &nice_comma_list($u->{'attr'}->{'profiles'}),
27                           &nice_comma_list($u->{'attr'}->{'auths'}),
28                         ]);
29                 }
30         print &ui_columns_end();
31         }
32 else {
33         print "<b>$text{'users_none'}</b><p>\n";
34         }
35 print "<a href='edit_user.cgi?new=1'>$text{'users_add'}</a><br>\n";
36
37 &ui_print_footer("", $text{"index_return"});