[horde] LDAP Prefs + Horde 3.0 + IMP 4.0 Prob

Kaalh! kaalh at smol.org
Wed May 22 09:20:28 PDT 2002


well ... got some new stuff ;)

I've modified the storage format, now it's using one multi-valued attribute 
per application ( hordePrefs, impPrefs, turbaPrefs ... )
$conf['prefs']['params']['field'] is no longer used

this patch assume that all shared prefs are stored in hordePrefs attribute, 
hope this is ok.

the patch (contain the 2nd version of my previous patch modified) : 
http://kaalh.smol.org/horde/ldap.php.diff

the schema diff :
http://kaalh.smol.org/horde/horde.schema.diff

now you deal with all applications preferences.

-- 
Kaalh!


Surlignage Edwin Culp <eculp at MexComUSA.Net>:

> I installed the 2nd version of the patch because on my test machine.
> I am using Spanish and I am not able save my kronolith and other
> prefs.  I had hoped that the problem was that the Spanish default
> was somehow breaking the saving of the prefs.  Unfortunately, it
> wasn't:-(  The patch works fine and does seem to be a good idea.
> Is anyone else seeing the problem with the multivalued attribute and
> getting them all written?  Has anyone found a solution/work arround?
> 
> Thanks,
> 
> ed
> 
> 
> Quoting KaalH! <kaalh at smol.org>:
> 
> | yeah, I've got a solution ! :)
> | 
> | The problem is "hordePrefs:: aW1wOnF1b3RlX3ByZWZpeDo+IA=="
> | 
> | This appends because you are not using english as default language.
> | eg: french translation default identity name is "identité par défaut"
> | 
> | the non-us caracters are the bug cause.
> | 
> | my proposition/solution is to base64_encode() the entries instead of 
> | utf8_encode() them.
> | the bad news is that preferences in the ldap tree are no more human
> | readable.
> | 
> | the patch : 
> | 
> | Index: ldap.php
> | ===================================================================
> | RCS file: /repository/horde/lib/Prefs/ldap.php,v
> | retrieving revision 1.36
> | diff -u -r1.36 ldap.php
> | --- ldap.php    20 May 2002 11:22:01 -0000      1.36
> | +++ ldap.php    22 May 2002 13:19:38 -0000
> | @@ -351,7 +351,7 @@
> |               * server.
> |               */
> |              foreach ($result[0][$field] as $prefstr) {
> | -                $prefstr = utf8_decode($prefstr);
> | +                $prefstr = base64_decode($prefstr);
> |  
> |                  /* If the string doesn't contain a colon delimeter, skip
> it.
> | 
> | */
> |                  if (substr_count($prefstr, ':') == 0) {
> | @@ -436,7 +436,7 @@
> |          foreach($prefs as $pref) {
> |              $entry = sprintf("%s:%s:%s", $this->getScope($pref), $pref,
> |                               Prefs::getValue($pref));
> | -            $new_values[$this->params['field']][] = utf8_encode($entry);
> | +            $new_values[$this->params['field']][] =
> base64_encode($entry);
> |          }
> | 
> | 
> | ##################################################################
> | 
> | another way is to base64_encode only the pref value : 
> | horde:identities:[base64'd value]
> | then the scope & pref name are still human readable in the ldap tree.
> | 
> | the patch :
> | 
> | Index: ldap.php
> | ===================================================================
> | RCS file: /repository/horde/lib/Prefs/ldap.php,v
> | retrieving revision 1.36
> | diff -u -r1.36 ldap.php
> | --- ldap.php    20 May 2002 11:22:01 -0000      1.36
> | +++ ldap.php    22 May 2002 13:30:10 -0000
> | @@ -361,6 +361,9 @@
> |                  /* Split the string into its scope:name:value
> components.
> | */
> |                  list($scope, $pref, $val) = split(':', $prefstr, 3);
> |  
> | +               /* Decode the pref value */
> | +               $pref = base64_decode($pref);
> | +
> |                  /* Only retrieve this preference if it's in our scope.
> */
> |                  if ((strcmp($scope, $this->scope) == 0) ||
> |                      (strcmp($scope, 'horde') == 0)) {
> | @@ -435,7 +438,7 @@
> |          $new_values = array();
> |          foreach($prefs as $pref) {
> |              $entry = sprintf("%s:%s:%s", $this->getScope($pref), $pref,
> | -                             Prefs::getValue($pref));
> | +                             base64_encode(Prefs::getValue($pref)));
> |              $new_values[$this->params['field']][] = utf8_encode($entry);
> |          }
> | 
> | 
> | 
> | 
> | -- 
> | KaalH!
> 
> 
> 
> -------------------------------------------------------------
>  http://insourcery.com - Mergence of Business and Technology  
>           a "Griffin Plaza Partners, LLC" Company
> 
> 
> -------------------------------------------------------------
>  http://insourcery.com - Mergence of Business and Technology  
>           a "Griffin Plaza Partners, LLC" Company
> 
> -- 
> Horde mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
> 


More information about the horde mailing list