Skip to:

Re: LDAP Plugin Help


thanks for the quick reply.

Yes the IP, userid, pass is correct.

The domain string is where i may be having trouble as i am not sure wat to put in there. I have tried multiple domain strings but no success.

Have tried both TLS on/off.

I am fairly certain that the firewall is set ok.

We have other applications using the ldap server successfully, however from different servers.

I have successfully used the following code example to produce a connection and return a result from the LDAP server. maybe this can help you debug the issue?

// basic sequence with LDAP is connect, bind, search, interpret search
// result, close connection

echo "<h3>LDAP query test 2</h3>";
echo "Connecting ...";
$ds=ldap_connect(""); // must be a valid LDAP server!
echo "connect result is " . $ds . "";

if ($ds) {
echo "Binding ...";
$r=ldap_bind($ds); // this is an "anonymous" bind, typically
// read-only access
echo "Bind result is " . $r . "";

echo "Searching for (sn=S*) ...";
// Search surname entry
$sr=ldap_search($ds, "o=Lions", "sn=S*");
echo "Search result is " . $sr . "";

echo "Number of entires returned is " . ldap_count_entries($ds, $sr) . "";

echo "Getting entries ...";
$info = ldap_get_entries($ds, $sr);
echo "Data for " . $info["count"] . " items returned:";

for ($i=0; $i<$info["count"]; $i++) {
echo "dn is: " . $info[$i]["dn"] . "";
echo "first cn entry is: " . $info[$i]["cn"][0] . "";
echo "first email entry is: " . $info[$i]["mail"][0] . "<hr />";

echo "Closing connection";

} else {
echo "<h4>Unable to connect to LDAP server</h4>";

Skip to toolbar