Handle hostnames with upper-case letters
[webmin.git] / firewall / acl_security.pl
1
2 do 'firewall-lib.pl';
3 @acl_features = ("newchain", "delchain", "policy", "apply", "unapply", "bootup", "setup", "cluster");
4
5 # acl_security_form(&options)
6 # Output HTML for editing security options for the acl module
7 sub acl_security_form
8 {
9 # Show editable tables
10 print "<tr> <td valign=top><b>$text{'acl_tables'}</b></td> <td colspan=3>\n";
11 local $t;
12 foreach $t (@known_tables) {
13         printf "<input type=checkbox name=%s value=1 %s> %s<br>\n",
14                 $t, $_[0]->{$t} ? "checked" : "", $text{'index_table_'.$t};
15         }
16 print "</td> </tr>\n";
17
18 # Show allowed target types
19 print "<tr> <td><b>$text{'acl_jumps'}</b></td>\n";
20 print "<td colspan=3>",&ui_opt_textbox("jumps", $_[0]->{'jumps'}, 40,
21                                        $text{'acl_jall'}),"</td> </tr>\n";
22
23 # Show bootup/apply options
24 local ($f, $i);
25 foreach $f (@acl_features) {
26         print "<tr>\n" if ($i%2 == 0);
27         print "<td><b>",$text{'acl_'.$f},"</b></td> <td>\n";
28         printf "<input type=radio name=%s value=1 %s> %s\n",
29                 $f, $_[0]->{$f} ? "checked" : "", $text{'yes'};
30         printf "<input type=radio name=%s value=0 %s> %s</td>\n",
31                 $f, $_[0]->{$f} ? "" : "checked", $text{'no'};
32         print "</tr>\n" if ($i++%2 == 1);
33         }
34 }
35
36 # acl_security_save(&options)
37 # Parse the form for security options for the acl module
38 sub acl_security_save
39 {
40 local $t;
41 foreach $t (@known_tables) {
42         $_[0]->{$t} = $in{$t};
43         }
44 local $f;
45 foreach $f (@acl_features) {
46         $_[0]->{$f} = $in{$f};
47         }
48 $_[0]->{'jumps'} = $in{'jumps_def'} ? undef : $in{'jumps'};
49 }
50