[horde] Question about hook

Etienne Goyer etienne.goyer at linuxquebec.com
Wed Jul 23 13:33:12 PDT 2003

Hi list,

I am playing around with hooks.  I read the comment in
horde/config/hooks.php but have problem understanding the following
paragraph :

* NOTE 3: Any preference that is NOT LOCKED, that is set by a hook, WILL BE
 * SAVED WITH THAT VALUE. This means several things:
 *  1) Users will get the results of the hook set for them in their preferences. 
 *  2) By virtue of this, the next time they log in and load their preferences,
 *     the hook will NOT be called, because in their last session, we saved the
 *     results of the hook for them. However, if the preference is locked, the
 *     result of the hook will never be saved.

I am writing a hook for the from_addr (fetching the alias from LDAP).  
Considering that this value *could* change in the future, I would like
to check it on each logon.  If I am reading the previous paragraph
correctly, if I lock this pref it should not be saved,  thus (as I
understand it) the hook will be called at each login.  Is that right or
wrong ?

If I am right, it don't work.  In horde/config/prefs.php, I edited the
from_addr section as such :

// user preferred email address for From: line
$_prefs['from_addr'] = array(
    'value' => '',
    'locked' => true,
    'shared' => true,
    'type' => 'implicit',
    'hook' => true);

Yet, from_addr is saved in the prefs and the hook is not called on
further login.

Is there something I miss here ?  Thanks very much for you answers.

Etienne Goyer                    Linux Québec Technologies Inc.
http://www.LinuxQuebec.com       etienne.goyer at linuxquebec.com

More information about the horde mailing list