php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4378 ldap_seach function does not give you an option to use either LDAP V2 or V3
Submitted: 2000-05-10 13:21 UTC Modified: 2002-10-01 15:46 UTC
From: nbrandon at hotmail dot com Assigned:
Status: Closed Package: LDAP related
PHP Version: 3.0.16 OS: Windows NT 4.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nbrandon at hotmail dot com
New email:
PHP Version: OS:

 

 [2000-05-10 13:21 UTC] nbrandon at hotmail dot com
I have got LDAP successfully working on Windows NT 4.0. When using the function ldap_search, it works fine for a filter like 'sn=brandon*'.

However, we use attributes with an underscore. When I specify a filter with an underscore liek 'corp_unique_key=4485*'. I get the following error message when loading the page;

Warning: LDAP: Unable to perform the search: Bad search filter in c:\program files\apache group\apache\htdocs\ldap\test2.php3 on line 20

The line of code is:

$sr = ldap_search($ds, $base_dn, "corp_unique_key=4485*");

I have been told that this could be a problem because the underscore is an illegal character in V3. However in V2, its perfectly legal to use.

I believe you can specify to use either version using the C libraries. (I got an email from someone to explain how the difference should look)

ldapsearch -h x5mer1 -V2 -bo=company corp_unique_key=123456
ldapsearch -h x5mer1 -V3 -bo=company corpuniquekey=123456

So, the question (or bug): How do you specify which version of the protocol you wish to use in the ldap_search funtion? 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-01 15:46 UTC] hholzgra@php.net
from http://php.net/ldap_set_option

// $ds is a valid link identifier for a directory server
if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3))
    echo "Using LDAPv3";
else
    echo "Failed to set protocol version to 3";
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC