[imp] horde/imp+... with multidomain ldap setup

Edwin Culp eculp at viviendaatualcance.com.mx
Wed Apr 7 10:19:41 PDT 2004


Quoting Timo Boettcher <spida at gmx.net>:

> Hi Edwin,
>
>
> * Edwin Culp <eculp at viviendaatualcance.com.mx>, Wednesday, April 7, 
> 2004, 6:01:52 PM:
>
>> Quoting Timo Boettcher <spida at gmx.net>:
>
>>> Hi,
>>>
>>>  I am trying to get horde/imp+turba+passwd+sam+ingo+trean working with a
>>>  ldap multidomain-setup.
>>>  Even though ldap support generally works, it seems to be based on the
>>>  assumption that the users are $uid=$username,$basedn. But in my case
>>>  with multiple domains, I have
>>> $uid=$username,dc=somedomain1,$basedn,
>>>  where somedomain is different from user to user. Shadowspawn on
>>>  suggested to me on irc to update to head (which I did, with the same
>>>  problem), and fix it myself. However, even though I have done some
>>>  work with php/ldap, I don't seem to find my way through the code, if
>>>  if I will keep trying.
>>>  Is anybody else working on this?
>>>  Should I file a bug/feature-request on this?
>
>> I think many of use have ldap for many or most horde apps
>> and I'm sure that we all use somewhat different ldap
>> structures.  It should just be a question of configuring
>> the respective conf.php files with your information with no
>> code modification.  Do you have a specific problem where
>> you feel that code modification is necessary?
>
> For example, in turbas sources.php, a personal AddressBook in LDAP.
> About line 276 of yesterdays head turba/config/sources.php.dist.
>
> $uid = Auth::getBareAuth();
> $basedn = 'dc=example, dc=com';
> $cfgSources['personal_ldap'] = array(
>     'title' => _("My Addressbook"),
>     'type' => 'ldap',
>     'params' => array(
>         'server' => 'localhost',
>         'root' => 'ou=' . $uid . ',ou=personal_addressbook' . $basedn,
>         'bind_dn' => 'uid=' . $uid . ',ou=People,' . $basedn,
>         'bind_password' => Auth::getCredential('password'),
>
> What do I have to enter for an personal address book in
> ou=personal_addressbook,cn=$uid,dc=$domain_of_user,ou=domain,o=myserver?
> Since I have users in several domains $domain_of_user may be different
> for any user.

This is a bit more complex.  My first thoughts would be to
either:

   1. do an ldap search to dynamically determine the
      dc=domain_of_user based on the UID.
   2. Use virtual domains in apache and use the HTTP_HOST
variable.
   3  Have the user login with user at domain_of_user.

Anyone think of another way?  I use and prefer a variant of
3 for many reasons but YMMV.   For 1 you might look at the
function _prefs_hook_from_addr that has two examples of
doing something similar.

You really might want to rethink your ldap structure for
simplicity and future funcionality.

good luck,

ed




More information about the imp mailing list