[horde] turba: default column prefs for personal address book

Jan Schneider jan at horde.org
Thu Mar 27 12:55:37 UTC 2014


Zitat von Guenter Bartsch <guenter.bartsch at gmail.com>:

> Jan,
>
> On Tue, Mar 4, 2014 at 12:47 PM, Guenter Bartsch
> <guenter.bartsch at gmail.com> wrote:
>> Jan,
>>
>> On Tue, Mar 4, 2014 at 11:02 AM, Jan Schneider <jan at horde.org> wrote:
>>
>>> Yes, like any preference.
>>
>
> we're still trying set preferences using hooks - with limited success.
> for example, we would like to set kronolith's search_source to a
> default value. we tried using the prefs_init hook:
>
> public function prefs_init($pref, $value, $username, $scope_ob)
>
> but this one doesn't seemed to get called for that particular
> preference we're trying to modify - maybe we need to enable out hook
> for this specific preference setting? if so, how?

Please read the docs in horde/config/prefs.php and horde/config/hook.php.dist.

> we also tried to use the postauthenticate hook:
>
> public function postauthenticate($userId, $credentials)
>     {
>         $logger = $GLOBALS['injector']->getInstance('Horde_Log_Logger');
>         $logger->info('postauthenticate, username=' . $userId);
>
>         $app = 'kronolith';
>         $pref = 'search_sources';
>
>         $pushed = $GLOBALS['registry']->pushApp($app);
>         $GLOBALS['registry']->loadPrefs($app);
>         $value = $GLOBALS['prefs']->getValue($pref);
>         $GLOBALS['prefs']->setValue($pref, 'hallo');
>         if ($pushed) {
>             $GLOBALS['registry']->popApp();
>         }
>
>         $logger->info('postauthenticate, pref=' . $value);
>
>         return true;
>     }
>
> which doesn't give us any error but also doesn't seem to have any
> effect: getValue() will return an empty string regrardloss of whether
> the pref is set or not, setValue() appears to not do anything.
>
> any ideas what else we could try?
>
> thanks,
>
>    guenter


-- 
Jan Schneider
The Horde Project
http://www.horde.org/
https://www.facebook.com/hordeproject



More information about the horde mailing list