[bugs] [Bug 979] New - enhancement to horde/turba/lib/Driver/ldap.php

bugs@bugs.horde.org bugs@bugs.horde.org
Tue, 18 Jun 2002 11:31:02 -0300


http://bugs.horde.org/show_bug.cgi?id=979

*** shadow/979	Tue Jun 18 11:31:02 2002
--- shadow/979.tmp.10557	Tue Jun 18 11:31:02 2002
***************
*** 0 ****
--- 1,44 ----
+ Bug#: 979
+ Product: Horde
+ Version: other
+ Platform: PHP Code
+ OS/Version: Linux
+ Status: NEW   
+ Resolution: 
+ Severity: enhancement
+ Priority: P5
+ Component: Turba
+ Area: BUILD
+ AssignedTo: chuck@horde.org                            
+ ReportedBy: joko@netfrag.org               
+ URL: 
+ Cc: joko@netfrag.org
+ Summary: enhancement to horde/turba/lib/Driver/ldap.php
+ 
+ Hi Horde Team,
+ 
+ we discovered a bug/problem in horde/turba/lib/Driver/ldap.php. On one of our 
+ hosts, the php-function "ldap_set_option" doesn't exist. We are running "PHP 
+ Version 4.2.1" on an apache 2.0.36 via the "Apache 2.0 Filter"-API. The code 
+ stops working after a call to this (obviously missing) function, so Turba fails 
+ completely - but without any error-message. (Maybe we got the debugging/logging-
+ functionality wrong...?)
+ However - a simple "check_for_that_function" should work as it does with this 
+ snippet on our specific host:
+ 
+ --- snip ---
+         // Set the LDAP protocol version.
+         if (function_exists('ldap_set_option') && isset($this->version)) {
+             ldap_set_option($this->ds, LDAP_OPT_PROTOCOL_VERSION, $this->versio$
+         }
+ --- snip ---
+ 
+ I don't know if this is a common problem - i don't think so - but maybe it 
+ helps some people around there. I used the function "function_exists" 
+ successfully in some php-projects in the past to circumvent problematic 
+ function-calls without actually determining the php-version and having a lookup-
+ table of missing functions mapped to it. It shouldn't be too expensive either...
+ 
+ Hope this helps,
+ regards, joko.
+