require './stta-lib.pl';
# STTA Rev. 1.3 Copyright (c) 2001-2002 Jesús Pérez Lorenzo  --- license GNU GPL 

# acl_security_form(&options)
# Output HTML for editing security options for the tarantella module
sub acl_security_form
{

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

# acl_security_save(&options)
# Parse the form for security options for the tarantella module
sub acl_security_save
{
$_[0]->{'global'} = $in{'global'};
$_[0]->{'addusr'} = $in{'addusr'};
$_[0]->{'delusr'} = $in{'delusr'};
$_[0]->{'addou'} = $in{'addou'};
$_[0]->{'delou'} = $in{'delou'};
$_[0]->{'addgrphosts'} = $in{'addgrphosts'};
$_[0]->{'delgrphosts'} = $in{'delgrphosts'};
$_[0]->{'addgrpapps'} = $in{'addgrpapps'};
$_[0]->{'delgrpapps'} = $in{'delgrpapps'};
$_[0]->{'addhosts'} = $in{'addhosts'};
$_[0]->{'delhosts'} = $in{'delhosts'};
$_[0]->{'alivehosts'} = $in{'alivehosts'};
$_[0]->{'addapps'} = $in{'addapps'};
$_[0]->{'delapps'} = $in{'delapps'};
$_[0]->{'addhostsuser'} = $in{'addhostsuser'};
$_[0]->{'delhostsuser'} = $in{'delhostsuser'};
$_[0]->{'adddomains'} = $in{'adddomains'};
$_[0]->{'deldomains'} = $in{'deldomains'};
$_[0]->{'passwd'} = $in{'passwd'};
$_[0]->{'passwdCache'} = $in{'passwdCache'};
$_[0]->{'stop'} = $in{'stop'};
$_[0]->{'backup'} = $in{'backup'};
$_[0]->{'replicate'} = $in{'replicate'};
$_[0]->{'sessions'} = $in{'sessions'};
$_[0]->{'monitor'} = $in{'monitor'};
$_[0]->{'supervision'} = $in{'supervision'};
$_[0]->{'admin'} = $in{'admin'};
}



