#!/usr/bin/perl
# mon_delact.cgi
# Delete 
# STTA Rev. 1.3 Copyright (c) 2001-2004 Jesús Pérez Lorenzo  --- license GNU GPL 
# stta: (@#) 1.31051043346- [2004_01_29_102036]

require './stta-lib.pl';
if ( ! $access{'monitor'} )   { &redirect("index.cgi"); }
if ( $config{'has_monitor'} ne "true" )  { &redirect("index.cgi"); }
&ReadParse();
if ( ! $in{aliasAct} ) { &redirect("mon_selact.cgi"); }
do "ldap-lib.pl"; 
&headerstta($text{'index_monitor_act'}, "", "monitor_act" ,undef,1,0,"$text{'headpage_right'}"."$text{'head_logout'}",undef,undef,"$text{head_below}" );
 $aliasAct=$in{aliasAct};
 $descrip=$in{descrip};
 $postform=$in{postform};
 %h_action=&list_actions();
 if ( $h_action{$aliasAct}->{'alias'} eq $aliasAct) {
      $monAlias=$h_action{$aliasAct}->{alias};
      $monName=$h_action{$aliasAct}->{name};
      $monObject=$h_action{$aliasAct}->{object};
      $monTarget=$h_action{$aliasAct}->{target};
      $monObject=$h_action{$aliasAct}->{object};
      $monCondition=$h_action{$aliasAct}->{condition};
      $monConditionValue=$h_action{$aliasAct}->{conditionValue};
      $monAction=$h_action{$aliasAct}->{action};
      $monScript=$h_action{$aliasAct}->{script};
      $monHow=$h_action{$aliasAct}->{how};
      $monWhen=$h_action{$aliasAct}->{when};
      &get_acttitles;    
 }
 print "<hr><p>\n";
 print "<SCRIPT SRC=\"global.js\">\n"; 
 print "</SCRIPT>\n"; 
 print "<SCRIPT LANGUAGE=\"JavaScript\">\n"; 
 print "<!--\n"; 
 print "/*  Strings for locales  */\n"; 
 print "var msg0=\"".$text{'msg_0'},"\";\n";
 print "var msg1=\"".$text{'msg_1'},"\";\n";
 print "var msg2=\"".$text{'msg_2'},"\";\n";
 print "var msg3=\"".$text{'msg_3'},"\";\n";
 print "var msg4=\"".$text{'msg_4'},"\";\n";
 print "var msg5=\"".$text{'msg_5'},"\";\n";
 print "var msg6=\"".$text{'msg_6'},"\";\n";
 print "var msg7=\"".$text{'msg_7'},"\";\n";
 print "var ask_confadmin=true;\n"; 
 print "\n"; 
 print "/******************************************************************\n"; 
 print "   Check_fields(obj)\n"; 
 print "*******************************************************************/\n"; 
 print "function Check_fields(obj) {\n"; 
 print "     return true;\n"; 
 print "}\n"; 
 print "//-->\n"; 
 print "</SCRIPT>\n"; 
 print "\n"; 
 print "<table width=100% border>\n";
 print "<tr $tb> <td><font color='$revtext'>";
 print "<i>$text{'titidx_monitor_delact'}:</i><b> $monAlias - $monName ";
 print " </b></font></td> </tr>\n";
 print "<tr $cb> <td><table width=100%>\n";
 print "<form METHOD=POST name=delact ACTION=\"delact.cgi\" onSubmit=\"return Check_fields(this)\">\n"; 
print "  <input TYPE=\"hidden\" NAME=\"postform\" VALUE=\"$postform\">\n";
print " <tr><td valign=top>",&hlink("<b>$text{'f_aliasact'}</b>","faliasact"),"&nbsp;</td>\n";
print "  <td valign=top><b> $aliasAct </b></td></tr>";
print "<input TYPE=\"hidden\" NAME=\"aliasAct\" VALUE=\"$aliasAct\">\n";
print " <tr><td valign=top>",&hlink("<b>$text{'f_descrip'}</b>","fdescrip"),"</td>\n";
print "  <td valign=top><b> $descrip </b></td></tr>";
print "<input TYPE=\"hidden\" NAME=\"descrip\" VALUE=\"$descrip\">\n";
print "  <tr><td valign=top>",&hlink("<b>$text{'f_mon_target'}</b>","fmon_target"),"&nbsp;</td>\n";
print "  <td valign=top><b> $t_monTarget </b></td></tr>";
print "<input TYPE=\"hidden\" NAME=\"monTarget\" VALUE=\"$monTarget\">\n";

