Forums / General / Getting user information

Getting user information

Author Message

Carlos Revillo

Wednesday 23 May 2007 1:50:54 pm

Hi. I'm working with a extension now. I'm trying to fetch user information by e-mail. so, i'm doing something like

$node=eZUser::fetchByEmail ($http->postVariable("email-field"));

if i do print_r($node); i get

ezuser Object ( [PersistentDataDirty] => [Login] => carlos [Email] => carlos@desorden.net [PasswordHash] => 3e4146001e197b972cd72a7ee7f59679 [PasswordHashType] => 2 [Groups] => [OriginalPassword] => [OriginalPasswordConfirm] => [ContentObjectID] => 62 )

But what i really want is to get the information of the node wich "contains" this ezuser.

How can i get to the signature and other data of this user from here?.

or maybe should i try to fetch object and do a filter by attribute?.

Thank you.

Nabil Alimi

Wednesday 23 May 2007 2:26:57 pm

Hi Carlos,

Try something like this :

$user = eZUser::fetchByEmail ($http->postVariable("email-field"));
$userContentObject = $user->contentObject();
$dataMap = $userContentObject->dataMap();

From there, you should be able to access any attribute of your node (but it is actually the contentObject) with <b>$dataMap['attribute-identifier']->content()</b>.

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

Carlos Revillo

Wednesday 23 May 2007 2:52:48 pm

that worked. thanks so much.

you have pointed me in the right direction for my purpose. i also wanted the id of the node containing the ezuser object. i get it with

$userContentObject->attribute("main_node_id")