Handle hostnames with upper-case letters
[webmin.git] / sshd / list_hosts.cgi
1 #!/usr/local/bin/perl
2 # Display client host sections
3
4 require './sshd-lib.pl';
5 &ui_print_header(undef, $text{'hosts_title'}, "", "hosts");
6
7 $hconf = &get_client_config();
8 $i = 0;
9 foreach $h (@$hconf) {
10         if (lc($h->{'name'}) eq 'host') {
11                 push(@links, "edit_host.cgi?idx=$i");
12                 push(@icons, "images/host.gif");
13                 push(@titles, $h->{'values'}->[0] eq '*' ? "<i>$text{'hosts_all'}</i>" : &html_escape($h->{'values'}->[0]));
14                 }
15         $i++;
16         }
17 $addlink = &ui_links_row(
18         [ "<a href='edit_host.cgi?new=1'>$text{'hosts_add'}</a>" ]);
19 if (@links) {
20         print $addlink;
21         &icons_table(\@links, \@titles, \@icons);
22         }
23 else {
24         print "<b>$text{'hosts_none'}</b><p>\n";
25         }
26 print $addlink;
27
28 &ui_print_footer("", $text{'index_return'});
29