adLDAP and HelpSpot

2010-06-29
2013-05-20
  • Scott Thies
    Scott Thies
    2010-06-29

    I am currently trying to configure a script for a ticketing system that will authenticate against the LDAP server, it uses adLDAP and I believe my problem exists with how I am having adLDAP queries the server in trying to get the email from the associated username. All this script is supposed to do is authenticate, if it validates to then pass on the email of that username that it just authenticated to the larger script the function reports to. Below is the script that is being troublesome, I think it has to do with the user_info portion, if someone can confirm that this is correct or not that would be helpful.

    require_once("adLDAP.php");

    function BlackBoxPortal($username, $password){

    //create the AD LDAP connection
    $adldap = new adLDAP();

    //authenticate a user
    if ($adldap->authenticate($username,$password)){
    return $result=$adldap->user_info("mail");;
    }else{
    return false;
    }

    }