Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
352 views
in Plugins by

I have given the LDAP server name and port as 3268.  But when I enabled LDAP debug, I see that ldap_connect() is still connecting to port 389

I enabled LDAP debug with the following line in ActiveDirectoryLDAPServer.php:

ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);

Q2A version: 1.8.6

1 Answer

0 votes
by
 
Best answer

This change to the ldap plugin made it work in LDAPServer.php:

-    $this->con = ldap_connect($ldap_host, qa_opt('ldap_login_port')) or die ("Could not connect to $ldap_host host.");

+    $this->con = ldap_connect($ldap_host.':'.qa_opt('ldap_login_port')) or die ("Could not connect to $ldap_host host.");

I found this in the comments section of PHP: ldap_connect - Manual.  The change is to pass one argument (host:port) instead of two (host, port).  Ideally, both methods should have worked.  Don't know why it isn't.  I'm happy this is working now and haven't dug further.

...