Filter happens after the directory lookup?

mahapke - September 21, 2009 - 21:01
Project:LDAP Directory
Version:6.x-0.1
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:active
Description

From looking at the code, it seems like what you're doing in the ldapdirectory_display_search is retrieving everything that matches the OU and then going through the array line by line and dropping the ones that don't match the text search. I have 12,000 users in my directory, and this was terribly inefficient for me! It would take several minutes to get an answer. (Also filter doesn't seem to get set if you don't show OU's) So what I ended up doing was sticking a filter line before the ldap lookup, like so:

$filter = '(&(fullName=*'.$search.'*) (mail=*))';
(the mail is there because I'm filtering out a bunch of accounts that I don't want to appear in the directory)

Filtering based on the text search as part of the LDAP filter really needs to be in there. I'm not sure about how to integrate that into the current OU block, because I'm using Novell as my LDAP and never did get results from using the OU container fields on the form.

 
 

Drupal is a registered trademark of Dries Buytaert.