6 # acl_security_form(&options)
7 # Output HTML for editing global security options
12 # Root directory for file browser
13 print "<tr> <td><b>$text{'acl_root'}</b></td>\n";
14 printf "<td><input type=radio name=root_def value=1 %s> %s\n",
15 $o->{'root'} ? '' : 'checked', $text{'acl_home'};
16 printf "<input type=radio name=root_def value=0 %s>\n",
17 $o->{'root'} ? 'checked' : '';
18 print "<input name=root size=40 value='$o->{'root'}'> ",
19 &file_chooser_button("root", 1),"</td> </tr>\n";
21 print &ui_table_row($text{'acl_otherdirs'},
22 &ui_textarea("otherdirs", join("\n", split(/\t+/, $o->{'otherdirs'})),
26 print "<tr> <td><b>$text{'acl_nodot'}</b></td>\n";
27 print "<td>",&ui_yesno_radio("nodot", int($o->{'nodot'})),"</td> </tr>\n";
30 print "<tr> <td><b>$text{'acl_fileunix'}</b></td>\n";
31 print "<td>",&ui_opt_textbox("fileunix", $o->{'fileunix'}, 13,
32 $text{'acl_sameunix'})." ".
33 &user_chooser_button("fileunix"),"</td> </tr>\n";
35 print "<tr> <td colspan=2><hr></td> </tr>\n";
37 # Users visible in chooser
38 print "<tr> <td valign=top><b>$text{'acl_uedit'}</b></td> <td colspan=3>\n";
39 printf "<input type=radio name=uedit_mode value=0 %s> $text{'acl_uedit_all'}\n",
40 $o->{'uedit_mode'} == 0 ? "checked" : "";
41 printf "<input type=radio name=uedit_mode value=1 %s> $text{'acl_uedit_none'}<br>\n",
42 $o->{'uedit_mode'} == 1 ? "checked" : "";
43 printf "<input type=radio name=uedit_mode value=2 %s> $text{'acl_uedit_only'}\n",
44 $o->{'uedit_mode'} == 2 ? "checked" : "";
45 printf "<input name=uedit_can size=40 value='%s'> %s<br>\n",
46 $o->{'uedit_mode'} == 2 ? $o->{'uedit'} : "",
47 &user_chooser_button("uedit_can", 1);
48 printf "<input type=radio name=uedit_mode value=3 %s> $text{'acl_uedit_except'}\n",
49 $o->{'uedit_mode'} == 3 ? "checked" : "";
50 printf "<input name=uedit_cannot size=40 value='%s'> %s<br>\n",
51 $o->{'uedit_mode'} == 3 ? $o->{'uedit'} : "",
52 &user_chooser_button("uedit_cannot", 1);
53 printf "<input type=radio name=uedit_mode value=4 %s> $text{'acl_uedit_uid'}\n",
54 $o->{'uedit_mode'} == 4 ? "checked" : "";
55 printf "<input name=uedit_uid size=6 value='%s'> - \n",
56 $o->{'uedit_mode'} == 4 ? $o->{'uedit'} : "";
57 printf "<input name=uedit_uid2 size=6 value='%s'><br>\n",
58 $o->{'uedit_mode'} == 4 ? $o->{'uedit2'} : "";
59 printf "<input type=radio name=uedit_mode value=5 %s> $text{'acl_uedit_group'}\n",
60 $o->{'uedit_mode'} == 5 ? "checked" : "";
61 printf "<input name=uedit_group size=8 value='%s'> %s</td> </tr>\n",
62 $o->{'uedit_mode'} == 5 ? $dummy=getgrgid($o->{'uedit'}) : "",
63 &group_chooser_button("uedit_group", 0);
65 # Groups visible in chooser
66 print "<tr> <td valign=top><b>$text{'acl_gedit'}</b></td> <td colspan=3>\n";
67 printf "<input type=radio name=gedit_mode value=0 %s> $text{'acl_gedit_all'}\n",
68 $o->{'gedit_mode'} == 0 ? "checked" : "";
69 printf "<input type=radio name=gedit_mode value=1 %s> $text{'acl_gedit_none'}<br>\n",
70 $o->{'gedit_mode'} == 1 ? "checked" : "";
71 printf "<input type=radio name=gedit_mode value=2 %s> $text{'acl_gedit_only'}\n",
72 $o->{'gedit_mode'} == 2 ? "checked" : "";
73 printf "<input name=gedit_can size=40 value='%s'> %s<br>\n",
74 $o->{'gedit_mode'} == 2 ? $o->{'gedit'} : "",
75 &group_chooser_button("gedit_can", 1);
76 printf "<input type=radio name=gedit_mode value=3 %s> $text{'acl_gedit_except'}\n",
77 $o->{'gedit_mode'} == 3 ? "checked" : "";
78 printf "<input name=gedit_cannot size=40 value='%s'> %s<br>\n",
79 $o->{'gedit_mode'} == 3 ? $o->{'gedit'} : "",
80 &group_chooser_button("gedit_cannot", 1);
81 printf "<input type=radio name=gedit_mode value=4 %s> $text{'acl_gedit_gid'}\n",
82 $o->{'gedit_mode'} == 4 ? "checked" : "";
83 printf "<input name=gedit_gid size=6 value='%s'> -\n",
84 $o->{'gedit_mode'} == 4 ? $o->{'gedit'} : "";
85 printf "<input name=gedit_gid2 size=6 value='%s'></td> </tr>\n",
86 $o->{'gedit_mode'} == 4 ? $o->{'gedit2'} : "";
88 print "<tr> <td colspan=2><hr></td> </tr>\n";
90 # Can submit feedback?
91 print "<tr> <td><b>$text{'acl_feedback'}</b></td> <td>\n";
92 printf "<input type=radio name=feedback value=2 %s> %s\n",
93 $o->{'feedback'} == 2 ? "checked" : "", $text{'acl_feedback2'};
94 printf "<input type=radio name=feedback value=3 %s> %s\n",
95 $o->{'feedback'} == 3 ? "checked" : "", $text{'acl_feedback3'};
96 printf "<input type=radio name=feedback value=1 %s> %s\n",
97 $o->{'feedback'} == 1 ? "checked" : "", $text{'acl_feedback1'};
98 printf "<input type=radio name=feedback value=0 %s> %s</td> </tr>\n",
99 $o->{'feedback'} == 0 ? "checked" : "", $text{'acl_feedback0'};
101 # Can accept RPC calls?
102 print "<tr> <td colspan=2><hr></td> </tr>\n";
103 print "<tr> <td><b>$text{'acl_rpc'}</b></td> <td>\n";
104 printf "<input type=radio name=rpc value=1 %s> %s\n",
105 $o->{'rpc'} == 1 ? "checked" : "", $text{'acl_rpc1'};
106 if ($o->{'rpc'} == 2) {
107 printf "<input type=radio name=rpc value=2 %s> %s\n",
108 $o->{'rpc'} == 2 ? "checked" : "", $text{'acl_rpc2'};
110 printf "<input type=radio name=rpc value=0 %s> %s</td> </tr>\n",
111 $o->{'rpc'} == 0 ? "checked" : "", $text{'acl_rpc0'};
114 print "<tr> <td><b>$text{'acl_readonly'}</b></td>\n";
115 print "<td>",&ui_yesno_radio("readonly", $o->{'readonly'}),"</td> </tr>\n";
118 # acl_security_save(&options)
119 # Parse the form for global security options
120 sub acl_security_save
122 $_[0]->{'root'} = $in{'root_def'} ? undef : $in{'root'};
123 $_[0]->{'otherdirs'} = join("\t", split(/\r?\n/, $in{'otherdirs'}));
124 $_[0]->{'nodot'} = $in{'nodot'};
126 $_[0]->{'uedit_mode'} = $in{'uedit_mode'};
127 $_[0]->{'uedit'} = $in{'uedit_mode'} == 2 ? $in{'uedit_can'} :
128 $in{'uedit_mode'} == 3 ? $in{'uedit_cannot'} :
129 $in{'uedit_mode'} == 4 ? $in{'uedit_uid'} :
130 $in{'uedit_mode'} == 5 ? getgrnam($in{'uedit_group'}) : "";
131 $_[0]->{'uedit2'} = $in{'uedit_mode'} == 4 ? $in{'uedit_uid2'} : undef;
133 $_[0]->{'gedit_mode'} = $in{'gedit_mode'};
134 $_[0]->{'gedit'} = $in{'gedit_mode'} == 2 ? $in{'gedit_can'} :
135 $in{'gedit_mode'} == 3 ? $in{'gedit_cannot'} :
136 $in{'gedit_mode'} == 4 ? $in{'gedit_gid'} : "";
137 $_[0]->{'gedit2'} = $in{'gedit_mode'} == 4 ? $in{'gedit_gid2'} : undef;
138 $_[0]->{'feedback'} = $in{'feedback'};
139 $_[0]->{'rpc'} = $in{'rpc'};
140 $_[0]->{'readonly'} = $in{'readonly'};
141 $_[0]->{'fileunix'} = $in{'fileunix_def'} ? undef : $in{'fileunix'};