Helpful Information
 
 
Category: LDAP Programming
Advanced LDAP query ...

My question: I need to lookup information from an LDAP database (duh), but access is very restricted (I have over 4 user_levels now) (access is also based on LDAP information).

I cannot change anything in the database. I just need to write some code.

What do I need?

You have a lot of information about persons in the LDAP. But you can only get information about people of the same deparment as you work in. (so: your departmentNumber HAS to be the same as the departmentNumber of the person you want information of).

Not to difficult, I hear you say. True (this code works)


$ldap_filter = 'departmentNumber=EH';

But some of us work in more than one deparment. Let's say I work in 'EH' and 'RG'. Then I am allowed to search information about people who work in 'EH' or in 'RG'.

What query ($ldap_filter), do I need for that? I can't find to seem a solution for:
departmentNumber='EH' OR 'RG'

thx in advance,
musti

$ldap_filter = '(|(departmentNumber=EH)(departmentNumber=RG))';


that should work

here is an RFC on search filters for ldap http://www.rfc-editor.org/rfc/rfc2254.txt

also for some resourse go here http://forums.devshed.com/t63488/s.html










privacy (GDPR)