[sork] Re: LDAP configuration in Accounts and Passwd

Jeff Seifert seifert at everybody.org
Thu Jun 12 08:49:55 PDT 2003


Eric Rostetter <eric.rostetter at physics.utexas.edu> writes:

> Quoting Jeffrey Seifert <seifert at everybody.org>:
>
>> So my question is: should I try to mimic the LDAP support that passwd
>> has into the Accounts module, or figure out some elegant way to share
>> the code here?  Any suggestions would be appreciated.
>
> Either copy/paste it, or find a way to migrate it to Horde and then
> have passwd/accounts use the Horde code.  Which ever you think is easier/best.

Eric,

I've managed to do some work towards this goal so far.  However, I've
run into an inconsistency with the current LDAP parameters used in the
various LDAP configurations for Accounts, Password, and Horde
preferences.  In particular:

 * Horde preferences uses 'hostspec' and 'uid' for the hostname and uid
   attribute name, respectively.
 * Password uses 'host' and 'uid'.
 * Accounts uses 'host' and 'attr'.

It would be best to standardize on the names for these attributes
across the board.  In fact, I'll want to do that in order to create
shared LDAP code for the three access points.

I propose that we change the names to the Horde defaults,
a.k.a. 'hostspec' and 'uid'.  This is easy enough to do for the
Accounts module -- I'm including the patch for that below -- and
hopefully not too disruptive as I'm suspecting Accounts isn't a
critical module for many.

Password is another story.  It's using 'host' throughout all drivers.
It feels like it "should" be changed for the long term, but that may
be too disruptive.  Any sage wisdom you (or others) have on this
subject would be welcome.

Cheers,
Jeff


Index: accounts/lib/Driver/ldap.php
===================================================================
RCS file: /repository/accounts/lib/Driver/ldap.php,v
retrieving revision 1.8
diff -r1.8 ldap.php
38c38
<         $this->_params['host']       = array_key_exists('host', $params)       ? $params['host'] : 'localhost';
---
>         $this->_params['hostspec']   = array_key_exists('hostspec', $params)   ? $params['hostspec'] : 'localhost';
41c41
<         $this->_params['attr']       = array_key_exists('attr', $params)       ? $params['attr'] : 'uid';
---
>         $this->_params['uid']        = array_key_exists('uid', $params)        ? $params['uid'] : 'uid';
56c56
<         $this->_ds = ldap_connect($this->_params['host'],
---
>         $this->_ds = ldap_connect($this->_params['hostspec'],
70c70
<                         $this->_params['attr'] . '=' . $username);
---
>                         $this->_params['uid'] . '=' . $username);
95c95
<         $this->_ds = ldap_connect($this->_params['host'],
---
>         $this->_ds = ldap_connect($this->_params['hostspec'],
109c109
<                         $this->_params['attr'] . '=' . $username);
---
>                         $this->_params['uid'] . '=' . $username);
130c130
<         $this->_ds = ldap_connect($this->_params['host'],
---
>         $this->_ds = ldap_connect($this->_params['hostspec'],
144c144
<                         $this->_params['attr'] . '=' . $username);
---
>                         $this->_params['uid'] . '=' . $username);
Index: accounts/config/conf.xml
===================================================================
RCS file: /repository/accounts/config/conf.xml,v
retrieving revision 1.3
diff -r1.3 conf.xml
22c22
<    <configstring name="host" desc="ldap server/host">localhost</configstring>
---
>    <configstring name="hostspec" desc="ldap server/host">localhost</configstring>
25c25
<    <configstring name="attr" desc="ldap attribute to search on">uid</configstring>
---
>    <configstring name="uid" desc="ldap attribute to search on">uid</configstring>
36c36
<   <configmultienum name="apps" desc="Select any applications that should be linked in Nag's menu">
---
>   <configmultienum name="apps" desc="Select any applications that should be linked in the Accounts menu">


-- 
/* A programmer is a machine for turning coffee into code */



More information about the sork mailing list