PHP LDAP search parent group
| From: | Vincent DUPONT | Date: | Fri, 03 Dec 2004 12:25:29 +0000 |
| Subject: | PHP LDAP search parent group | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-203416@lists.php.net to get a copy of this message | ||
Hi,
I need to get the LDAP groups a user is member of (memberof). The problem is that there are multiple
levels of groups, and I need to get all levels.
example
userA is member of group A B and C
group A is member of (included in) group D
If I make a simple query on the LDAP server to fetch the memberof of userA, it returns A, B and C.
I need to get also D because group A is in group D
In PHP I use the statement :
$list = ldap_search($conn, "$userdn,$basedn", "samaccountname=$name",
array('memberof')); //samaccountname is the Windows login name
I make a ldap_search() but I also tried with ldap_list() and ldap_read() without change
I used the options
ldap_set_option($conn, LDAP_OPT_REFERRALS, 0);
ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3); //active Directory on 2003 server
Is there a parameter I could add to PHP so as to get the parent groups?
What is the LDAP_OPT_REFERRALS option ???
Thank you,
Vincent