I have a Liferay application in which users have a “membership plan”. When a user logs in, I need to check if their membership plan has expired and show them a warning message. (The membership plan is independent of the login functionality. The user can still login even though his/her membership plan has expired).
I thought of creating a post-login action. But I cannot access my service builder methods (MemberPlanLocalServiceUtil.isPlanExpired()) from this, or any other hooks that I create.
What approach should I use to solve this problem? Would an ext plugin be necessary here? Or can I do something else?
I ended up working around the problem. (It was one of those situations where a solution was needed quickly, and a dirty solution it is)
Here’s what I did
I added a
LoginActionin which I set a session attribute:Then, in a portlet on the home page, I check if this session attribute is set, and show my warning message if needed.