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")

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 18 2025 19:05:45
Script start
Timing: Jan 18 2025 19:05:45
Module start 'layout'
Timing: Jan 18 2025 19:05:45
Module start 'content'
Timing: Jan 18 2025 19:05:45
Module end 'content'
Timing: Jan 18 2025 19:05:45
Script end

Main resources:

Total runtime0.0166 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.9063152.6250
Module start 'layout' 0.00540.0035 740.531339.4297
Module start 'content' 0.00900.0055 779.960989.3047
Module end 'content' 0.01450.0021 869.265634.3047
Script end 0.0166  903.5703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002615.4464140.0002
Check MTime0.00116.7600140.0001
Mysql Total
Database connection0.00105.995210.0010
Mysqli_queries0.003018.094630.0010
Looping result0.00000.096010.0000
Template Total0.001710.310.0017
Template load0.00095.557010.0009
Template processing0.00084.722010.0008
Override
Cache load0.00073.952910.0007
General
dbfile0.00021.499580.0000
String conversion0.00000.048740.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