Set user preference before first login

Set user preference before first login

Wednesday 31 August 2005 5:11:24 am - 4 replies

Author Message

Kristof Coomans

Thursday 01 September 2005 12:29:00 am

The defaults in the CachedViewPreferences setting are only used for view caching.

The best way to accomplish this is to write a little post publish workflow event type, that sets the default preferences for a user object. You can put the preference/default value pairs in an INI file, or provide an interface in your event type to store them in the workflow event.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Olivier Pierret

Thursday 01 September 2005 1:08:36 am

After one night thinking about this I came to the same conlusion: I will do it using post publish triggered workflow event.

You conforted me this is the right design

Thanks for your help

Kristof Coomans

Thursday 01 September 2005 1:46:44 am

Can you add this workflow event type to the contributions when it's ready?

Thanks!

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Olivier Pierret

Thursday 01 September 2005 1:18:51 pm

Unfortunately I cannot make a contribution with this, I have integrated this change in a very specific extension that is useful only for our customer.

However, I can tell you it works. Just put the following line in the processEvent function:

eZPreferences:setValue('admin_treemenu','1',$objectID);

I use this in conjunction with the importXmlData contrib (http://ez.no/community/contribs/import_export/import_xml_data)
I import the users from a big xml file and a workflow is triggered on each user created in the ez systems. It allows me to set the correct preferences and access rights on the created users. Now, you know everything ;)

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.