problems with LDAP search

Robert Marchand robert.marchand@UMontreal.CA
Fri, 09 Mar 2001 11:31:37 -0500


Hi,

     I began testing our new LDAP server and I found what seems a bug to 
me: when
searching with the LDAP pane, it seems that the attribute searched is 
always 'cn' no
no matter what I choose.

As an example, if I choose:

where the `E-Mail Address' begins with `marchanr' and start the search, the 
query
recorded by the LDAP server is:

filter=(&(mail=*)(cn=marchanr*))

I also tried 'organization' with the same result.

Watching the output of the POST request with a cgi, I saw that value of the 
'attr_type' is
not the internal name (like 'mail') but the display name (like 'E-Mail 
Address').  This is not
what ldap.search.php3 expects (at least in my version [2.2.4]).

As a test, I changed ldap.search.php3 a little and it worked:

m2001 8# diff -c ldap.search.php3.ORIG ldap.search.php3
*** ldap.search.php3.ORIG       Mon Oct  2 10:26:02 2000
--- ldap.search.php3    Fri Mar  9 10:59:02 2001
***************
*** 202,208 ****
     case 'uid':
       $str_search = 'uid';
       break;
!   case 'mail':
       $str_search = 'mail';
       break;
     case 'sn':
--- 202,208 ----
     case 'uid':
       $str_search = 'uid';
       break;
!   case "$lang->mail":
       $str_search = 'mail';
       break;
     case 'sn':

Result after the change:

filter=(&(mail=*)(mail=marchanr*))

Thanks.
-------
Robert Marchand                 tél: 343-6111 poste 5210
DGTIC-SIT                       e-mail: robert.marchand@umontreal.ca
Université de Montréal          Montréal, Canada