[imp] Dependend preferences

Chuck Hagenbuch chuck at horde.org
Tue Jun 26 19:31:28 UTC 2007


Quoting Otto Stolz <Otto.Stolz at uni-konstanz.de>:

> is there a way to make a default preference dependent on a
> user's actual preferencies?
>
> E. g., I would like to set the default for purge_trash
> - normally to 0,
> - to 1, however, for users that have use_trash=1 set,
>    in their personal preferences.
>
> To accomplish this, I'd have to inspect the current user's
> actual preference settings from whithin imp/config/prefs.php.
> The questios are:
> - Is there a convenient API function to read the actual
>    user's preference settings, and where can I find its
>    documentation?

$prefs->getValue('prefname')

> - If so, will it work from within imp/config/prefs.php,
>    or will it not yet be ready when the latter runs?

I would be surprised if it worked consistently. Best bet is to consult  
the preferences database directly for the values that you need.

-chuck


More information about the imp mailing list