Handle hostnames with upper-case letters
[webmin.git] / useradmin / list_who.cgi
1 #!/usr/local/bin/perl
2 # list_who.cgi
3 # Display logged-in users
4
5 require './user-lib.pl';
6 $access{'logins'} || &error($text{'who_ecannot'});
7 if (&foreign_check("mailboxes")) {
8         &foreign_require("mailboxes");
9         }
10
11 &ui_print_header(undef, $text{'who_title'}, "");
12
13 # Build table of users
14 @whos = &logged_in_users();
15 @table = ( );
16 foreach $w (@whos) {
17         $tm = defined(&mailboxes::parse_mail_date) ?
18                 &mailboxes::parse_mail_date($w->{'when'}) : undef;
19         push(@table, [
20                 "<a href='list_logins.cgi?username=".&urlize($w->{'user'})."'>".
21                 &html_escape($w->{'user'})."</a>",
22                 &html_escape($w->{'tty'}),
23                 &html_escape($tm ? &make_date($tm) : $w->{'when'}),
24                 $w->{'from'} ? &html_escape($w->{'from'})
25                              : $text{'logins_local'},
26                 ]);
27         }
28
29 # Show it
30 print &ui_columns_table(
31         [ $text{'who_user'}, $text{'who_tty'}, $text{'who_when'},
32           $text{'who_from'} ],
33         100,
34         \@table,
35         undef,
36         0,
37         undef,
38         $text{'who_none'},
39         );
40
41 &ui_print_footer("", $text{'index_return'});
42