[horde] _username_hook_frombackend not used by Horde, only by IMP

Oscar Retana oscar at gridshield.net
Sat Feb 5 18:58:42 PST 2005


Thanks a lot Edwin! I will try it.

- Oscar.

Edwin L. Culp wrote:
> Quoting Jan Schneider <jan at horde.org>:
> 
>> Zitat von Oscar Retana <oscar at gridshield.net>:
>>
>>> Hallo Jan.
>>>
>>> I use '_username_hook_frombackend' for modifying the username (add
>>> virtual domain part). But,
>>> according to what you say, I should use the
>>> '_horde_hook_preauthenticate' to change the username used by Horde
>>> authentication.
>>>
>>> The problem is that, according to the example included in hooks.php, the
>>> return value for is function seems to be a boolean value. If I return
>>> the modifyed username (as in '_username_hook_frombackend') will that
>>> value be used at all?
>>
>>
>> True. Forget what I said.
> 
> 
> I was lurking and waiting for Jan's answer.  I went through this 
> sometime back
> and the only or quickest solution I found was to modify 
> framework/Auth/Auth.php
> just above the _horde_hook_preauthenticate.  One line patch attached to 
> keep
> formating.  Obviously this is not the correct solution but I'm not sure 
> that
> yet another hook is either.  This has worked fine for me, AFAIK ;)
> 
> ed
> 
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> Index: Auth.php
> ===================================================================
> RCS file: /repository/framework/Auth/Auth.php,v
> retrieving revision 1.146
> diff -u -r1.146 Auth.php
> --- Auth.php	18 Jan 2005 19:31:10 -0000	1.146
> +++ Auth.php	5 Feb 2005 19:15:10 -0000
> @@ -136,7 +136,7 @@
>          global $conf;
>  
>          $auth = false;
> -        $userId = trim($userId);
> +        $userId = trim($userId) . '@' . String::lower(preg_replace('|^mail\.|i', '', getenv('HTTP_HOST')));
>  
>          if (!empty($conf['hooks']['preauthenticate'])) {
>              include_once HORDE_BASE . '/config/hooks.php';
> 

-- 
Oscar Retana
GridShield S.A.
Protección y Monitoreo de Redes

Tel:   (506) 258-5757
Email: oscar at gridshield.net
Web:   www.gridshield.net



More information about the horde mailing list