[imp] Change conf value after login

Jan Schneider jan at horde.org
Mon Jul 20 08:20:18 UTC 2009


Zitat von Marco <falon at csi.it>:

> Jan Schneider <jan <at> horde.org> writes:
>
>>
>> Zitat von Marco <falon <at> csi.it>:
>>
>> > Hi,
>> > I explain in particular what I would like.
>> > I need an hook that set, after login, the IMP configuration variable
>> > $conf['compose']['link_attachments'].
>> >
>> > I tried with:
>> >
>> >  if (!function_exists('_imp_hook_postlogin')) {
>> >      function _imp_hook_postlogin($actionID, $isLogin)
>> >      {
>> >         global $registry;
>> >
>> >
>> > $GLOBALS['registry']->_confCache['imp']['compose']['link_attachments'] =
>> > true;
>> >
>> >         return true;
>> >      }
>> >  }
> [...]
>> > Could you show me how to set this value?
>>
>> Setting $GLOBALS['conf'].... didn't do it?
>
> No, it didn't work. Something rewrite this setting after.
> I also tried with horde hook authenticate:
>
>  if (!function_exists('_horde_hook_postauthenticate')) {
>      function _horde_hook_postauthenticate($userID, $credential, $realm)
>      {
>
>         $GLOBALS['conf']['compose']['link_attachments'] = 1;
>         return true;
>      }
>  }
>
> ...but it don't work.

Hm, and why don't you change it directly in the conf.php? The session  
is re-generated during login, so the configuration should be loaded  
again, because it's no longer cached in the session.
This wouldn't work with the global Horde configuration, because it is  
loaded before the session is started, but it should work with IMP's  
configuration.
Other than that, the _confCache approach looks right to me.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digitale PGP-Unterschrift
URL: <http://lists.horde.org/archives/imp/attachments/20090720/69aa83af/attachment.bin>


More information about the imp mailing list