src/Classes/AdldapUsers.php
public function all($fields = [], $sorted = true, $sortBy = 'cn', $sortByDirection = 'asc')
    {
        $personCategory = $this->adldap->getPersonFilter('category');
        $person = $this->adldap->getPersonFilter('person');

        $search = $this->adldap->search()
            ->select($fields)
            ->where($personCategory, '=', $person)
            ->where('samaccounttype', '=', Adldap::ADLDAP_NORMAL_ACCOUNT);

        if ($sorted) {
            $search->sortBy($sortBy, $sortByDirection);
        }

        return $search->get();
    }
public function all($fields = [], $sorted = true, $sortBy = 'cn', $sortByDirection = 'asc')
    {
        $personCategory = $this->adldap->getPersonFilter('category');
        $person = $this->adldap->getPersonFilter('person');

        $search = $this->adldap->search()
            ->select($fields)
            ->where($personCategory, '=', $person)
            ->where('samaccounttype', '=', Adldap::ADLDAP_NORMAL_ACCOUNT);

        if ($sorted) {
            $search->sortBy($sortBy, $sortByDirection);
        }

        return $search->get();
    }
public function all ( $ fields = [ ] , $ sorted = true , $ sortBy = 'cn' , $ sortByDirection = 'asc' ) { $ personCategory = $ this -> adldap -> getPersonFilter ( 'category' ) ; $ person = $ this -> adldap -> getPersonFilter ( 'person' ) ; $ search = $ this -> adldap -> search ( ) -> select ( $ fields ) -> where ( $ personCategory , '=' , $ person ) -> where ( 'samaccounttype' , '=' , Adldap :: ADLDAP_NORMAL_ACCOUNT ) ; if ( $ sorted ) { $ search -> sortBy ( $ sortBy , $ sortByDirection ) ; } return $ search -> get ( ) ; }
Returns all users from the current connection.

@param array  $fields
@param bool   $sorted
@param string $sortBy
@param string $sortByDirection

@return array|bool

@throws AdldapException
Returns all users from the current connection .