Fórum

Disable Forgot Password link from create account page only

thumbnail
Karthik V S, modificado 8 Anos atrás.

Disable Forgot Password link from create account page only

Regular Member Postagens: 106 Data de Entrada: 21/12/11 Postagens Recentes
hi,

I want to disable "Forgot Password" link from create account page only but not in login page. If we do through Control Panel, i.e Control Panel --> Portal Settings --> Authentication --> Uncheck "Allow users to request forgotten passwords?" and "Allow users to request password reset links?" then in login page also it gets disabled. So can anyone give the solution in this regard.
Thanks in advance.

With Regards,

V S Karthik
thumbnail
Meera Prince, modificado 8 Anos atrás.

RE: Disable Forgot Password link from create account page only

Liferay Legend Postagens: 1111 Data de Entrada: 08/02/11 Postagens Recentes
Hi
Both pages it use same jsp page and same condition that is why it disabled in two places.

This is code existed in the /html/portlet/login/navigation/forgot_password.jsp

<%
String strutsAction = ParamUtil.getString(request, "struts_action");

boolean showForgotPasswordIcon = false;

if (!strutsAction.equals("/login/forgot_password") && (company.isSendPassword() || company.isSendPasswordResetLink())) {
showForgotPasswordIcon = true;
}

%>

<c:if test="<%= showForgotPasswordIcon %>">
<portlet:renderURL var="forgotPasswordURL">
<portlet:param name="struts_action" value="/login/forgot_password" />
</portlet:renderURL>

<liferay-ui:icon
image="help"
message="forgot-password"
url="<%= forgotPasswordURL %>"
/>
</c:if>

you might add something like below if you don't want see the link create_account page.

<%
if (!strutsAction.equals("/login/forgot_password") && (company.isSendPassword() || company.isSendPasswordResetLink())) {
showForgotPasswordIcon = true;
}

if (strutsAction.equals("/login/create_account")){
showForgotPasswordIcon = false;
}

%>
you have to create jsp for hook for forgot_password.jsp page and add above code so that it will not be shown for create account or you can manipulate through CSS display: none property

Regards,
Meera Prince