##-----------------------------------------------------------##
## CHECK SECURITY ACCESS LEVELS.                             ##
##-----------------------------------------------------------##

sub security_check {
#print " LOGONID:",$LOGON;

$stmt = $dbh->prepare("
BEGIN genfin_dbo.pces_security.pces_security_rpt (:ldap, :actn, :seci, :secx, :user, :oby, :cursor );
END;
     ") or DBI::errstr;

$stmt->bind_param(":ldap", $LOGON);
$stmt->bind_param(":actn", 'CHK');
$stmt->bind_param(":seci", ' ');
$stmt->bind_param(":secx", ' ');
$stmt->bind_param(":oby", 'LDAP');
$stmt->bind_param(":user", $LOGON);

$stmt->bind_param_inout(":cursor", \$sth2, 0, { ora_type => ORA_RSET } );
$stmt->execute;

$i=0;
while ( @data = $sth2->fetchrow_array() ) {

$NAME   = $data[1];
$ACCESS = $data[2];
$ATITLE = $data[3];

$i++;

  }

if ($srv eq 'scordev4') {
    $SERVER  = '(TEST SYSTEM)'; 
    $BC      = $BCT;
    $C1      = $CT1;
    $C2      = $CT2;
    $C3      = $CT3;
   }
if ($srv eq 'scorprd4') { 
    $SERVER   = '(PRODUCTION)'; 
    $BC      = $BCP;
    $C1      = $CP1;
    $C2      = $CP2;
    $C3      = $CP3;
   }

return($ACCESS,$NAME,$ATITLE,$SERVER);

$stmt->finish;

##-----------------------------------------------##
##  END OF SUB-ROUTINE.         
##-----------------------------------------------##

 }

1;
