[imp] _prefs_hook_fullname
Jan Schneider
jan at horde.org
Wed Aug 9 09:12:56 PDT 2006
Zitat von Otto Stolz <Otto.Stolz at uni-konstanz.de>:
> Hello,
>
> since I have not yet received an answer on my general question
> about programming Hook functions, I have tried my luck with a
> simple (as I had hoped) example.
>
> I am using Horde 3.1.2 and Imp H3 4.1.2. Configuration details
> are appended, below.
>
> I am trying to supply a sensible user name for the From headers
> in outgoing mail, so I have adapted to our LDAP server the
> 2nd example for _prefs_hook_fullname from horde/config/hooks.php.
> And I have modified the pertinent entry in horde/config/prefs.php
> to read:
>> $_prefs['fullname'] = array(
>> 'value' => '',
>> 'hook' => true,
>> 'locked' => true,
>> 'shared' => true,
>> 'type' => 'text',
>> 'desc' => _("Your full name:")
>> );
>
> Result: nothing; outgoing mail still has the header line:
>> From: pop15959 at uni-konstanz.de
>
> So, I put some debugging code into _prefs_hook_fullname.
>
> Results:
> - _prefs_hook_fullname is invoked only during
> Horde login, not during the subsequent Imp login.
> - prefs_hook_fullname is invoked without an argument,
> the $imp array is NULL,
> and any and all of the following function calls yield NULL:
> · Auth::getAuth()
> · Auth::getCredential('user_name')
> · Auth::getCredential('username')
> · NLS::getCharset()
> - consequently, _prefs_hook_fullname yields NULL.
>
> So, what am I doing wrong?
fullname is an Identity preference, this means it's used to construct
the user's identity. This happens the first time the user logs in,
i.e. if you create the hook after you already logged in with a user,
the default identity won't change, only the default fullname value
when creating new identities will change.
> And why is the preference for an e-mail parameter,
> such as "user full name for From: line", in the Horde,
> rather than the Imp, configuration?
Because the identity is used all across Horde, not only in IMP.
> And how should the Horde/Imp documentation be amended?
I don't know because everyone else seems to get along with the
existing documentation. But ideas or patches how to improve the
documentation are of course always welcome.
Jan.
--
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/
More information about the imp
mailing list