print "  <tr><td valign=top>";
if ( $monTarget eq "user" ) {
          print &hlink("<b>$text{'f_username'}</b>","fusername");
} elsif  ( $monTarget eq "ou" ) {
          print &hlink("<b>$text{'f_userou'}</b>","fuserou");
} elsif  ( $monTarget eq "host" ) {
          print &hlink("<b>$text{'f_hostname'}</b>","fhostname");
} elsif  ( $monTarget eq "grphosts" ) {
          print &hlink("<b>$text{'f_usergrphosts'}</b>","fusergrphosts");
} elsif  ( $monTarget eq "app" ) {
          print &hlink("<b>$text{'f_appobjname'}</b>","fappobjname");
} elsif  ( $monTarget eq "grpapps" ) {
          print &hlink("<b>$text{'f_aliasgrpapps'}</b>","faliasgrpapps");
}
print "&nbsp;</td>\n";
print "  <td valign=top><b> $t_monObject </b></td></tr>";
print "<input TYPE=\"hidden\" NAME=\"t_monObject\" VALUE=\"$t_monObject\">\n";
print " <tr><td valign=top>",&hlink("<b>$text{'f_mon_condition'}</b>","fmon_condition"),"&nbsp;</td>\n";
print "  <td valign=top><b> $t_monCondition </b></td></tr>";
print "<input TYPE=\"hidden\" NAME=\"monCondition\" VALUE=\"$monCondition\">\n";
print " <td valign=top>",&hlink("<b>$text{'f_mon_condition_value'}</b>","fmon_condition_value"),"&nbsp;</td>\n";
print "  <td valign=top><b> $monConditionValue </b></td></tr>";
print "<input TYPE=\"hidden\" NAME=\"monConditionValue\" VALUE=\"$monConditionValue\">\n";
print " <tr><td valign=top>",&hlink("<b>$text{'f_mon_actions'}</b>","fmon_actions"),"&nbsp;</td>\n"; 
print "  <td valign=top><b> $t_monAction </b></td></tr>";
print "<input TYPE=\"hidden\" NAME=\"monAction\" VALUE=\"$monAction\">\n";
print "   <tr><td valign=top>",&hlink("<b>$text{'f_mon_script'}</b>","fmon_script"),"&nbsp;</td>\n";
print "  <td valign=top><b> $t_monScript </b></td></tr>";
print "<input TYPE=\"hidden\" NAME=\"monScript\" VALUE=\"$monScript\">\n";
print "   <tr><td valign=top>",&hlink("<b>$text{'f_mon_how'}</b>","fmon_how"),"&nbsp;</td>\n"; 
print "  <td valign=top><b> $t_monHow </b></td></tr>";
print "<input TYPE=\"hidden\" NAME=\"monHow\" VALUE=\"$monHow\">\n";
print "   <tr><td valign=top>",&hlink("<b>$text{'f_mon_when'}</b>","fmon_when"),"&nbsp;</td>\n"; 
print "  <td valign=top><b> $t_monWhen </b></td></tr>";
print "<input TYPE=\"hidden\" NAME=\"monWhen\" VALUE=\"$monWhen\">\n";


 print "        </td></tr>\n";
 print "        <tr><td valign=top><input TYPE=\"submit\" NAME=\"",$text{'f_sendreq'},"\" VALUE=\"",$text{'f_sendreq'},"\">\n";
 print "        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>\n";
 print "        <td valign=top><input TYPE=\"reset\" NAME=\"",$text{'f_cancelreq'},"\" VALUE=\"",$text{'f_cancelreq'},"\"></td></tr>\n";
 print "	</form>\n"; 
 print "<tr><tr></table></table><hr><p>\n"; 
 &footer($config{'back_return'},$text{'index'}); 
 do "footer.pl";
 exit;



