def members ( self , uid = "*" , objects = False ) : entries = self . search ( uid = '*' ) if objects : return self . memberObjects ( entries ) result = [ ] for entry in entries : result . append ( entry [ 1 ] ) return result
how to use python ldap to query some users
members () issues an ldap query for all users and returns a dict for each matching entry . This can be quite slow and takes roughly 3s to complete . You may optionally restrict the scope by specifying a uid which is roughly equivalent to a search ( uid = foo )
def members(self, uid="*", objects=False):
        """ members() issues an ldap query for all users, and returns a dict
            for each matching entry. This can be quite slow, and takes roughly
            3s to complete. You may optionally restrict the scope by specifying
            a uid, which is roughly equivalent to a search(uid='foo')
        """
        entries = self.search(uid='*')
        if objects:
            return self.memberObjects(entries)
        result = []
        for entry in entries:
            result.append(entry[1])
        return result