Handle hostnames with upper-case letters
[webmin.git] / squid / acl_security.pl
1
2 require 'squid-lib.pl';
3 @accopts = ('portsnets', 'othercaches', 'musage', 'logging', 'copts',
4             'hprogs', 'actrl', 'admopts', 'proxyauth', 'miscopt', 'cms',
5             'rebuild', 'calamaris', 'delay', 'headeracc', 'refresh', 'cachemgr',
6             'authparam', 'iptables');
7
8 # acl_security_form(&options)
9 # Output HTML for editing security options for the squid module
10 sub acl_security_form
11 {
12 print "<tr> <td valign=top><b>$text{'acl_sections'}</b></td>\n";
13 print "<td colspan=3><select name=sections multiple size=6>\n";
14 foreach $s (@accopts) {
15         printf "<option value=%s %s>%s\n",
16                 $s, $_[0]->{$s} ? 'selected' : '', $text{"index_${s}"};
17         }
18 print "</select></td> </tr>\n";
19
20 print "<tr> <td><b>$text{'acl_root'}</b></td>\n";
21 printf "<td colspan=3><input name=root size=40 value='%s'> %s</td> </tr>\n",
22         $_[0]->{'root'}, &file_chooser_button("root", 1);
23
24 print "<tr> <td><b>$text{'acl_start'}</b></td>\n";
25 printf "<td><input type=radio name=start value=1 %s> %s\n",
26         $_[0]->{'start'} ? 'checked' : '', $text{'yes'};
27 printf "<input type=radio name=start value=0 %s> %s</td> </tr>\n",
28         $_[0]->{'start'} ? '' : 'checked', $text{'no'};
29
30 print "<tr> <td><b>$text{'acl_restart'}</b></td>\n";
31 printf "<td><input type=radio name=restart value=1 %s> %s\n",
32         $_[0]->{'restart'} ? 'checked' : '', $text{'yes'};
33 printf "<input type=radio name=restart value=0 %s> %s</td> </tr>\n",
34         $_[0]->{'restart'} ? '' : 'checked', $text{'no'};
35 }
36
37 # acl_security_save(&options)
38 # Parse the form for security options for the squid module
39 sub acl_security_save
40 {
41 $_[0]->{'root'} = $in{'root'};
42 map { $sections{$_} = 1 } split(/\0/, $in{'sections'});
43 foreach $s (@accopts) {
44         $_[0]->{$s} = $sections{$s};
45         }
46 $_[0]->{'start'} = $in{'start'};
47 $_[0]->{'restart'} = $in{'restart'};
48 }
49