Customize forgot_password.jsp in Liferays login hook -
use case:
- an existing liferay user has forgotten password.
- he clicks on link "forgot password" (login hook).
- the user enters loginname screenname.
- now problem: if user enters loginname (which i
recognize regex) , clicks button "send new password" want prevent default action of button , display infomessage instead (eg. can't send new password...)
to honest have no idea @ moment how approach this...
- maybe create ext plugin , override forgotpasswordaction class?
- is possible within forgot_password.jsp ?
- can without writting plugin ?
hope can me. thanks
without plugin no, can not that.
- the simplest way make if password check done in javascript or maybe control using ajax use jsp hook , place code in
forgot_password.jsp
2. second way make struts action hook override default action /login/forgot_password
of update password form.for in liferay-hook.xml add:
<struts-action> <struts-action-path>/login/forgot_password</struts-action-path> <struts-action-impl>com.myproject.hook.newpasswordportletaction</struts-action-impl> </struts-action>
add new class project an
public void processaction( strutsportletaction originalstrutsportletaction, portletconfig portletconfig, actionrequest actionrequest, actionresponse actionresponse) throws exception { //custom code handle password //and call original action handler if password entered should saved originalstrutsportletaction.processaction( originalstrutsportletaction, portletconfig, actionrequest, actionresponse); }
as ext, should alwayes try not use it, since can done hook go it.
Comments
Post a Comment