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.