require 'fetchmail-lib.pl';
# acl_security_form(&options)
# Output HTML for editing security options for the fetchmail module
sub acl_security_form
{
print "
$text{'acl_users'} \n";
printf " $text{'acl_all'} \n",
$_[0]->{'mode'} == 0 ? "checked" : "";
printf " $text{'acl_this'} \n",
$_[0]->{'mode'} == 3 ? "checked" : "";
printf " $text{'acl_only'}\n",
$_[0]->{'mode'} == 1 ? "checked" : "";
printf " %s \n",
$_[0]->{'mode'} == 1 ? $_[0]->{'users'} : "",
&user_chooser_button("userscan", 1);
printf " $text{'acl_except'}\n",
$_[0]->{'mode'} == 2 ? "checked" : "";
printf " %s \n",
$_[0]->{'mode'} == 2 ? $_[0]->{'users'} : "",
&user_chooser_button("userscannot", 1);
print " $text{'acl_cron'} \n";
print &ui_radio("cron", $_[0]->{'cron'},
[ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ])," \n";
print "$text{'acl_daemon'} \n";
print &ui_radio("daemon", $_[0]->{'daemon'},
[ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ])," \n";
}
# acl_security_save(&options)
# Parse the form for security options for the fetchmail module
sub acl_security_save
{
$_[0]->{'mode'} = $in{'mode'};
$_[0]->{'users'} = $in{'mode'} == 0 || $in{'mode'} == 3 ? "" :
$in{'mode'} == 1 ? $in{'userscan'}
: $in{'userscannot'};
$_[0]->{'cron'} = $in{'cron'};
$_[0]->{'daemon'} = $in{'daemon'};
}