[horde] Neglected _prefs_hooks

Steve Devine sd at msu.edu
Tue Nov 11 13:09:59 UTC 2008


Quoting "Andrew Morgan" <morgan at orst.edu>:

> On Mon, 10 Nov 2008, Shaun Meyer wrote:
>
>> Hi,
>>
>> I've been unable to get a pair of hooks, _prefs_hook_username()
and
>> _prefs_hook_from_addr(), to execute in Horde 3.3 / imp 4.3.
>>
>> I've gotten down to this:
>>
>> horde/config/hooks.php:
>> if (!function_exists('_prefs_hook_from_addr')) {
>>   function _prefs_hook_from_addr($user = null)
>>   {
>>       return 'iRan at nowhere.com';
>>   }
>> }
>>
>> horde/config/prefs.php:
>> $_prefs['from_addr'] = array(
>>   'value' => null,
>>   'locked' => true,
>>   'shared' => true,
>>   'type' => 'text',
>>   'hook' => true,
>>   'desc' =>  _("Your From: address:")
>> );
>>
>> Surprisingly my from address isn't being set to 'iRan at nowhere.com'
on login.
>>
>> I have a test account whose preferences are cleared with the SQL  
>> statement, "DELETE FROM horde_prefs WHERE pref_uid =  
>> '(testaccount)';" and it hasn't had any better luck with it's own  
>> from_addr.
>>
>> Why are my hooks being neglected?
>
> This looks the same as my working from_addr hook, although I have:
>
>    'value' => '',
>
> in the preference instead of "null".
>
>         Andy
> --
> Horde mailing list - Join the hunt:
http://horde.org/bounties/#horde[1]
> Frequently Asked Questions: http://horde.org/faq/[2]
> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
>
>

I am not sure what you are trying to accomplish. But for reference we
did NOT want our users to be able to change their "from" address so we  
put this in place.

 From ..horde/config/hooks.php:
if (!function_exists('_prefs_hook_from_addr')) {
  function _prefs_hook_from_addr($user = null)
{
$fromaddr = "$user at msu.edu";
return $fromaddr;
}
}
  And in

..horde/config/prefs.php
// user preferred email address for From: line
// If you lock this preference, you must specify a value or a hook for it in
// horde/config/hooks.php.
$_prefs['from_addr'] = array(
     'value' => '',
     'locked' => true,
     'shared' => true,
     'type' => 'text',
     'desc' =>  _("Your From: address:"),
         'hook' => 'true'
);




Steve Devine
Email & Storage
Academic Technical Services
Michigan State University

313 Computer Center
East Lansing, MI 48824-1042
1-517-432-7327

Links:
------
[1] http://horde.org/bounties/#horde
[2] http://horde.org/faq/




More information about the horde mailing list