note 84007 added to function.ldap-bind
| From: | Devia dot Fan at gmail dot com | Date: | Mon, 23 Jun 2008 17:12:50 +0000 |
| Subject: | note 84007 added to function.ldap-bind | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-140744@lists.php.net to get a copy of this message | ||
Hi All, I just thought people should realize that the bug, or whatever change that was implemented
with slapd and Openldap for the version V3 protocol has either not been repaired, or isn;t believed
to be a bug or whatever...but still requires an implicit setting to V3 for use of the ldap_bind
function. I am using Apache 2 and PHP 5.1 with LDAP 2. The default is set to deny V2 protocol, and
even reconfiguring the slapd config file will not fix the problem.
You must still use the ldap_set_option function.
EX:
<?php
$ldapHost = "ldap://server";
$ldapPort = "port";
$ldapUser ="cn=name,dc=domain";
$ldapPswd ="password";
$ldapLink =ldap_connect($ldapHost, $ldapPort)
or die("Can't establish LDAP connection");
if (ldap_set_option($ldapLink,LDAP_OPT_PROTOCOL_VERSION,3))
{
echo "Using LDAP v3";
}else{
echo "Failed to set version to protocol 3";
}
ldap_bind($ldapLink,$ldapUser,$ldapPswd)
or die("Can't bind to server.");
?>
Thanks to Ken on below for showing the way. There was a slight code error in what he chose as his
link_id, but thats all. This code above worked nice and shinny, and demonstrates we are still
working with 2004 problems. I wish they would update this in the code above.
----
Server IP: 202.136.100.225
Probable Submitter: 69.34.35.200
----
Manual Page -- http://www.php.net/manual/en/function.ldap-bind.php
Edit -- https://master.php.net/note/edit/84007
Del: integrated -- https://master.php.net/note/delete/84007/integrated
Del: useless -- https://master.php.net/note/delete/84007/useless
Del: bad code -- https://master.php.net/note/delete/84007/bad+code
Del: spam -- https://master.php.net/note/delete/84007/spam
Del: non-english -- https://master.php.net/note/delete/84007/non-english
Del: in docs -- https://master.php.net/note/delete/84007/in+docs
Del: other reasons-- https://master.php.net/note/delete/84007
Reject -- https://master.php.net/note/reject/84007
Search -- https://master.php.net/manage/user-notes.php