Handle hostnames with upper-case letters
[webmin.git] / fetchmail / acl_security.pl
1
2 require 'fetchmail-lib.pl';
3
4 # acl_security_form(&options)
5 # Output HTML for editing security options for the fetchmail module
6 sub acl_security_form
7 {
8 print "<tr> <td valign=top><b>$text{'acl_users'}</b></td> <td colspan=3>\n";
9 printf "<input type=radio name=mode value=0 %s> $text{'acl_all'}<br>\n",
10         $_[0]->{'mode'} == 0 ? "checked" : "";
11 printf "<input type=radio name=mode value=3 %s> $text{'acl_this'}<br>\n",
12         $_[0]->{'mode'} == 3 ? "checked" : "";
13 printf "<input type=radio name=mode value=1 %s> $text{'acl_only'}\n",
14         $_[0]->{'mode'} == 1 ? "checked" : "";
15 printf "<input name=userscan size=40 value='%s'> %s<br>\n",
16         $_[0]->{'mode'} == 1 ? $_[0]->{'users'} : "",
17         &user_chooser_button("userscan", 1);
18 printf "<input type=radio name=mode value=2 %s> $text{'acl_except'}\n",
19         $_[0]->{'mode'} == 2 ? "checked" : "";
20 printf "<input name=userscannot size=40 value='%s'> %s</td> </tr>\n",
21         $_[0]->{'mode'} == 2 ? $_[0]->{'users'} : "",
22         &user_chooser_button("userscannot", 1);
23
24 print "<tr> <td valign=top><b>$text{'acl_cron'}</b></td> <td>\n";
25 print &ui_radio("cron", $_[0]->{'cron'},
26                 [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]),"</td>\n";
27
28 print "<td valign=top><b>$text{'acl_daemon'}</b></td> <td>\n";
29 print &ui_radio("daemon", $_[0]->{'daemon'},
30                 [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]),"</td> </tr>\n";
31 }
32
33 # acl_security_save(&options)
34 # Parse the form for security options for the fetchmail module
35 sub acl_security_save
36 {
37 $_[0]->{'mode'} = $in{'mode'};
38 $_[0]->{'users'} = $in{'mode'} == 0 || $in{'mode'} == 3 ? "" :
39                    $in{'mode'} == 1 ? $in{'userscan'}
40                                     : $in{'userscannot'};
41 $_[0]->{'cron'} = $in{'cron'};
42 $_[0]->{'daemon'} = $in{'daemon'};
43
44 }
45