#1
  1. Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    25
    Rep Power
    0

    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)

    Code:
    $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:
    Code:
    departmentNumber='EH' OR 'RG'
    thx in advance,
    musti
  2. #2
  3. Psycho Canadian
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jan 2001
    Location
    Canada
    Posts
    4,846
    Rep Power
    635
    PHP Code:
    $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

IMN logo majestic logo threadwatch logo seochat tools logo