Handle hostnames with upper-case letters
[webmin.git] / pptp-server / list_conns.cgi
1 #!/usr/local/bin/perl
2 # list_conns.cgi
3 # List all active connections
4
5 require './pptp-server-lib.pl';
6 $access{'conns'} || &error($text{'conns_ecannot'});
7 &ui_print_header(undef, $text{'conns_title'}, "", "conns");
8
9 @conns = &list_connections();
10 if (@conns) {
11         print "$text{'conns_desc'}<p>\n";
12         print &ui_columns_start([ $text{'conns_iface'},
13                                   $text{'conns_client'},
14                                   $text{'conns_stime'},
15                                   $text{'conns_local'},
16                                   $text{'conns_remote'},
17                                   $text{'conns_user'} ]);
18         foreach $c (@conns) {
19                 local @cols;
20                 push(@cols, "<a href='disc.cgi?pid=$c->[0]'>".
21                             ($c->[3] ? "<tt>$c->[3]</tt>"
22                                      : $text{'conns_unknown'})."</a>");
23                 push(@cols, $c->[2]);
24                 push(@cols, $c->[6] || $text{'conns_unknown'});
25                 push(@cols, $c->[4] ? "<tt>$c->[4]</tt>"
26                                      : $text{'conns_unknown'});
27                 push(@cols, $c->[5] ? "<tt>$c->[5]</tt>"
28                                      : $text{'conns_unknown'});
29                 push(@cols, $c->[7] ? "<tt>$c->[7]</tt>"
30                                      : $text{'conns_unknown'});
31                 print &ui_columns_row(\@cols);
32                 }
33         print &ui_columns_end();
34         }
35 else {
36         print "<b>$text{'conns_none'}</b><p>\n";
37         }
38
39 &ui_print_footer("", $text{'index_return'});
40