[horde] storing from addresses in session/preferences

Matus UHLAR - fantomas uhlar at fantomas.sk
Thu Jul 21 13:13:24 UTC 2011


>Quoting Matus UHLAR - fantomas <uhlar at fantomas.sk>:
>>well, that's it: how can I access users' preferences from PHP application?
>>(either a hook or horde/prefs.php)

On 11.07.11 10:09, Michael J Rubinsky wrote:
>$GLOBALS['prefs']->getValue('pref_name');
>$GLOBALS['prefs']->setValue('pref_name', $prefValue);

Thanks, I'll try to play with that.

>>I have an array in PHP (list of e-mail addresses), how can I store 
>>it into users' preferences?  How can I access it later?
>
>You can't just store arbitrary values in pref storage. If you want to 
>store a new user pref that does not already exist in stock Horde, you 
>need to add that pref to either horde/config/prefs.local.php or 
>{application}/config/prefs.local.php. See the application's prefs.php 
>file for the format of the pref configuration.

I'm interested in from_addr which is horde's default preference.

Unfortunately I've had to change it to 'enum' and fill it from within 
prefs.php instead of using hook as documented on
http://marc.info/?l=horde&m=130708668024663&w=2

I hope that I'll be able to fetch the array from remote database at 
login, and put it into session data, so all further calls to prefs.php 
will only fetch values from session.

>>pardon my ignorrance - if this is documented somewhere, possibly 
>>with a working example, I will try to read it.
>
>Pretty sure there is some basic information about the prefs system on 
>the wiki. http://wiki.horde.org

Thanks, I've found the preferences, although I don't see reason why 
I can't set preference of type "enum" within hook returning an array...
-- 
Matus UHLAR - fantomas, uhlar at fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Your mouse has moved. Windows NT will now restart for changes to take
to take effect. [OK]


More information about the horde mailing list