[sork] Vacation with ldap status problem

Bennie van Lent b.van.lent at prompt.nl
Wed Jul 30 16:08:46 UTC 2008


Hello,

i've been setting up the vacation module (3.0.1) with Horde 3.2.1. In 
the background everything was working properly. Status was changed and 
the message i wanted was placed in my LDAP. Problem i had was that the 
status wasnt returned, always "inactive" and the message was always 
default on screen. Meaning that somewhere the right values werent 
returned. After some searching thru the driver code 
(lib/Driver/ldap.php) i found something. Perhaps i'm missing out on 
something else but here is how i resolved this.

For the info. My status attrib is vacationStatus. Message is 
vacationInfo.  Mind the capitals in it.

On line 332 attributes are aquired from the LDAP.
-- $retAttrs = ldap_get_attributes($this->_ds, $entry);
$retAttrs is an array with my attribs in it.

Array
(
     [vacationInfo] => Array
         (
             [count] => 1
             [0] => test
         )

     [0] => vacationInfo
     [vacationActive] => Array
         (
             [count] => 1
             [0] => FALSE
         )

     [1] => vacationActive
     [count] => 2
)


After this on line 342 we are getting the attribs from the config file 
and do a String::lower before it gets into $messageAttr. $messageAttr is 
now totally lowercase. This causes a problem because the array has 
attribs with caps in it and now e.g. this line:

$vacationInfo['message'] = $retAttrs[$messageAttr][0];

is looking for a attrib $messageAttr in the $retAttrs array but can 
never find it because the attribs in the array are with caps and this:

$retAttrs[$messageAttr][0]; is without caps because $messageAttr is 
converted to all lowercase.

Removing the String::lower fixes this for me. I've checked the latest 
snapshot and this is still in there. Perhaps i'm missing out on something.

-- 
Regards,

Bennie


More information about the sork mailing list