3 &foreign_require("acl", "acl-lib.pl");
5 # acl_security_form(&options)
6 # Output HTML for editing security options for the acl module
10 print "<tr> <td valign=top><b>$text{'acl_mods'}</b></td> <td>\n";
11 printf "<input type=radio name=mods_def value=1 %s> %s\n",
12 $_[0]->{'mods'} eq "*" ? "checked" : "", $text{'acl_all'};
13 printf "<input type=radio name=mods_def value=0 %s> %s<br>\n",
14 $_[0]->{'mods'} eq "*" ? "" : "checked", $text{'acl_sel'};
15 local %gotmod = map { $_, 1 } split(/\s+/, $_[0]->{'mods'});
16 print "<select name=mods multiple size=10 width=400>\n";
18 foreach $m (sort { $a->{'desc'} cmp $b->{'desc'} } &get_all_module_infos()) {
19 printf "<option value=%s %s>%s\n",
20 $m->{'dir'}, $gotmod{$m->{'dir'}} ? "selected" : "",
23 print "</select></td> </tr>\n";
26 print "<tr> <td valign=top><b>$text{'acl_users'}</b></td> <td>\n";
27 printf "<input type=radio name=users_def value=1 %s> %s\n",
28 $_[0]->{'users'} eq "*" ? "checked" : "", $text{'acl_all'};
29 printf "<input type=radio name=users_def value=0 %s> %s<br>\n",
30 $_[0]->{'users'} eq "*" ? "" : "checked", $text{'acl_sel'};
31 local %gotuser = map { $_, 1 } split(/\s+/, $_[0]->{'users'});
32 print "<select name=users multiple size=10 width=400>\n";
34 foreach $u (sort { $a->{'name'} cmp $b->{'name'} } &acl::list_users()) {
35 printf "<option value=%s %s>%s\n",
36 $u->{'name'}, $gotuser{$u->{'name'}} ? "selected" : "",
39 print "</select></td> </tr>\n";
42 print "<tr> <td><b>$text{'acl_rollback'}</b></td>\n";
43 print "<td>",&ui_radio("rollback", $_[0]->{'rollback'},
44 [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]),"</td> </tr>\n";
47 # acl_security_save(&options)
48 # Parse the form for security options for the acl module
51 $_[0]->{'mods'} = $in{'mods_def'} ? "*" : join(" ", split(/\0/, $in{'mods'}));
52 $_[0]->{'users'} = $in{'users_def'} ? "*" : join(" ", split(/\0/,$in{'users'}));
53 $_[0]->{'rollback'} = $in{'rollback'};