Example usage for com.liferay.portal.util PropsValues LOGIN_SECURE_FORGOT_PASSWORD

List of usage examples for com.liferay.portal.util PropsValues LOGIN_SECURE_FORGOT_PASSWORD

Introduction

In this page you can find the example usage for com.liferay.portal.util PropsValues LOGIN_SECURE_FORGOT_PASSWORD.

Prototype

boolean LOGIN_SECURE_FORGOT_PASSWORD

To view the source code for com.liferay.portal.util PropsValues LOGIN_SECURE_FORGOT_PASSWORD.

Click Source Link

Usage

From source file:com.liferay.login.web.internal.portlet.action.ForgotPasswordMVCActionCommand.java

License:Open Source License

@Override
protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

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

    Company company = themeDisplay.getCompany();

    if (!company.isSendPassword() && !company.isSendPasswordResetLink()) {
        throw new PrincipalException.MustBeEnabled(company.getCompanyId(),
                PropsKeys.COMPANY_SECURITY_SEND_PASSWORD, PropsKeys.COMPANY_SECURITY_SEND_PASSWORD_RESET_LINK);
    }/*  www  . j  av a  2  s  . c  o  m*/

    try {
        if (PropsValues.USERS_REMINDER_QUERIES_ENABLED) {
            checkReminderQueries(actionRequest, actionResponse);
        } else {
            checkCaptcha(actionRequest);

            sendPassword(actionRequest, actionResponse);
        }
    } catch (Exception e) {
        if (e instanceof CaptchaConfigurationException || e instanceof CaptchaTextException
                || e instanceof UserEmailAddressException) {

            SessionErrors.add(actionRequest, e.getClass());
        } else if (e instanceof NoSuchUserException || e instanceof RequiredReminderQueryException
                || e instanceof SendPasswordException || e instanceof UserActiveException
                || e instanceof UserLockoutException || e instanceof UserReminderQueryException) {

            if (PropsValues.LOGIN_SECURE_FORGOT_PASSWORD) {
                sendRedirect(actionRequest, actionResponse, null);
            } else {
                SessionErrors.add(actionRequest, e.getClass(), e);
            }
        } else {
            _portal.sendError(e, actionRequest, actionResponse);
        }
    }
}