
require 'mount-lib.pl';

# acl_security_form(&options)
# Output HTML for editing security options for the mount module
sub acl_security_form
{
print "<tr> <td><b>$text{'acl_fs'}</b></td>\n";
printf "<td colspan=3><input type=radio name=fs_def value=1 %s> %s\n",
	$_[0]->{'fs'} ? "" : "checked", $text{'acl_all'};
printf "<input type=radio name=fs_def value=0 %s> %s\n",
	$_[0]->{'fs'} ? "checked" : "", $text{'acl_list'};
printf "<input name=fs size=40 value='%s'></td> </tr>\n",
	$_[0]->{'fs'};

print "<tr> <td><b>$text{'acl_create'}</b></td>\n";
printf "<td><input type=radio name=create value=1 %s> %s\n",
	$_[0]->{'create'} ? "checked" : "", $text{'yes'};
printf "<input type=radio name=create value=0 %s> %s</td>\n",
	$_[0]->{'create'} ? "" : "checked", $text{'no'};

print "<td><b>$text{'acl_only'}</b></td>\n";
printf "<td><input type=radio name=only value=1 %s> %s\n",
	$_[0]->{'only'} ? "checked" : "", $text{'yes'};
printf "<input type=radio name=only value=0 %s> %s</td> </tr>\n",
	$_[0]->{'only'} ? "" : "checked", $text{'no'};
}

# acl_security_save(&options)
# Parse the form for security options for the mount module
sub acl_security_save
{
$_[0]->{'only'} = $in{'only'};
$_[0]->{'create'} = $in{'create'};
$_[0]->{'fs'} = $in{'fs_def'} ? undef : $in{'fs'};
}

