Handle hostnames with upper-case letters
[webmin.git] / webmin / edit_anon.cgi
1 #!/usr/local/bin/perl
2 # edit_anon.cgi
3 # Display anonymous access form
4
5 require './webmin-lib.pl';
6 &ui_print_header(undef, $text{'anon_title'}, "");
7 &get_miniserv_config(\%miniserv);
8
9 # Build list of users
10 print $text{'anon_desc'},"<br>\n";
11 print "<b>",$text{'anon_desc2'},"</b><p>\n";
12 foreach $a (split(/\s+/, $miniserv{'anonymous'})) {
13         if ($a =~ /^([^=]+)=(\S+)$/) {
14                 push(@anon, [ $1, $2 ]);
15                 }
16         }
17
18 # Build table data
19 $i = 0;
20 foreach my $a (@anon, [ ], [ ]) {
21         push(@table, [ &ui_textbox("url_$i", $a->[0], 40),
22                        &ui_textbox("user_$i", $a->[1], 30) ]);
23         $i++;
24         }
25
26 # Show the table
27 print &ui_form_columns_table(
28         "change_anon.cgi", 
29         [ [ undef, $text{'save'} ] ],
30         0,
31         undef,
32         undef,
33         [ $text{'anon_url'}, $text{'anon_user'} ],
34         undef,
35         \@table,
36         undef,
37         1);
38
39 &ui_print_footer("", $text{'index_return'});
40