I turned on error reporting and don't get any errors. I was able to add some additional tests to the script and when doing so it always returns "null" and does not determine what group the users is in. Here is the new code I am using... any help would be appreciated.
<?php
ini_set('display_errors', 1);
error_reporting (E_ALL);
$arguments = getopt("u");
echo grouptestfull($arguments['u']);
function grouptestfull($user)
{
require_once(dirname(__FILE__) . '/adLDAP.php');
$adldap = new adLDAP();
try {
$ldap_db = new adLDAP();
}
catch (adLDAPException $e)
{
echo $e; exit();
}
// clear the flags
$validhr = false;
$validinf = false;
$validroot = false;
//check group
if(($ldap_db->user_ingroup($user,"SD.HR", true)))
{
echo "\nvalidhr\n";
$validhr = true;
}
if(($ldap_db->user_ingroup($user,"SD.INF", true)))
{
echo "\nvalidinf\n";
$validinf = true;
}
if(($ldap_db->user_ingroup($user,"SD.ROOT", true)))
{
echo "\nvalidroot\n";
$validroot = true;
}
//sort and return highest lvl group membership
if ($validroot)
{
return "validroot";
echo "validroot"; //for testing only
}
else
{
echo "GOT HERE1"; //for testing only
if ($validinf)
{
return "validinf";
echo "validinf"; //for testing only
}
else
{
if ($validhr)
{
;
return "validhr";
echo "Validhr"; //for testing only
}
else
{
echo "null"; //for testing only
return "";
}
}
}
}
echo "GOT HERE2"; //for testing only
?>