ldap_bind issues
- From: mtuller <mituller@xxxxxxxxx>
- Date: Mon, 29 Dec 2008 12:02:55 -0800 (PST)
I have been attempting to do a bind to an LDAP server that requires
SSL. No matter what I do though, the bind fails. I have tried
everything I can think to try, but this is not working. The server
admins think the server is setup correctly, but I am beginning to
think differently. Here is the code I have:
<?php
$surname = "T";
//Connect
$connect = ldap_connect("ldaps://ldapserver.com", "636");
ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);
//Bind to the ldap directory
$bd = ldap_bind($connect,"cn=me,ou=People,o=work,c=US","password")
or die("Couldn't bind to LDAP server!");
$filter="(|(sn=$surname*))";
//Search the directory
$result = ldap_search($connect, "ou=People,o=work,c=US", $filter);
//Create result set
$entries = ldap_get_entries($connect, $result);
//Sort and print
echo "User count: " . $entries["count"] . "<br /><br /><b>Users:</
b><br />";
for ($i=0; $i < $entries["count"]; $i++)
{
echo $entries[$i]["displayname"][0]."<br />";
}
ldap_unbind($connect);
?>
.
- Follow-Ups:
- Re: ldap_bind issues
- From: Richard
- Re: ldap_bind issues
- Prev by Date: Re: asynchronous PHP
- Next by Date: identify $handles in $resource ?
- Previous by thread: Smarty syntax for require?
- Next by thread: Re: ldap_bind issues
- Index(es):
Relevant Pages
|