<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Ldap driver doesn&#039;t convert to lower case index attributes</title> 
  <pubDate>Fri, 10 Apr 2026 15:44:31 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/7770</link> 
  <atom:link rel="self" type="application/rss+xml" title="Ldap driver doesn&#039;t convert to lower case index attributes" href="https://bugs.horde.org/ticket/7770/rss" /> 
  <description>Ldap driver doesn&#039;t convert to lower case index attributes</description> 
 
   
   
  <item> 
   <title>Hello,

I use Sork Vacation with Ldap and my problem was tha</title> 
   <description>Hello,

I use Sork Vacation with Ldap and my problem was that Sork Vacation didn&#039;t get the vacation status and vacation message from ldap. The ldap query was performed ok but the result comparison always was false because vacationActive != vacationactive



ldap_get_entries returns a complete result information in a multi-dimensional array and the attribute index is converted to lowercase (Attributes are case-insensitive for directory servers, but not when used as array indices.) 

The problem is that ldap_get_attributes() doesn&#039;t have this behaveour and attribute idexes are not converted to lower case. To convert to lower case we can use the function array_change_key_case().



I see in the code in ldap.php on line 342  

$messageAttr = String::lower($this-&gt;_params[$realm][&#039;vacation&#039;]); 

and on line 347 

$vacationAttr = String::lower($this-&gt;_params[$realm][&#039;active&#039;]);

So though in vacation3/conf.php i defined:

$conf[&#039;server&#039;][&#039;params&#039;][&#039;default&#039;][&#039;vacation&#039;] = &#039;vacationInfo&#039;;

$conf[&#039;server&#039;][&#039;params&#039;][&#039;default&#039;][&#039;active&#039;] = &#039;vacationActive&#039;;

they get converted to lower case and the comparisons 

        if (isset($retAttrs[$messageAttr]))

and

        if (isset($retAttrs[$vacationAttr]))

are always false because $retAttrs[$messageAttr] has the value vacationInfo and $retAttrs[$vacationAttr] has the value vacationActive. Those values have been obtained with ldap_get_attributes and they were&#039;n converted to lower case.



The patch i did is below pasted, and for me at the moment is working flawlessly:



332c332

&lt;         $retAttrs = ldap_get_attributes($this-&gt;_ds, $entry);

---

&gt;         $retAttrs = array_change_key_case(ldap_get_attributes($this-&gt;_ds, $entry));

</description> 
   <pubDate>Thu, 11 Dec 2008 09:23:33 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7770#t51193</link> 
  </item> 
   
  <item> 
   <title>Can you please try a recent snapshot or CVS checkout? I reme</title> 
   <description>Can you please try a recent snapshot or CVS checkout? I remember fixing such an issue, but I don&#039;t recall which Sork application it was.</description> 
   <pubDate>Fri, 12 Dec 2008 18:11:57 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7770#t51217</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
