Handle hostnames with upper-case letters
[webmin.git] / jabber / edit_ips.cgi
1 #!/usr/local/bin/perl
2 # edit_ips.cgi
3 # Edit which addresses are allowed or denied for connection to the server
4
5 require './jabber-lib.pl';
6 &ui_print_header(undef, $text{'ips_title'}, "", "ips");
7
8 $conf = &get_jabber_config();
9 $io = &find("io", $conf);
10 @allow = &find("allow", $io);
11 @deny = &find("deny", $io);
12
13 print "<form action=save_ips.cgi>\n";
14 print "<table border width=100%>\n";
15 print "<tr $tb> <td><b>$text{'ips_header'}</b></td> </tr>\n";
16 print "<tr $cb> <td><table width=100%>\n";
17
18 print "<tr> <td><b>$text{'ips_allow'}</b></td> ",
19       "<td><b>$text{'ips_deny'}</b></td> </tr>\n";
20
21 printf "<tr> <td><input type=radio name=allow_def value=1 %s> %s\n",
22         @allow ? "" : "checked", $text{'ips_all'};
23 printf "<input type=radio name=allow_def value=0 %s> %s<br>\n",
24         @allow ? "checked" : "", $text{'ips_sel'};
25 print "<textarea name=allow rows=8 cols=30>\n";
26 foreach $a (@allow) {
27         local $ip = &find_value("ip", $a), $nm = &find_value("mask", $a);
28         if ($nm) { print "$ip/$nm\n"; }
29         else { print "$ip\n"; }
30         }
31 print "</textarea></td>\n";
32
33 printf "<td><input type=radio name=deny_def value=1 %s> %s\n",
34         @deny ? "" : "checked", $text{'ips_none'};
35 printf "<input type=radio name=deny_def value=0 %s> %s<br>\n",
36         @deny ? "checked" : "", $text{'ips_sel'};
37 print "<textarea name=deny rows=8 cols=30>\n";
38 foreach $a (@deny) {
39         local $ip = &find_value("ip", $a), $nm = &find_value("mask", $a);
40         if ($nm) { print "$ip/$nm\n"; }
41         else { print "$ip\n"; }
42         }
43 print "</textarea></td> </tr>\n";
44
45 print "</table></td></tr></table>\n";
46 print "<input type=submit value='$text{'save'}'></form>\n";
47
48 &ui_print_footer("", $text{'index_return'});
49