|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-09-20 14:04 UTC] venaas@php.net
[2002-09-20 18:20 UTC] fmj at natas dot ch
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 21:00:01 2025 UTC |
$user_ldappassword = ""; # connect to ldap echo "<br>trying to connect to ldap..."; $ldap = ldap_connect($ldap_host); if(!$ldap) echo "<br>Can't etablish connection to ".$ldap_host; else echo "<br>Connection etablished to ".$ldap_host; # get dn (if you don't know) $bind_dn = ldap_bind($ldap); // anonymous $search_dn = ldap_search($ldap,"o=awp","uid=".$user_ldapid); $result_dn = ldap_get_entries($ldap,$search_dn); for($i=0; $i < $result_dn['count']; $i++) $user_dn = $result_dn[$i]['dn']; echo "<br>dn: ".$user_dn; # get authed $auth_bind = ldap_bind($ldap,$user_dn,$user_ldappassword); if($auth_bind) echo "<br>You are in!"; else echo "<br>You are out!"; # close connection to ldap ldap_close($ldap); _______________________________________________________ try to get non-anonymous bind with userpassword = "" (empty string), the bind returns 1 and no error! (like this: LDAP: Unable to bind to server: Inappropriate authentication in ...) that's odd, isn't it?