php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #11343 ldap_search only does a "subtree" search
Submitted: 2001-06-07 22:05 UTC Modified: 2001-06-14 16:26 UTC
From: jon at myrealmail dot net Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.5 OS: Redhat Linux 7.0
Private report: No CVE-ID: None
 [2001-06-07 22:05 UTC] jon at myrealmail dot net
Looking at ../etc/ldap/ldap.c:

/* {{{ proto int ldap_search(int link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]])
   Search LDAP tree under base_dn */
PHP_FUNCTION(ldap_search)
{
	php_ldap_do_search(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_SCOPE_SUBTREE);
}
/* }}} */

I believe we should be able to specify the search base and not have it forced to SUBTREE.

To access the SCHEMA in the directory you can do the following search with ldapsearch:

ldapsearch -h 192.168.0.1 -D cn=admin,o=company -w password -s base -b cn=schema objectclass=*

If you leave out the "-s base" you get this error:

ldap_search: No such object

Which is the same effect in PHP.

Can we add an optional parameter in the ldap_search funtion to specify the search scope:
one, base, subtree.

I'm trying to write a tool to export the schema and display it using PHP.

Any help would be appreciated.

Regards,
Jon.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-07 23:09 UTC] jon at myrealmail dot net
My bad...

I found the funtion call ldap_read...  sorry for wasting your time!

Regards,
Jon.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 20:01:29 2024 UTC