@@ -150,21 +150,28 @@ def execute(self, quals, columns):
150150 val = qual .value
151151 request = unicode_ ("(&%s(%s=%s))" ) % (
152152 request , qual .field_name , val )
153- self .ldap .search (
154- self .path , request , self .scope ,
155- attributes = list (self .field_definitions ))
156- for entry in self .ldap .response :
157- # Case insensitive lookup for the attributes
158- litem = dict ()
159- for key , value in entry ["attributes" ].items ():
160- if key .lower () in self .field_definitions :
161- pgcolname = self .field_definitions [key .lower ()].column_name
162- if pgcolname in self .array_columns :
163- value = value
164- else :
165- value = value [0 ]
166- litem [pgcolname ] = value
167- yield litem
153+ cookie = None
154+ while True :
155+ self .ldap .search (
156+ self .path , request , self .scope ,
157+ attributes = list (self .field_definitions ),
158+ paged_size = 1000 ,
159+ paged_cookie = cookie )
160+ for entry in self .ldap .response :
161+ # Case insensitive lookup for the attributes
162+ litem = dict ()
163+ for key , value in entry ["attributes" ].items ():
164+ if key .lower () in self .field_definitions :
165+ pgcolname = self .field_definitions [key .lower ()].column_name
166+ if pgcolname in self .array_columns :
167+ value = value
168+ else :
169+ value = value [0 ]
170+ litem [pgcolname ] = value
171+ yield litem
172+ cookie = self .ldap .result ['controls' ]['1.2.840.113556.1.4.319' ]['value' ]['cookie' ]
173+ if not cookie :
174+ break
168175
169176 def parse_scope (self , scope = None ):
170177 if scope in (None , "" , "one" ):
0 commit comments