[dev] preferences naming is not ldap compliant.

kaalh@smol.org kaalh@smol.org
Fri, 14 Dec 2001 16:00:00 +0100


Surlignage Atif Ghaffar <aghaffar@developer.ch>:

well .. I made it ;)

I've put the map data in the /module/config/prefs.php.dist files , seems to be 
a better place than conf.php.

let's see an example from imp/config/prefs.php.dist:

// user signature
$_prefs['signature'] = array(
    'value' => '',
    'locked' => false,
    'shared' => true,
    'type' => 'implicit',
    'map' => array('ldap' => 'impSignature')
);

for sql backend, it's possible to do smtgh like :

// user signature
$_prefs['signature'] = array(
    'value' => '',
    'locked' => false,
    'shared' => true,
    'type' => 'implicit',
    'map' => array('sql' => 'impSignature')
);

etc ...

I also made a ldapv3 schema for imp/nag/gollem/kronolith.... with FAKE OIDs !!
I think a core team member should ask for an official enterprise number at 
IANA ( http://www.iana.org/cgi-bin/enterprise.pl )

I successfully tested this with ldap, and it _should_ also work with sql.

The 'cvs diff -u' and the schema files are available here : 
http://kaalh.smol.org/horde/


Regards

> 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
> 
> 
> -- 
> Horde Developers mailing list: http://horde.org/
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: dev-unsubscribe@lists.horde.org
> 
>