[imp] Setting LDAP server port

Rich Lafferty rich@horde.org
Sun, 29 Oct 2000 23:27:04 -0500


On Sun, Oct 29, 2000 at 04:16:58PM -0800, Richard (poboxcanada@yahoo.com) wrote:
> I'm trying to set up the contacts in IMP to talk to
> our university LDAP server, but am having a bit of a
> problem.  The error I get back is "Couldn't establish
> connection to LDAP Server."  Looking at the code, I
> see that 'ldap_connect' is failing in
> /horde/imp/ldap.search.php3.  I highly suspect that
> this is because our LDAP server does not use the
> standard 389 port, but rather it uses 1389.
> 
> I've scouted around to find out where I can set this
> value, to no avail.

It's not a setting in IMP. (I don't use the LDAP part at all. I was
surprised too. :-)

You can fix it with this patch:

------8<------ CUT HERE ------8<------
--- ldap.search.php3.NOPORTNUM  Sun Oct 29 23:22:37 2000
+++ ldap.search.php3    Sun Oct 29 23:22:59 2000
@@ -235,7 +235,7 @@
 $str_sn   = $lserver->sn;
 $str_emailattr = $lserver->emailattr;
 
-$ds = ldap_connect($str_serv);
+$ds = ldap_connect($str_serv, 1389);
 
 if ($ds) $r = ldap_bind($ds);
 else {
------8<------ CUT HERE ------8<------

which will take care of things for you. (As you can see, it was
hard-coded to use the default port number.)

This should probably be fixed, now that I think about it. :-) Chuck et
al, is this a fix-in-2.3 thing, or has it just not come up before?

(Who's Al?)

> If the test-drive goes well, we will IMPlement (couldn't resist!)

Ouch.

  -Rich


-- 
------------------------------ Rich Lafferty ---------------------------
 Sysadmin/Programmer, Instructional and Information Technology Services
   Concordia University, Montreal, QC                 (514) 848-7625
------------------------- rich@alcor.concordia.ca ----------------------