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...

  1. maybe create ext plugin , override forgotpasswordaction class?
  2. is possible within forgot_password.jsp ?
  3. can without writting plugin ?

hope can me. thanks

without plugin no, can not that.

  1. 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

Popular posts from this blog

Combining PHP Registration and Login into one class with multiple functions in one PHP file -

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -