#!/usr/bin/perl
# delobj.cgi
# ...  Servicios de Tarantella.

require './tarantella-lib.pl';
do "ldap-lib.pl";

&ReadParse();
&header($text{'index_delldapcache'}, "", "");
print "<hr><p>\n";
if ( $config{'is_ldapcache'} ne "true" ) { &footCacheHere; exit }
if (!$in{dn}) { &footHere; exit }

&foreign_require("proc", "proc-lib.pl");
 $dn=$in{dn};
 $grpdn=$in{grpdn};
 $lin_user=$in{lin_user};
 $lin_name=$in{lin_name};
 $NameUser=$in{NameUser};
 $objType=$in{objType};

 print "<table width=100% border>\n";
 print "<tr $tb> <td><b>$text{'titidx_delldapcache'}</b></td> </tr>\n";  
 print "<tr $cb> <td><table width=100%>\n";

 print "<p><tr><td valign=top><b>$text{'obj_origin'}</b>&nbsp;</td></tr>\n";

 print "   <tr><td valign=top>",&hlink("<b>$text{'f_obj'}</b>","fobj"),"&nbsp;</td>\n";
 print "<td valign=top><b>$NameUser  ---  $lin_user </b>&nbsp;</td></tr>\n";
print "<p><tr><td valign=top><b>$text{'obj_target'}</b>&nbsp;</td></tr>\n"; 
 
 if ( "$objType" eq  "app" ) {
       print "   <tr><td valign=top>",&hlink("<b>$text{'f_appobjname'}</b>","fappobjname"),"&nbsp;</td>\n";
  } elsif ( "$objType" eq  "grpapps" ) {
       print "   <tr><td valign=top>",&hlink("<b>$text{'f_grpappsobjname'}</b>","fgrpappsobjname"),"&nbsp;</td>\n"
  } elsif ( "$objType" eq  "host" ) {
       print "   <tr><td valign=top>",&hlink("<b>$text{'f_hostname'}</b>","fhostname"),"&nbsp;</td>\n";
  } elsif ( "$objType" eq  "grphosts" ) {
       print "   <tr><td valign=top>",&hlink("<b>$text{'f_usergrphosts'}</b>","fusergrphosts"),"&nbsp;</td>\n"
  }
 print "<td valign=top><b>$lin_name </b>&nbsp;</td></tr>\n";   

 $ldapcache_server=1;
 &connect_cache ();
 if ( &del_obj($dn) ne 0 ) { &footHere; exit };
 if ( $config{ldapcache2_server}.length gt 0 ) {
             $ldapcache_server=2;
             &connect_cache ();
             if ( &del_obj($dn) ne 0 ) { &err_replication() }
 }
 print "<tr><center><p><b>".$text{'user_delete'}."</b></tr>\n";
 print "<tr></tr>\n";
 &footHere;
 exit;

