Forums / Developer / HOWTO: Create user in different folder on register

HOWTO: Create user in different folder on register

Author Message

Dominik Pich

Friday 16 January 2004 2:46:49 am

I know there's DefaultPlacement ini file but I have different users and want to add them to a folder spefic to the user's type

e.g.
() user for shop {*create in default folder*}
(X) user for press (*create in press_users (id=279)}}

Willie Seabrook

Friday 16 January 2004 12:14:46 pm

Wouldn't you be able to create a before publish workflow event and:

... etc etc etc

$nodeAssignment =& eZNodeAssignment::create(array('contentobject_id' => $contentObject->attribute('id'),
'contentobject_version' => $contentObject->attribute('current_version'),
'parent_node' => YOUR FOLDER ID,
'is_main' => 1));
$nodeAssignment->store();

.... etc etc etc

include_once('lib/ezutils/classes/ezoperationhandler.php');
$operationResult = eZOperationHandler::execute('content', 'publish', array('object_id' => $contentObjectID,
'version' => 1));

You would have control code above that to set the node assignment parent_id depending on the class of the object published. Or probably better is to create one event for each user class.

Now that I think about it though. The workflow system might actually publish the object in its default location after this... not sure tho you will have to test?

Let me know
Regards,
Willie

Dominik Pich

Monday 19 January 2004 1:44:54 am

In site.ini there are serveral settings:

# The ID of the anonymous user, this user will
# be used for everyone who is not logged in.
AnonymousUserID=10
# Where to store newly self registered users
DefaultUserPlacement=12
# Which section to place newly self registered users
DefaultSectionID=1

So.......... can I just set these before calling register
-> are ini-values cached if set via ez? "If so :("
or should I just edit register.php and add a hidden field to the form

Luc Chase

Friday 18 May 2007 7:13:22 am

This might help..
content.ini file
ClassSpecificAssignment[]=user,user_group; users/special_guest_accounts

The Web Application Service Provider