Handle hostnames with upper-case letters
[webmin.git] / shorewall / acl_security.pl
1
2 do 'shorewall-lib.pl';
3
4 # acl_security_form(&options)
5 # Output HTML for editing security options for the acl module
6 sub acl_security_form
7 {
8 print "<tr> <td><b>$text{'acl_nochange'}</b></td> <td>\n";
9 printf "<input type=radio name=nochange value=0 %s> $text{'yes'}\n",
10         $_[0]->{'nochange'} ? '' : 'checked';
11 printf "<input type=radio name=nochange value=1 %s> $text{'no'}</td>\n",
12         $_[0]->{'nochange'} ? 'checked' : '';
13
14 print "</tr>\n";
15
16 print "<tr> <td valign=top><b>$text{'acl_files'}</b></td> <td>\n";
17 print &ui_radio("files_def", $_[0]->{'files'} eq '*' ? 1 : 0,
18                 [ [ 1, $text{'acl_all'} ], [ 0, $text{'acl_sel'} ] ]),"<br>\n";
19 print &ui_select("files", [ split(/\s+/, $_[0]->{'files'}) ],
20                  [ map { [ $_, $text{$_."_title"}." ($_)" ] }
21                        @shorewall_files ], 5, 1);
22 }
23
24 # acl_security_save(&options)
25 # Parse the form for security options for the acl module
26 sub acl_security_save
27 {
28 $_[0]->{'nochange'} = $in{'nochange'};
29 $_[0]->{'files'} = $in{'files_def'} ? "*"
30                                     : join(" ", split(/\0/, $in{'files'}));
31 }
32