require 'custom-lib.pl';
# acl_security_form(&options)
# Output HTML for editing security options for the custom module
sub acl_security_form
{
local $mode = $_[0]->{'cmds'} eq '*' ? 1 :
$_[0]->{'cmds'} =~ /^\!/ ? 2 : 0;
print "
| $text{'acl_cmds'} | \n";
printf " %s\n",
$mode == 1 ? 'checked' : '', $text{'acl_call'};
printf " %s\n",
$mode == 0 ? 'checked' : '', $text{'acl_csel'};
printf " %s \n",
$mode == 2 ? 'checked' : '', $text{'acl_cexcept'};
print " |
\n";
print " | $text{'acl_edit'} | \n";
printf " $text{'yes'}\n",
$_[0]->{'edit'} ? "checked" : "";
printf " $text{'no'} |
\n",
$_[0]->{'edit'} ? "" : "checked";
}
# acl_security_save(&options)
# Parse the form for security options for the custom module
sub acl_security_save
{
if ($in{'cmds_def'} == 1) {
$_[0]->{'cmds'} = "*";
}
elsif ($in{'cmds_def'} == 0) {
$_[0]->{'cmds'} = join(" ", split(/\0/, $in{'cmds'}));
}
else {
$_[0]->{'cmds'} = join(" ", "!", split(/\0/, $in{'cmds'}));
}
$_[0]->{'edit'} = $in{'edit'};
}