How add another parent node to user object

Author Message

Matej Ukmar

Monday 12 April 2004 11:34:05 am

I am building web portal, where users have expiration time... I mean after 30 days their account expires.

I was thinking to assign or remove to user an extra user group which would tell if user is allowed to enter the portal. (This User goroup is linked to a portal user role)

The problem is I dont know how. I was trying with

	$newNode=eZContentObjectTreeNode::addChild( $user->attribute( 'contentobject_id' ), 12, true);

New node (of current user object) was created but it did not appear in the admin interface under the requested user group (id=12)

Maybe I just need to publish newly created node... I dont know how... I am a little confused, can anybody help.

And maybe there is also another more appropriate aproach to my user expiration problem.

Please help.

Thanx
Matey

Björn Dieding@xrow.de

Monday 12 April 2004 9:57:06 pm

there is a little more to it

try this code

function & copyto (& $object,$node){
	$nodeAssignment =& eZNodeAssignment::create( array
		    	(
                  'contentobject_id' => $object->attribute( 'id' ),
                  'contentobject_version' => $object->attribute( 'current_version' ),
                  'parent_node' => $node,
                  'is_main' => 0
                 )
            );
    $nodeAssignment->store();
    #die("Here2".$node);
    $treenodegewerk = & eZContentObjectTreeNode::addChild($object->attribute( 'id' ),$node,true);
	$operationResult = eZOperationHandler::execute(
									'content', 'publish', array( 
									'object_id' => $object->attribute( 'id' ),
									'version' => $object->attribute( 'current_version' ) ) );
	 return eZContentObjectTreeNode::findNode($node,$object->attribute('id'),true); 
}

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Matej Ukmar

Tuesday 13 April 2004 12:55:03 pm

Bjorn thanks,
this helps a lot... and it works!!! :-)

I have just one more little question.
If I want to remove a node is it enough just to use

eZContentObjectTreeNode::remove(...

or is there also some extra "coding" to be done?

Regards,
Matey

Dominik Pich

Thursday 22 April 2004 1:32:15 am

Remove its assignments first... ?

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 31 2025 06:28:41
Script start
Timing: Jan 31 2025 06:28:41
Module start 'layout'
Timing: Jan 31 2025 06:28:41
Module start 'content'
Timing: Jan 31 2025 06:28:41
Module end 'content'
Timing: Jan 31 2025 06:28:41
Script end

Main resources:

Total runtime0.0157 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 588.2656151.2266
Module start 'layout' 0.00650.0025 739.492236.6797
Module start 'content' 0.00900.0051 776.171994.3125
Module end 'content' 0.01410.0016 870.484433.9922
Script end 0.0156  904.4766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002717.0067140.0002
Check MTime0.00117.2971140.0001
Mysql Total
Database connection0.00116.748610.0011
Mysqli_queries0.002616.695330.0009
Looping result0.00000.153410.0000
Template Total0.00117.110.0011
Template load0.00095.498210.0009
Template processing0.00021.528410.0002
Override
Cache load0.00063.594610.0006
General
dbfile0.00117.078380.0001
String conversion0.00000.069940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs