[imp] Change conf value after login

Marco falon at csi.it
Mon Jul 20 09:11:38 UTC 2009


Jan Schneider <jan <at> horde.org> writes:

[...]
> >  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.


I tried again in IMP with

 if (!function_exists('_imp_hook_postlogin')) {
     function _imp_hook_postlogin($actionID, $isLogin)
     {
        $_SESSION['_registry']['cache']['_confCache']['imp']['compose']['link_at
tachments'] = 1;
        return true;
     }
 }

but it doesn't work, I see that only the configuration file value is used.

Why I use this way? Because my horde autenticates through IMP, and IMP
authenticates through IMAP. IMAP authenticates accessing an LDAP DB with users.
I like to set a special attribute in LDAP user profile. With the hooks, I could
query LDAP searching the attribute value, and only if the result is appropriate
I set the conf parameter.

To do that, I need the function above to work at least.
Thank you very much for hints.
Regards
Marco





More information about the imp mailing list