src/Connections/Ldap.php
public function bind($username, $password, $sasl = false)
    {
        if ($sasl) {
            if ($this->suppressErrors) {
                return $this->bound = @ldap_sasl_bind($this->getConnection(), null, null, 'GSSAPI');
            }

            return $this->bound = ldap_sasl_bind($this->getConnection(), null, null, 'GSSAPI');
        } else {
            if ($this->suppressErrors) {
                return $this->bound = @ldap_bind($this->getConnection(), $username, $password);
            }

            return $this->bound = ldap_bind($this->getConnection(), $username, $password);
        }
    }
public function bind($username, $password, $sasl = false)
    {
        if ($sasl) {
            if ($this->suppressErrors) {
                return $this->bound = @ldap_sasl_bind($this->getConnection(), null, null, 'GSSAPI');
            }

            return $this->bound = ldap_sasl_bind($this->getConnection(), null, null, 'GSSAPI');
        } else {
            if ($this->suppressErrors) {
                return $this->bound = @ldap_bind($this->getConnection(), $username, $password);
            }

            return $this->bound = ldap_bind($this->getConnection(), $username, $password);
        }
    }
public function bind ( $ username , $ password , $ sasl = false ) { if ( $ sasl ) { if ( $ this -> suppressErrors ) { return $ this -> bound = @ ldap_sasl_bind ( $ this -> getConnection ( ) , null , null , 'GSSAPI' ) ; } return $ this -> bound = ldap_sasl_bind ( $ this -> getConnection ( ) , null , null , 'GSSAPI' ) ; } else { if ( $ this -> suppressErrors ) { return $ this -> bound = @ ldap_bind ( $ this -> getConnection ( ) , $ username , $ password ) ; } return $ this -> bound = ldap_bind ( $ this -> getConnection ( ) , $ username , $ password ) ; } }
Binds to the current LDAP connection. If SASL
is true, we'll set up a SASL bind instead.

@param string $username
@param string $password
@param bool   $sasl

@return bool
Binds to the current LDAP connection . If SASL is true we ll set up a SASL bind instead .