[turba] broken ldap driver in stable ? - here is a patch for it

Feczak Szabolcs feczo at siodigit.hu
Thu Jan 29 09:04:22 PST 2004


Feczak Szabolcs wrote:

> Is it possible, that getResults function of the ldap driver is broken in
> the stable branch ?


Looks like it is. At least it does not take care of the charcter case 
(upper or lower).
So here is a patch for it.

It goes into horde/turba/lib/Driver

-------------- next part --------------
--- ldap.php.orig	Thu Jan 29 17:57:17 2004
+++ ldap.php	Thu Jan 29 17:58:51 2004
@@ -237,19 +237,20 @@
             $result = array();
 
             foreach ($fields as $field) {
+                $field_l = strtolower($field);
                 if ($field == 'dn') {
-                    $result[$field] = $entry[$field];
+                    $result[$field] = $entry[$field_l];
                 } else {
                     $result[$field] = '';
-                    if (!empty($entry[$field])) {
-                        for ($j = 0; $j < $entry[$field]['count']; $j++) {
+                    if (!empty($entry[$field_l])) {
+                        for ($j = 0; $j < $entry[$field_l]['count']; $j++) {
                             if (!empty($result[$field])) {
                                 $result[$field] .= $this->separator;
                             }
                             if ($this->encoding == 'utf8') {
-                                $result[$field] .= utf8_decode($entry[$field][$j]);
+                                $result[$field] .= utf8_decode($entry[$field_l][$j]);
                             } else {
-                                $result[$field] .= $entry[$field][$j];
+                                $result[$field] .= $entry[$field_l][$j];
                             }
                         }
                     }


More information about the turba mailing list