display current_user main_node_id in php

Author Message

ludo thomas

Friday 06 January 2006 3:06:34 am

Hi !
I need to access to the main_node_id in checkout.php
I use:

$user=& eZUser::currentUser();
$userId=$user->attribute('contentobject_id');

So I have the user ID but how to have the user's main node?

thx

Kristof Coomans

Friday 06 January 2006 5:29:57 am

$user =& eZUser::currentUser();
$userContentObject =& $user->attribute( 'contentobject' );
$mainNodeID = $userContentObject->attribute( 'main_node_id' );
$mainNode =& $userContentObject->attribute( 'main_node' );

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

ludo thomas

Friday 06 January 2006 6:04:54 am

hi kristoff, & thx for your reply,I tried this before but your code doesn't dislay nothing...
any idee?
does it display something with you?

Kristof Coomans

Saturday 07 January 2006 9:12:58 am

What do you get with:

var_dump( $mainNode );
var_dump( $mainNodeID );

after the code I gave you already?

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

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