Reputation: 11
I am new to Liferay, I am using Liferay 6.2 CE and I am trying to create a ModelListener in my hooks to capture the data when any user is updated in the portal. I use below function
public void onBeforeUpdate(User user)
{}
But this function is being triggered when a user logins into the portal and as well as when user details being updated into the control panel. I need the above function to capture the data only when the user is being updated in the control panel.
Upvotes: 0
Views: 50
Reputation: 982
About the user update when an user logs in it is because Liferay updates login date in User table.
You can disable that functionality adding users.update.last.login=false
to your portal-ext.properties ( more info see: https://docs.liferay.com/portal/6.2/propertiesdoc/portal.properties.html#Users )
If you don't want to disable that functionality, perhaps you can query the user from database and compare it with the new user object that you are receiving as a parameter:
Upvotes: 1