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');
8 # acl_security_form(&options)
9 # Output HTML for editing security options for the squid module
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}"};
18 print "</select></td> </tr>\n";
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);
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'};
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'};
37 # acl_security_save(&options)
38 # Parse the form for security options for the squid module
41 $_[0]->{'root'} = $in{'root'};
42 map { $sections{$_} = 1 } split(/\0/, $in{'sections'});
43 foreach $s (@accopts) {
44 $_[0]->{$s} = $sections{$s};
46 $_[0]->{'start'} = $in{'start'};
47 $_[0]->{'restart'} = $in{'restart'};