i have amended my script from above to this:
<?
$domain = "@xxxxxx.xxxxx";
echo "Attempting to connect to Autosrv1 AD Service.....!<br>";
$conn = ldap_connect("autosrv1".domain) or die("Couldn't connect to AD!");
ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);
if($bd = ldap_bind($conn, "administrator".$domain, "adminpass")){
echo "Login successful!<br>";
}else{
echo "Login fail!";
exit;
}
ldap_set_option($conn, LDAP_OPT_REFERRALS, 0);
$username = "edwardp".$domain;
$search = ldap_search($conn, "ou=autotrailltd.local,dc=autotrail,dc=users","(uid=".$username.")") ;
$info = ldap_get_entries($conn, $search);
print_r($info);
ldap_unbind($conn);
?>
run the script is run i get this output
Attempting to connect to Autosrv1 AD Service.....!
Login successful!
Array ( [count] => 0 )
which i understand as it couldnt find any entries....which is correct because my search string will be wrong.
Where can i find an explanation as to what cn,ou,dc etc all mean. Anything i find has examples which doesnt explain where the data comes from
What i would like to do is verify the the given username and password. I think my script will find (at this point) if a user exists....sorting this part out will be a major help in my understanding of the AD structure,
Thanks in advance for any pointers or help