      $dn_cache=$currdn;
      # Scanning to make OU at new DN ...
      @linedn=split(/,/,$currdn);
      my $newbasedn=$currdn;
      $newbasedn=~ s/,$grp_dn,$config{ldapcache_base}$//g;
      $newbasedn=~ s/^$linedn[0],//;
      $newbasedn = $newbasedn.",".$newdn;
      my @dn_lin = split(/,/, $newbasedn);
      $dn_t = $config{ldapcache_base};
      for ( $lnum=$#dn_lin ; $lnum >= 0 ; $lnum-- ) {
           next if ( $dn_lin[$lnum] eq "" ); 
	   $dn_t=$dn_lin[$lnum].",".$dn_t;
	   my $dntarget=&sel_cache_obj($dn_t,"ou=*");
           next if (defined($dntarget)) ; 
           if ( $config{debug_code} gt 3 ) {
                print "DN to make: $dn_t <br>";
           }
           my $ou=$dn_lin[$lnum];
           $ou=~ s/^ou=//g;
           @ldapObjArr=();
           push (@ldapObjArr,'ou',$ou);
           push (@ldapObjArr,'objectclass',["top", "organizationalunit"]);
           push (@ldapObjArr,'description',"organization");
           %ldapObjHash=@ldapObjArr;
           $conncache = $ldapcacheObj->add ($dn_t,attr => [ @ldapObjArr ]);
           if ( $err = $conncache->code ) { $status_con=-1; }; 
           $dn_cache=$dn_t;
           &ldapcache_logerr("add ou $dn_t"); 
           if ($status_con ne 0 ) { return -2 };
      }
      $linedn[0]=~s/cn=//g;
      @ldapObjArr=();
      push (@ldapObjArr,'cn',$linedn[0]);
      # Loadding DN attributes & values ....
      my $cur_entry=&sel_cache_obj($currdn,"cn=*");
      next if ( !defined($cur_entry) );
      %cacheObj=&get_cache_obj($currdn,$cur_entry);
      push (@ldapObjArr,'tta3tieroudn',$cacheObj{tta3tieroudn});
      push (@ldapObjArr,'tta3tiertitle',$cacheObj{tta3tiertitle});
      push (@ldapObjArr,'tta3tierlogin',$cacheObj{tta3tierlogin});
      push (@ldapObjArr,'tta3tierpassword',$cacheObj{tta3tierpassword});
      push (@ldapObjArr,'tta3tierdomain',$cacheObj{tta3tierdomain});
      push (@ldapObjArr,'tta3tierstringcmd',$cacheObj{tta3tierstringcmd});
      push (@ldapObjArr,'tta3tierappkey1',$cacheObj{tta3tierappkey1});
      push (@ldapObjArr,'tta3tierappkey2',$cacheObj{tta3tierappkey2});
      push (@ldapObjArr,'tta3tierappkey3',$cacheObj{tta3tierappkey3});
      push (@ldapObjArr,'tta3tierappkey4',$cacheObj{tta3tierappkey4});
      push (@ldapObjArr,'tta3tierappkey5',$cacheObj{tta3tierappkey5});
      push (@ldapObjArr,'tta3tierappkey6',$cacheObj{tta3tierappkey6});
      push (@ldapObjArr,'tta3tiermaxsess',$cacheObj{tta3tiermaxsess});
      push (@ldapObjArr,'tta3tierticketstatus',$cacheObj{tta3tierticketstatus});
      push (@ldapObjArr,'tta3tierticketcounter',$cacheObj{tta3tierticketcounter});
      push (@ldapObjArr,'tta3tierendticket',$cacheObj{tta3tierendticket});
      push (@ldapObjArr,'tta3tierdoifendticket',$cacheObj{tta3tierdoifendticket});
      push (@ldapObjArr,'objectclass',["ttacacheapp"]);
      %ldapObjHash=@ldapObjArr;
      $dn_t= $currdn;
      $dn_t=~ s/,$grp_dn,$config{ldapcache_base}$//g;
      $dn_t .= ",".$newdn.",".$config{ldapcache_base};
      $dn_cache=$dn_t;
      $conncache = $ldapcacheObj->add ( $dn_t, attr => [ @ldapObjArr ] );
      if ( $err = $conncache->code ) { $status_con=-1; }; 
      &ldapcache_logerr("add obj"); 
      if ( $err eq 0 && $task eq "move" ) {
          $conncache = $ldapcacheObj->delete ($currdn );
      }
      if ( $config{debug_code} gt 3 ) {
           print "DN ($err): $dn_t <br>";
           print "_______________ <br></td></tr>";
      }
 }
