Message Boards

Overwriting update_password using application adapter hook

thumbnail
Srikanth Reddy Sanivarapu, modified 9 Years ago.

Overwriting update_password using application adapter hook

Regular Member Posts: 203 Join Date: 11/15/08 Recent Posts
Hi Team,

I have been trying to overwrite the update_password.jsp page (liferay-portal-6.1.20-ee-ga2\tomcat-7.0.27\webapps\ROOT\html\portal\update_password.jsp) using an application adapter hook. Portlet JSP files are overwritten with the application adapter hook but the update_password.jsp is not getting overwritten by this. Are there anyone who has come across this issue or do any one know the reason of not picking up the correct file here. Any suggestions are much appreciated. Thanks.

Regards,
Srik
thumbnail
Pankaj Kathiriya, modified 9 Years ago.

RE: Overwriting update_password using application adapter hook

Liferay Master Posts: 722 Join Date: 8/5/10 Recent Posts
I have tried overriding couple of files under \html\portal folder, but they are not getting overridden by adapter hook.

I feel as they are portal level jsps (Not specific to portlet and hence not specific to any Site), application adapter hook will not work for them.

Regards,
thumbnail
Manish Yadav, modified 8 Years ago.

RE: Overwriting update_password using application adapter hook

Expert Posts: 493 Join Date: 5/26/12 Recent Posts
Than how to do that???
I also have same requirement...I want to customize ui of html/portal/update_password.jsp for one site alone...
Application adapter is not working here...any hint how to achieve that
thumbnail
Olaf Kock, modified 8 Years ago.

RE: Overwriting update_password using application adapter hook

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts
2 options quickly come to my mind.
  • link to your own implementation of an "update password" portlet
  • Globally override Liferay's JSP, but determine yourself if you're presenting the default or the modified UI to the user

There might be more, but start with these
thumbnail
David H Nebinger, modified 8 Years ago.

RE: Overwriting update_password using application adapter hook

Liferay Legend Posts: 14916 Join Date: 9/2/06 Recent Posts
Yeah, I'd go w/ Olaf's second option. You can determine things in the JSP such as who the user is, what the current company/scope is, etc. Using that info you can include one set of elements or another.
thumbnail
Manish Yadav, modified 8 Years ago.

RE: Overwriting update_password using application adapter hook

Expert Posts: 493 Join Date: 5/26/12 Recent Posts
Many Thanks ...
I'm able to change UI according to userRole.... I have created UpdatePasswordAction Struts hook .But now i'm facing new issue, Could you please help me...
I have site with public page and private page...Public page is for login and default landing pages are privates pages.
I'm facing issue in redirection of user after reset password at first time login..

I have created UserPasswordAction strust action hook..

public String execute(StrutsAction originalStrutsAction, HttpServletRequest request, HttpServletResponse response) throws Exception {  
		

		 _log.info("Update Password Url Works Now");
	Ticket ticket = getTicket(request);
	
	try{
		if(Validator.isNotNull(ticket)){
    User user = UserLocalServiceUtil.getUser(ticket.getClassPK());
    if(checkUserGroup(user)&&checkUserRole(user)){
        request.setAttribute("IsValidLinkUser", Boolean.TRUE);
        _log.info("SampleLayoutStrutsAction.execute() - " + user.getEmailAddress()); 
    }
    }
		else{
			ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(
					WebKeys.THEME_DISPLAY);
			if(Validator.isNotNull(themeDisplay)){
				 User user = themeDisplay.getUser();
				    if(checkUserGroup(user)&&checkUserRole(user)){
				        request.setAttribute("IsValidLinkUser", Boolean.TRUE);
				        _log.info("SampleLayoutStrutsAction.execute() - " + user.getEmailAddress()); 
				    }
				
			}
		}
  }
	
	catch(Exception e){
		_log.error(e);
	}


	return  originalStrutsAction.execute(request, response);
 

	}  



I want to change redirection to private pages after reset new password

for Eg:-

Reset Password Page :-
http://<abc>.com/web/sitename/

Should redirect to after reset password

http://<abc>.com/group/sitename/

can i modify below code in UpdatePasswordAction structs hook



ublic class UpdatePasswordAction extends Action {

	@Override
	public ActionForward execute(
			ActionMapping mapping, ActionForm form, HttpServletRequest request,
			HttpServletResponse response)
		throws Exception {

		ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(
			WebKeys.THEME_DISPLAY);

		Ticket ticket = getTicket(request);

		

		try {
		[b]	updatePassword(request, response, themeDisplay, ticket);

			PortletURL portletURL = new PortletURLImpl(
				request, PortletKeys.LOGIN, themeDisplay.getPlid(),
				PortletRequest.RENDER_PHASE);

			response.sendRedirect(portletURL.toString());
[/b]
			return null;
		}