ID:               19520
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         LDAP related
 Operating System: Windows NT
 PHP Version:      4.2.2
 New Comment:

Yes, especially if $user_dn is non-empty. PHP returns true
only if the LDAP API's ldap_bind_s() function returns
LDAP_SUCCESS. I'm pretty sure that the API function
behaves the same, so this might be a problem with the
LDAP API implementation. Are you sure that $user_dn is
non-empty? I'm marking this as bogus since I'm pretty sure
it's not a problem in PHP.



Previous Comments:
------------------------------------------------------------------------

[2002-09-20 04:21:58] [EMAIL PROTECTED]

$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?

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=19520&edit=1

Reply via email to