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

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

eZ debug

Timing: Jan 19 2025 04:37:49
Script start
Timing: Jan 19 2025 04:37:49
Module start 'layout'
Timing: Jan 19 2025 04:37:49
Module start 'content'
Timing: Jan 19 2025 04:37:50
Module end 'content'
Timing: Jan 19 2025 04:37:50
Script end

Main resources:

Total runtime0.8260 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 589.2891152.6406
Module start 'layout' 0.00720.0034 741.929739.4922
Module start 'content' 0.01060.8140 781.4219547.1875
Module end 'content' 0.82460.0014 1,328.609412.1250
Script end 0.8260  1,340.7344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4003160.0002
Check MTime0.00140.1642160.0001
Mysql Total
Database connection0.00090.107610.0009
Mysqli_queries0.771393.3716620.0124
Looping result0.00070.0826600.0000
Template Total0.791195.820.3955
Template load0.00210.249520.0010
Template processing0.789095.519520.3945
Template load and register function0.00020.029410.0002
states
state_id_array0.00100.117310.0010
state_identifier_array0.00190.233220.0010
Override
Cache load0.00170.2094400.0000
Sytem overhead
Fetch class attribute can translate value0.00070.079330.0002
Fetch class attribute name0.00130.156940.0003
XML
Image XML parsing0.00040.047630.0001
class_abstraction
Instantiating content class attribute0.00000.001040.0000
General
dbfile0.00070.0847100.0001
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs