[horde] CVS Head working, now LDAP and virtual domains
John R. Hillman
john at ridewide.com
Tue Mar 30 12:43:39 PST 2004
Cheese and rice, Ed, I didn't expect you to code it up *for* me! But, thanks
just the same. ;) I'll get a chance to try it out later tonight and I'll
let you know how it goes.
Thanks again!
J
> -----Original Message-----
> From: Edwin Culp [mailto:eculp at viviendaatualcance.com.mx]
> Sent: Tuesday, March 30, 2004 3:15 PM
> To: John R. Hillman
> Cc: horde at lists.horde.org
> Subject: RE: [horde] CVS Head working, now LDAP and virtual domains
>
> Quoting "John R. Hillman" <john at ridewide.com>:
>
> >> Personally I would use nameVirtualHost for each domain and
> >> then parse the $_SERVER['HTTP_HOST'] variable, asigning
> >> each element from the hostname. You can do it
> >> anywhere/everywhere ;-) Off hand I'm not sure where you
> >> might need it but at least in horde/config and turba/config
> >
> > Ed-
> >
> > Thanks. In our old Horde (2.2.5, I think, stable release, non-CVS
> anyway)
> > implementation, we use the vinfo hook in Imp to pull the @domain.tld
> part
> > out of HTTP_HOST and append it to the login stuff automagically.
> >
> > I'm thinking that perhaps we'll drop the automagic addition of the
> domain
> > during login (forcing users to put in their whole email address), but
> then I
> > will still need to modify the BaseDN for Prefs and Turba.
> >
> > In looking through the files, it seems to me I'll need to modify the
> > _prefs_hook_from_addr to separate the <username> from the <domain>.<tld>
> > into individual variables. Then I can concat them backtogether for the
> > username, and also use them for building up a BaseDN. Something like
> this
> > (pseudo code):
> >
> > $name = Auth::GetAuth() {
> > $username = /regex to get everything before the @/;
> > $domain = /regex to get everything after the @, but before the ./;
> > $tld = /regex to get the stuff after the ./;
> > $baseDN = 'ou=People,'.'dc='.$domain.',dc='.$tld.'o=internet";
> >
> > /...no clue where to go from here.../
> > };
> >
> John,
>
> I'm going to put this back on the list so folks can correct
> any errors that I have here. With the below, if it works,
> I haven't tested it. You could just put it at the top of
> the conf.php file or if you want put it in a seperate file
> and just include it where needed.
>
> $vdomain =
> strtolower(preg_replace('/^mail\.|^www\.|^www\.mail\./i',
> '', $_SERVER['HTTP_HOST']));
> list($domain, $tld) = explode(".", $vdomain);
> $uid = Auth::getBareAuth();
> $mail = Auth::getAuth();
> $pass=Auth::getCredential('password');
>
> In horde conf.php you will just put them in the areas needed
> such as:
>
> $conf['auth']['driver'] = 'ldap';
> $conf['auth']['params'] = array(
> 'hostspec' => 'localhost',
> 'port' => 389,
> 'basedn' => 'ou=people,dc=' . $domain . ',dc=' .
> $tld . 'o=internet',
> // 'binddn' =>
> 'cn=manager,ou=administrators,o=internet',
> // 'password' => 'secret',
> 'bind_dn' => 'mail=' . $mail . 'ou=people,dc=' .
> $domain . ',dc=' . $tld . 'o=internet',
> 'password' => $pass,
> 'uid' => 'mail',
> 'objectclass' => array(
> 'person'
> ),
> );
>
> Choose the binddn that fits your configuration as with the
> other variables.
>
> Prefs would be something like:
>
> $conf['prefs']['driver'] = 'ldap';
> $conf['prefs']['params'] = array();
> $conf['prefs']['params']['hostspec'] = 'localhost';
> $conf['prefs']['params']['port'] = '389';
> // $conf['prefs']['params']['rootdn'] =
> 'cn=manager,ou=administrators,o=internet';
> // $conf['prefs']['params']['password'] = 'secret';
> $conf['prefs']['params']['rootdn'] = 'mail=' . $mail .
> 'ou=people,dc=' . $domain . ',dc=' . $tld . 'o=internet';
> $conf['prefs']['params']['password'] = $pass;
> $conf['prefs']['params']['basedn'] = 'ou=people,dc=' .
> $domain . ',dc=' . $tld . 'o=internet';
> $conf['prefs']['params']['uid'] = 'mail';
>
> And so on and so on.
>
> Good luck,
>
> ed
>
> > I'm just picking up PHP, so I'm sure I'm behind the learning curve.
> Perhaps
> > using a custom _prefs_hook_from_addr isn't the way to go, though. I
> guess
> > the 'no clue where to go from here' section would be easier to pseudo
> code
> > in my head if I knew what variable horde was expecting me to set (and
> > return) for the Prefs stuff. After that, I'll worry about Turba. :)
> >
> > Thanks again,
> >
> > J
>
More information about the horde
mailing list