6.0.0-beta1
7/26/25

[#764] Ldap driver does not encode the DN to charset
Summary Ldap driver does not encode the DN to charset
Queue Turba
Queue Version HEAD
Type Bug
State Resolved
Priority 2. Medium
Owners Horde Developers (at)
Requester brendan.bank (at) imap4all (dot) com
Created 11/04/2004 (7569 days ago)
Due
Updated 12/19/2004 (7524 days ago)
Assigned 11/15/2004 (7558 days ago)
Resolved 12/19/2004 (7524 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
12/19/2004 12:12:06 AM Chuck Hagenbuch Comment #4
State ⇒ Resolved
Reply to this comment
There are two solutions here: Don't use potentially internationalized 
values in making up your DN (apparently this is generally a bad idea), 
or, learn the necessary amount of LDAP internals to come up with a 
complete patch for this. Resolving this ticket.
11/18/2004 08:50:03 PM Chuck Hagenbuch Comment #3 Reply to this comment
Any idea on a working patch, or what's wrong with the one provided?
11/15/2004 04:20:27 PM Jan Schneider Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
11/12/2004 03:42:37 PM m (dot) zdila (at) episoftware (dot) com Comment #2 Reply to this comment
I use sk_SK ISO-8859-2 charset and that bug is anoying me too. The 
patch you've provided doesn't work at all - did you try to modify the 
contact after creating? It won't find it.
11/04/2004 02:22:28 PM brendan (dot) bank (at) imap4all (dot) com Comment #1
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Ldap driver does not encode the DN to charset
Queue ⇒ Turba
Reply to this comment
Hi,



When you add ldap entries to an ldap database the DN is not converted 
to the correct character set. (if charset is configured).



If a DN contains the common name (cn) cn=Cañigueral Bagóa,ou=addressbook...

This should be converted to cn=Albert Cañigueral Bagó,ou=addressbook...



The current code does not do this and I've patched the LDAP driver to do this:



===================================================================

RCS file: ./turba/lib/Driver/ldap.php,v

retrieving revision 1.1

diff -C 4 -r1.1 ./turba/lib/Driver/ldap.php

*** ./turba/lib/Driver/ldap.php 2004/11/04 13:56:38     1.1

--- ./turba/lib/Driver/ldap.php 2004/11/04 14:19:29

***************

*** 5,13 ****

    * $Horde: turba/lib/Driver/ldap.php,v 1.53 2004/09/18 22:57:32 
mdjukic Exp $

    *

    * @author  Chuck Hagenbuch <chuck@horde.org>

    * @author  Jon Parise <jon@csh.rit.edu>

!  * @version $Revision: 1.1 $

    * @since   Turba 0.0.1

    * @package Turba

    */

   class Turba_Driver_ldap extends Turba_Driver {

--- 5,13 ----

    * $Horde: turba/lib/Driver/ldap.php,v 1.53 2004/09/18 22:57:32 
mdjukic Exp $

    *

    * @author  Chuck Hagenbuch <chuck@horde.org>

    * @author  Jon Parise <jon@csh.rit.edu>

!  * @version $Revision: 1.2 $

    * @since   Turba 0.0.1

    * @package Turba

    */

   class Turba_Driver_ldap extends Turba_Driver {

***************

*** 293,300 ****

--- 293,301 ----

                           $newrdn .= $param . '=' . $attributes[$param] . ',';

                       }

                   }

                   $newrdn = substr($newrdn, 0, -1);

+                 $newrdn = String::convertCharset($newrdn, 
NLS::getCharset(), $this->_params['charset']);

               } else {

                   return PEAR::raiseError(_("Missing DN in LDAP 
source configuration."));

               }



***************

*** 366,373 ****

--- 367,375 ----

               }

           }



           $dn .= $this->_params['root'];

+         $dn = String::convertCharset($dn, NLS::getCharset(), 
$this->_params['charset']);

           return $dn;

       }



       /**


Saved Queries