2 if (!defined($services_file)) {
6 # acl_security_form(&options)
7 # Output HTML for editing security options for the acl module
10 # Work out which features can be edited and which can be read
12 if (defined($_[0]->{'edit'})) {
13 if ($_[0]->{'edit'}) {
14 @edit = @read = split(/\s+/, $_[0]->{'features'});
17 @read = split(/\s+/, $_[0]->{'features'});
21 @edit = split(/\s+/, $_[0]->{'features'});
22 @read = split(/\s+/, $_[0]->{'rfeatures'});
26 foreach $w ([ \@edit, "features", "all" ],
27 [ \@read, "rfeatures", "rall" ]) {
28 local %can = map { $_, 1 } @{$w->[0]};
29 print "<tr> <td valign=top><b>",$text{'acl_'.$w->[1]},
31 printf "<input type=radio name=$w->[2] value=1 %s> %s\n",
32 $can{"*"} ? "checked" : "", $text{'acl_all'};
33 printf "<input type=radio name=$w->[2] value=0 %s> %s<br>\n",
34 $can{"*"} ? "" : "checked", $text{'acl_sel'};
35 printf "<select name=$w->[1] multiple size=%d>\n",
37 foreach $o (@opts, 'apply', 'bootup') {
38 printf "<option value=%s %s>%s\n",
39 $o, $can{$o} ? "selected" : "",
40 $text{"acl_".$o} || $text{$o."_title"};
42 print "</select></td> </tr>\n";
46 # acl_security_save(&options)
47 # Parse the form for security options for the acl module
50 $_[0]->{'features'} = $in{'all'} ? "*" :
51 join(" ", split(/\0/, $in{'features'}));
52 $_[0]->{'rfeatures'} = $in{'rall'} ? "*" :
53 join(" ", split(/\0/, $in{'rfeatures'}));
54 delete($_[0]->{'edit'});