Handle hostnames with upper-case letters
[webmin.git] / net / list_ipnodes.cgi
1 #!/usr/local/bin/perl
2 # list_ipnodes.cgi
3 # List ipnodes from /etc/ipnodes
4
5 require './net-lib.pl';
6 $access{'ipnodes'} || &error($text{'ipnodes_ecannot'});
7 &ui_print_header(undef, $text{'ipnodes_title'}, "");
8
9 # Build table contents
10 @table = ( );
11 foreach $h (&list_ipnodes()) {
12         push(@table, [ $access{'ipnodes'} == 2 ?
13                         ( { 'type' => 'checkbox', 'name' => 'd',
14                             'value' => $h->{'index'} },
15                           "<a href=\"edit_ipnode.cgi?idx=$h->{'index'}\">".
16                           &html_escape($h->{'address'})."</a>" ) :
17                         ( &html_escape($h->{'address'}) ),
18                        join(" , ", map { &html_escape($_) }
19                                        @{$h->{'ipnodes'}}),
20                      ]);
21         }
22
23 # Show the table
24 print &ui_form_columns_table(
25         $access{'ipnodes'} == 2 ?
26                 ( "delete_ipnodes.cgi",
27                   [ [ undef, $text{'ipnodes_delete'} ] ], 1  ) :
28                 ( undef, undef, 0 ),
29         $access{'ipnodes'} == 2 ?
30                 [ [ "edit_ipnode.cgi?new=1", $text{'ipnodes_add'} ] ] : [ ],
31         undef,
32         [ $access{'ipnodes'} == 2 ? ( "" ) : ( ),
33           $text{'ipnodes_ip'}, $text{'ipnodes_ipnode'} ],
34         undef,
35         \@table,
36         undef, 1, undef, $text{'ipnodes_none'});
37
38 &ui_print_footer("", $text{'index_return'});
39