Forums

Home » Liferay Portal » English » 6. Portal Framework »

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Frederik Weishäupl
UserLocalServiceUtil.updateUser(user) - Changes not visible in My Account
April 12, 2010 4:25 AM
Answer

Frederik Weishäupl

Rank: Junior Member

Posts: 46

Join Date: January 7, 2006

Recent Posts

Hi,

I wrote a custom Liferay Authentication Module which authenticates a user against my own Backend-DB.
If the login is successful it creates the user in Liferay (if it doesn't already exists in Liferay DB ). For the case the user already exists in Liferay DB I perform an update of the Liferay User instead via calling UserLocalServiceUtil.updateUser(User user).

Here the relevant Code-Snippet:

//Use Case: User already exists in Liferay
//get current Liferay user
User user = UserLocalServiceUtil.getUserByScreenName(companyId,screenName);
//set new user credentials
user.setFirstName(newFirstName);
user.setLastName(newLastName);
user.setEmailAddress(newEmailAddress);
//Update user in Liferay
UserLocalServiceUtil.updateUser(user);


Unfortunately after the user update the changes are not visible in the "My Account"-Portlet. There I see the old values (values before update).

However if I read out the user programmatically via
"UserLocalServiceUtil.getUserByScreenName(companyId,screenName)" I get the updated values.

Any suggestions about the cause of this behavior?

Thx a lot in advance.
Frederik Weishäupl
RE: UserLocalServiceUtil.updateUser(user) - Changes not visible in My Accou
April 12, 2010 4:59 AM
Answer

Frederik Weishäupl

Rank: Junior Member

Posts: 46

Join Date: January 7, 2006

Recent Posts

Ok, solved my issue. I also have to update the Contact information of the user.
Corné Aussems
RE: UserLocalServiceUtil.updateUser(user) - Changes not visible in My Accou
April 12, 2010 5:09 AM
Answer

Corné Aussems

Rank: Liferay Legend

Posts: 1078

Join Date: October 3, 2006

Recent Posts

I think it has something todo with Lucene indexing and that changing the contact info will trigger the reindex maybe