Weird problem with ldap search (case)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Weird problem with ldap search (case)

HaroldAling

Dear RC devs,

I have a weird problem with searching my LDAP addressbook...

A search results in displaying 'display name' in either the result list, or
in the detail iframe???

In my main.inc.php I've defined the display name:
'name_field' => 'displayName',

Changing it to 'displayname' will result in a correct display in the
details iframe, but the names don't show up in the result list anymore...
:(



I've patched program/include/rcube_ldap.inc to be case-insensitive, but
that's a really bad way to tackle this...

Index: program/include/rcube_ldap.inc
===================================================================
--- program/include/rcube_ldap.inc      (revision 903)
+++ program/include/rcube_ldap.inc      (working copy)
@@ -428,6 +428,8 @@
     {
       if ($rec[$lf]['count'])
         $out[$rf] = $rec[$lf][0];
+      if ($rec[strtolower($lf)]['count'])
+        $out[$rf] = $rec[strtolower($lf)][0];
     }
     
     return $out;


Does anybody else have the same weird bug or is it only me???


-H-

_______________________________________________
List info: http://lists.roundcube.net/dev/
tfk
Reply | Threaded
Open this post in threaded view
|

Re: Weird problem with ldap search (case)

tfk
On 10/23/07, Harold Aling <[hidden email]> wrote:

>
> Dear RC devs,
>
> I have a weird problem with searching my LDAP addressbook...
>
> A search results in displaying 'display name' in either the result list, or
> in the detail iframe???
>
> In my main.inc.php I've defined the display name:
> 'name_field' => 'displayName',
>
> Changing it to 'displayname' will result in a correct display in the
> details iframe, but the names don't show up in the result list anymore...
> :(
>
>
>
> I've patched program/include/rcube_ldap.inc to be case-insensitive, but
> that's a really bad way to tackle this...
>
> Index: program/include/rcube_ldap.inc
> ===================================================================
> --- program/include/rcube_ldap.inc      (revision 903)
> +++ program/include/rcube_ldap.inc      (working copy)
> @@ -428,6 +428,8 @@
>      {
>        if ($rec[$lf]['count'])
>          $out[$rf] = $rec[$lf][0];
> +      if ($rec[strtolower($lf)]['count'])
> +        $out[$rf] = $rec[strtolower($lf)][0];

I'd object to so many strtolower() calls if this patch is committed. ;-)

>      }
>
>      return $out;
>
>
> Does anybody else have the same weird bug or is it only me???

I can't test this, so if anyone else with LDAP can step forward. :) It
probably helps if you tell the list which version of LDAP you got and
maybe your general setup. Someone else might just run the same.

Till
_______________________________________________
List info: http://lists.roundcube.net/dev/