2 require 'majordomo-lib.pl';
4 # acl_security_form(&options)
5 # Output HTML for editing security options for the majordomo module
8 local $conf = &get_config();
9 local @lists = &list_lists($conf);
10 print "<tr> <td valign=top rowspan=3><b>$text{'acl_lists'}</b></td>\n";
11 print "<td rowspan=3 valign=top>\n";
12 printf "<input type=radio name=lists_def value=1 %s> %s\n",
13 $_[0]->{'lists'} eq '*' ? 'checked' : '', $text{'acl_lall'};
14 printf "<input type=radio name=lists_def value=0 %s> %s<br>\n",
15 $_[0]->{'lists'} eq '*' ? '' : 'checked', $text{'acl_lsel'};
16 print "<select name=lists multiple size=3 width=150>\n";
18 map { $lcan{$_}++ } split(/\s+/, $_[0]->{'lists'});
20 printf "<option %s>%s\n",
21 $lcan{$l} ? "selected" : "", $l;
23 print "</select></td>\n";
25 print "<td><b>$text{'acl_global'}</b></td> <td>\n";
26 printf "<input type=radio name=global value=1 %s> $text{'yes'}\n",
27 $_[0]->{'global'} ? "checked" : "";
28 printf "<input type=radio name=global value=0 %s> $text{'no'}</td> </tr>\n",
29 $_[0]->{'global'} ? "" : "checked";
31 print "<tr> <td><b>$text{'acl_create'}</b></td> <td>\n";
32 printf "<input type=radio name=create value=1 %s> $text{'yes'}\n",
33 $_[0]->{'create'} ? "checked" : "";
34 printf "<input type=radio name=create value=0 %s> $text{'no'}</td> </tr>\n",
35 $_[0]->{'create'} ? "" : "checked";
37 print "<tr> <td><b>$text{'acl_edit'}</b></td> <td>\n";
38 printf "<input type=radio name=edit value=1 %s> $text{'yes'}\n",
39 $_[0]->{'edit'} ? "checked" : "";
40 printf "<input type=radio name=edit value=0 %s> $text{'no'}</td> </tr>\n",
41 $_[0]->{'edit'} ? "" : "checked";
44 # acl_security_save(&options)
45 # Parse the form for security options for the majordomo module
48 if ($in{'lists_def'}) {
49 $_[0]->{'lists'} = "*";
52 $_[0]->{'lists'} = join(" ", split(/\0/, $in{'lists'}));
54 $_[0]->{'global'} = $in{'global'};
55 $_[0]->{'create'} = $in{'create'};
56 $_[0]->{'edit'} = $in{'edit'};