[dev] preferences naming is not ldap compliant.

Atif Ghaffar aghaffar@developer.ch
Thu, 13 Dec 2001 18:27:55 +0100


Hi,

I noticed this problem too but didnt get my hands dirty with it yet.
I would try another approach.

Instead of changing all pref names (sig_first is a good enough var name, 
well atleast for a Perl guy), there should be a mechanism to map pref 
names according to backend.

Example:
$conf['prefs']['params']['map']['from_addr'] = 'fromAddr';
$conf['prefs']['params']['map']['fullname'] = 'fullName';

Lets now a pratctical example to justify this gymnastic.
$conf['prefs']['params']['map']['from_addr'] = 'mail';
$conf['prefs']['params']['map']['fullname'] = 'cn';

See from_addr maps to LDAPs mail attribute and fullname maps to cn.
We already have "cn" and "email" defined and most probably  the values 
of "from_addr" and "fullname" are a copy of those attributes.

So with this mapping, you can change "fullname" and "from_addr" with 
IMP's preference and it changes "mail" and "cn" in your LDAP directory.

Mapping of param names can be optional.
Example, look if there is a map for "paramNameX" is defined, else use 
paramNameX.

Although I would suggest for LDAP users to make a map for each 
preference param name. Example.

$conf['prefs']['params']['map']['sig_first'] = 'horde.sigFirst';
$conf['prefs']['params']['map']['sig_dashed'] = 'horde.sigDashes';



etc, etc, etc


regards.




KaalH! wrote:

> hi, 
> 
> I'm using the latest cvs version oh horde/imp/turba..... 
> I use openldap 2.x as auth/prefs backend. 
> 
> There is some trouble with the naming conventions : 
> 
> - most preferences contains underscores 
> - in kronolith, the '24hr' pref start with a number 
> 
> ldap attributes cannot contain _ or start with numbers (at least with 
> openldap2.x). 
> 
> I've patched my Prefs/ldap.php for stripping underscores from prefs names ... 
> it's really ugly :( 
>   
> I thing establish a naming convention for prefs names w/o underscores or 
> starting with numbers, compliant with other prefs backends, (something 
> like 'sigFirst' instead of 'sig_first', 'hr24' instead of '24hr' ...), is 
> needed. 
> 
> what about this ? 
> 



-- 
Atif Ghaffar