[Date Prev][Date Next] [Chronological] [Thread] [Top]

PHP and ldap_search. One level only?



Hi everyone,

I'm still having a hard time figuring out how to use several ldap options...
I'm working on a PHP script and right now I need to search into an LDAP
database. The thing is I just want to search on the first level so I tried
using this right before the search function:

ldap_set_option($ds, LDAP_SCOPE_SUBTREE, 0);

But when I looked into the LDAP log file on my computer, this is what I
found:

Jul 10 11:11:05 calvinold slapd[1016]: daemon: conn=692 fd=14 connection
from IP=xxx.x.x.x:xxxx (IP=0.0.0.0:xxxxx) accepted.
Jul 10 11:11:05 calvinold slapd[1018]: conn=692 op=0 BIND
dn="DC=MYCOMPANY,DC=COM" method=128
Jul 10 11:11:05 calvinold slapd[1018]: conn=692 op=0 RESULT tag=97 err=0
text=
Jul 10 11:11:05 calvinold slapd[1019]: conn=692 op=1 SRCH base="dc=company,
dc=com" scope=2
filter="(&(uid=jon)(userPassword={MD5}7ad4109292636b7498a9f5042081becf)(ou=j
on.com))"
Jul 10 11:11:05 calvinold slapd[1019]: conn=692 op=1 SEARCH RESULT tag=101
err=0 text=
Jul 10 11:11:05 calvinold slapd[1990]: conn=692 op=2 UNBIND
Jul 10 11:11:05 calvinold slapd[1990]: conn=-1 fd=14 closed

It's quite obvious that the scope on that search is still set to "2" (there
are 2 subtrees on my ldap database), so... why didn't the change I used
work?

Can anyone please help me?

Thanks,

JON