src/Classes/AdldapUsers.php
public function find($username, $fields = [])
    {
        $this->adldap->utilities()->validateNotNullOrEmpty('Username', $username);

        $personCategory = $this->adldap->getPersonFilter('category');
        $person = $this->adldap->getPersonFilter('person');

        return $this->adldap->search()
            ->select($fields)
            ->where($personCategory, '=', $person)
            ->where('samaccounttype', '=', Adldap::ADLDAP_NORMAL_ACCOUNT)
            ->where('anr', '=', $username)
            ->first();
    }
public function find($username, $fields = [])
    {
        $this->adldap->utilities()->validateNotNullOrEmpty('Username', $username);

        $personCategory = $this->adldap->getPersonFilter('category');
        $person = $this->adldap->getPersonFilter('person');

        return $this->adldap->search()
            ->select($fields)
            ->where($personCategory, '=', $person)
            ->where('samaccounttype', '=', Adldap::ADLDAP_NORMAL_ACCOUNT)
            ->where('anr', '=', $username)
            ->first();
    }
public function find ( $ username , $ fields = [ ] ) { $ this -> adldap -> utilities ( ) -> validateNotNullOrEmpty ( 'Username' , $ username ) ; $ personCategory = $ this -> adldap -> getPersonFilter ( 'category' ) ; $ person = $ this -> adldap -> getPersonFilter ( 'person' ) ; return $ this -> adldap -> search ( ) -> select ( $ fields ) -> where ( $ personCategory , '=' , $ person ) -> where ( 'samaccounttype' , '=' , Adldap :: ADLDAP_NORMAL_ACCOUNT ) -> where ( 'anr' , '=' , $ username ) -> first ( ) ; }
Finds a user with the specified username
in the connection connection.

The username parameter can be any attribute on the user.
Such as a their name, their logon, their mail, etc.

@param string $username
@param array  $fields

@return array|bool
Finds a user with the specified username in the connection connection .