Index: Ldap.php =================================================================== --- Ldap.php (revision 9105) +++ Ldap.php (working copy) @@ -630,8 +630,11 @@ $password = $this->_getPassword(); $moreCreds = false; } + + if ($username===null && $password===null) $bindAnonymously=true; + else $bindAnonymously=false; - if (!$username) { + if (!$bindAnonymously && !$username) { /** * @see Zend_Ldap_Exception */ @@ -641,7 +644,7 @@ /* Check to make sure the username is in DN form. */ - if (!Zend_Ldap::explodeDn($username)) { + if (!$bindAnonymously && !Zend_Ldap::explodeDn($username)) { if ($this->_options['bindRequiresDn']) { /* moreCreds stops an infinite loop if _getUsername does not * return a DN and the bind requires it @@ -685,7 +688,7 @@ if (@ldap_bind($this->_resource, $username, $password)) return $this; - $message = $username; + $message = ($bindAnonymously) ? "anonymous bind" : $username; /** * @see Zend_Ldap_Exception