Change User Attribute

Author Message

Daniel B

Thursday 17 September 2009 6:25:17 am

Hello,

How i can change user attributes.
Example

$user = eZUser::fetchByName( "Meier");
$user->setAttribute('last_name','Müller');
$user->store();
 

o

$user = eZContentObject::fetch(66);
$user ->setAttribute('last_name','Müller');
$existingUser->store();
 

which has no effect :(

Thanks
Daniel

Daniel B

Thursday 17 September 2009 6:47:51 am

thats work...


//get the Object
$object = eZContentObject::fetch(57);

//get the data map from this object		
$dataMap = $object->attribute('data_map');

//set attribute 				
$dataMap['ldap_groups']->setAttribute( "data_text", 'otto');												
$dataMap['ldap_groups']->store();
			
//store the object!		
$object->store();
	
//clear the view cache for this object 			
eZContentCacheManager::clearObjectViewCache( $object->attribute('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:35:36
Script start
Timing: Jan 18 2025 19:35:36
Module start 'layout'
Timing: Jan 18 2025 19:35:36
Module start 'content'
Timing: Jan 18 2025 19:35:37
Module end 'content'
Timing: Jan 18 2025 19:35:37
Script end

Main resources:

Total runtime0.9669 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 587.8906152.6094
Module start 'layout' 0.00550.0028 740.500039.4141
Module start 'content' 0.00830.9571 779.9141428.4453
Module end 'content' 0.96540.0015 1,208.35948.1875
Script end 0.9669  1,216.5469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3099160.0002
Check MTime0.00120.1256160.0001
Mysql Total
Database connection0.00070.071310.0007
Mysqli_queries0.928896.0583520.0179
Looping result0.00040.0458500.0000
Template Total0.939697.220.4698
Template load0.00200.211420.0010
Template processing0.937596.958220.4688
Template load and register function0.00020.023210.0002
states
state_id_array0.00060.066710.0006
state_identifier_array0.00180.190720.0009
Override
Cache load0.00170.1735160.0001
Sytem overhead
Fetch class attribute can translate value0.00080.082910.0008
Fetch class attribute name0.00120.120020.0006
XML
Image XML parsing0.00010.012310.0001
class_abstraction
Instantiating content class attribute0.00000.000620.0000
General
dbfile0.00070.0770100.0001
String conversion0.00000.001040.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs