[horde] Default domain when using LDAP authentication
Jason Voorhees
jvoorhees1 at gmail.com
Mon Feb 2 16:00:57 UTC 2009
Hi:
On Mon, Feb 2, 2009 at 10:37 AM, Leland J. Steinke
<steinkel at ctinetworks.com> wrote:
> Jason Voorhees wrote:
>>
>> Could you give some idea about what hook or portion code is where I
>> should make modifications?
>
> Use the IMP vinfo hook. Here's ours (slightly redacted) where we pull the
> realm from the HTTP_HOST environment variable, if one is not already
> provided:
>
> if (!function_exists('_imp_hook_vinfo')) {
> function _imp_hook_vinfo($type = 'username')
> {
> $vdomain = getenv('HTTP_HOST');
> $vdomain = preg_replace('#^(webmail|horde)[0-9]*\.#i', '', $vdomain);
> $vdomain = String::lower($vdomain);
>
> if ($type == 'username') {
> if (isset($_SESSION['imp']['user'])) {
> if (strpos($_SESSION['imp']['user'], '@')) {
> return $_SESSION['imp']['user'];
> } else {
> return $_SESSION['imp']['user'] . '@' . $vdomain;
> }
> } else {
> return '';
> }
> } elseif ($type == 'vdomain') {
> return $vdomain;
> } else {
> return PEAR::raiseError('invalid type: ' . $type);
> }
> }
> }
Thanks for your reply, it's a good one. However I decided to modify
horde/login.php and complete the default domain when a username isn't
FQDN when inserted in the html form.
It worked for me
Thanks again everyone, bye :)
>
> Leland
> --
> Leland Steinke
> Network Engineer
> CTI Networks, Inc.
> --
> Horde mailing list - Join the hunt: http://horde.org/bounties/#horde
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
>
More information about the horde
mailing list