# print-lib.pl
# Common functions

sub print_tta3tier
{
   local (@tta3tier) = @_;
   print "<tr><p> -------------------------</p<</tr>\n";   
   print "<tr><p>origin=".$tta3tier->{origin}." </p></tr>\n"; 
   print "<tr><p>target=".$tta3tier->{target}." </p></tr>\n";
   print "<tr><p>oudn=".$tta3tier->{oudn}." </p></tr>\n"; 
   print "<tr><p>action=".$tta3tier->{action}." </p></tr>\n"; 
   print "<tr><p>objtype=".$tta3tier->{objetype}." </p></tr>\n";
   print "<tr><p>login=".$tta3tier->{login}." </p></tr>\n";
   print "<tr><p>password=".$tta3tier->{password}." </p></tr>\n";
   print "<tr><p>title=".$tta3tier->{title}." </p></tr>\n";
   print "<tr><p>stringcmd=".$tta3tier->{stringcmd}." </p></tr>\n";
   print "<tr><p>domain=".$tta3tier->{domain}." </p></tr>\n";
   print "<tr><p>appkey1=".$tta3tier->{appkey1}." </p></tr>\n"; 
   print "<tr><p>appkey2=".$tta3tier->{appkey2}." </p></tr>\n"; 
   print "<tr><p>appkey3=".$tta3tier->{appkey3}." </p></tr>\n"; 
   print "<tr><p>appkey4=".$tta3tier->{appkey4}." </p></tr>\n"; 
   print "<tr><p>appkey5=".$tta3tier->{appkey5}." </p></tr>\n"; 
   print "<tr><p>appkey6=".$tta3tier->{appkey6}." </p></tr>\n"; 
}

sub print_emulses
{
 print DebugLog "----------- SCANED PARAMS --------------------\n";
   print DebugLog " Usuario ($userType):       $NameUser\n";
   print DebugLog " Organization:      $OuName\n";
   print DebugLog " Aplicacion:       $NameApp \n";
   print DebugLog " Grupo Aplicacion:    $NameAppGrp \n";
   print DebugLog " Host:          $NameHost \n";
   print DebugLog " Grupo Hosts:       $NameHostGrp \n";
   print DebugLog " Domain:       $NameDomain \n";
   print DebugLog "----------------------------------------------\n";
}

sub print_countses
{
   local ($lnum) = $_[0];
   print DebugLog "--$lnum  --------------------------------------\n";
   print DebugLog "descrip      =" . $objdescrip."\n";
   print DebugLog "obj         =" . $h_countsess{$_[1]}->{'obj'}."\n";
   print DebugLog "objalias    =" . $h_countsess{$_[1]}->{'objalias'}."\n";
   print DebugLog "alias       =" . $h_countsess{$_[1]}->{'alias'}."\n";
   print DebugLog "maxsess     =" . $h_countsess{$_[1]}->{'maxsess'}."\n";
   print DebugLog "objgrpalias =" . $h_countsess{$_[1]}->{'objgrpalias'}."\n";
   print DebugLog "grpalias    =" . $h_countsess{$_[1]}->{'grpalias'}."\n";
   print DebugLog "name        =" . $h_countsess{$_[1]}->{'name'}."\n";
}

sub out_params
{
   local $lnum=0;
   local $text_str="";
   print DebugLog "CONFIG ===========================================================\n";
   &checkSTTA_services("all","status",\$text_str);
   &printSTTA_config(\$text_str,"="); 
   $text_str=~s/==/=/g;
   print DebugLog "$text_str\n";
   print DebugLog "$text{'config_title'} ===================================================\n";
   $text_str="";
   &show_hash(\%config,"","\t",DebugLog);
   &printSTTA_config(\$text_str,"="); 
   print DebugLog "$text{'index_ttaproperties'} ===================================================\n";
   $text_str="";
   &show_hash(\%taprops,"","\t",DebugLog);
   print DebugLog "$text_str\n";
   print DebugLog "$text{'ttastatus_title'} ===================================================\n";
   $text_str="";
   &show_hash(\%{$sttaparams},"","\t",DebugLog);
   print DebugLog "$text_str\n";
   print DebugLog "$text{'index_ldap'} ===================================================\n";
   $text_str="";
   &show_hash(\%{$sttaparams{ldap}},"","\t",DebugLog);
   print DebugLog "HOSTS ===========================================================\n";
   $lnum=0;
   foreach $item (@ttahosts) {
          print DebugLog "$item->{ipname}  _____________________________________________\n";
          &show_hash(\%{$ttahosts[lnum]},"","\t",DebugLog);
          print DebugLog "___________________________________________________________\n";
          $lnum++;
   }
}
1;  # Return true
