[ingo] Set default rules for users (conf.php)

Arminas g.arminas at gmail.com
Wed Mar 19 09:07:15 UTC 2008


Hi all,

I was already posted one familiar topic to this list, but no one
replied for me. Maybe anyone could help me to understand how to set
"$_prefs['rules']" in prefs.php array corretly.. F.e. I have in my
prefs.php default config:

...
// filter rules
$_prefs['rules'] = array(
    'value' => 'a:4:{i:0;a:2:{s:4:"name";s:9:"Whitelist";s:6:"action";i:'
. INGO_STORAGE_ACTION_WHITELIST .
';}i:1;a:3:{s:4:"name";s:8:"Vacation";s:6:"action
";i:' . INGO_STORAGE_ACTION_VACATION .
';s:7:"disable";b:1;}i:2;a:2:{s:4:"name";s:9:"Blacklist";s:6:"action";i:'
. INGO_STORAGE_ACTION_BLACKLIST . ';}i:3;a:2
:{s:4:"name";s:7:"Forward";s:6:"action";i:' .
INGO_STORAGE_ACTION_FORWARD . ';}}',
    'locked' => false,
    'shared' => false,
    'type' => 'implicit'
);
...

then if I login as simple user and add one rule which filters e-mail's
with " [Spam] " in Subject, it saves such parameters (in horde_prefs
table):

pref_uid: username
pref_scope: ingo
pref_name: rules
pref_value: a:5:{i:0;a:2:{s:4:"name";s:9:"Whitelist";s:6:"action";i:9;}i:1;
a:3:{s:4:"name";s:8:"Vacation";s:6:"action";i:8;s:7:"disable";b:1;}i:2;
a:2:{s:4:"name";s:9:"Blacklist";s:6:"action";i:7;}i:3;
a:2:{s:4:"name";s:7:"Forward";s:6:"action";i:10;}i:4;
a:8:{s:4:"name";s:4:"Spam";s:7:"combine";s:1:"1";
s:10:"conditions";a:1:{i:0;a:4:{s:5:"field";s:7:"Subject";
s:4:"type";i:1;s:5:"match";s:8:"contains";
s:5:"value:6:"[Spam]";}}s:6:"action";
s:1:"2";s:12:"action-value";
s:9:"mail/Spam";s:4:"stop";s:1:"1";s:5:"flags";i:0;s:7:"disable";b:0;}}

pref_value is one huge string....

All I want that all users, when they logs in would have the same rule:
[Spam] e-mails goes to folder "Spam".. But if i copy -> paste from
database to prefs.php, $_prefs['rules'], value -> .... then there is
lots of errors. I guess it is cause of constants.. (such as
INGO_STORAGE_ACTION_WHITELIST, INGO_STORAGE_ACTION_VACATION and etc),
but how can i add my specific rule to $_prefs['rules'] to make it my
custom and for all users..

Would be great if anyone could help.. Thanks a lot.

Arminas


More information about the ingo mailing list