List of usage examples for com.liferay.portal.util PropsValues AUTH_LOGIN_DISABLED_PATH
String AUTH_LOGIN_DISABLED_PATH
To view the source code for com.liferay.portal.util PropsValues AUTH_LOGIN_DISABLED_PATH.
Click Source Link
From source file:com.liferay.login.web.internal.portlet.action.LoginMVCActionCommand.java
License:Open Source License
@Override protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); if (PropsValues.AUTH_LOGIN_DISABLED) { actionResponse.sendRedirect(themeDisplay.getPathMain() + PropsValues.AUTH_LOGIN_DISABLED_PATH); return;//from ww w . j a v a 2 s. com } /*if (actionRequest.getRemoteUser() != null) { actionResponse.sendRedirect(themeDisplay.getPathMain()); return; }*/ try { login(themeDisplay, actionRequest, actionResponse); boolean doActionAfterLogin = ParamUtil.getBoolean(actionRequest, "doActionAfterLogin"); if (doActionAfterLogin) { LiferayPortletResponse liferayPortletResponse = _portal.getLiferayPortletResponse(actionResponse); PortletURL renderURL = liferayPortletResponse.createRenderURL(); renderURL.setParameter("mvcRenderCommandName", "/login/login_redirect"); actionRequest.setAttribute(WebKeys.REDIRECT, renderURL.toString()); } } catch (Exception e) { if (e instanceof AuthException) { Throwable cause = e.getCause(); if (cause instanceof PasswordExpiredException || cause instanceof UserLockoutException) { SessionErrors.add(actionRequest, cause.getClass(), cause); } else { if (_log.isInfoEnabled()) { _log.info("Authentication failed"); } SessionErrors.add(actionRequest, e.getClass()); } } else if (e instanceof CompanyMaxUsersException || e instanceof CookieNotSupportedException || e instanceof NoSuchUserException || e instanceof PasswordExpiredException || e instanceof UserEmailAddressException || e instanceof UserIdException || e instanceof UserLockoutException || e instanceof UserPasswordException || e instanceof UserScreenNameException) { SessionErrors.add(actionRequest, e.getClass(), e); } else { _log.error(e, e); _portal.sendError(e, actionRequest, actionResponse); return; } postProcessAuthFailure(actionRequest, actionResponse); } }
From source file:com.liferay.portlet.login.action.LoginAction.java
License:Open Source License
@Override public void processAction(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); if (PropsValues.AUTH_LOGIN_DISABLED) { actionResponse.sendRedirect(themeDisplay.getPathMain() + PropsValues.AUTH_LOGIN_DISABLED_PATH); return;/* w w w. j a va2 s . c o m*/ } /*if (actionRequest.getRemoteUser() != null) { actionResponse.sendRedirect(themeDisplay.getPathMain()); return; }*/ try { PortletPreferences preferences = PortletPreferencesFactoryUtil.getPortletSetup(actionRequest); login(themeDisplay, actionRequest, actionResponse, preferences); boolean doActionAfterLogin = ParamUtil.getBoolean(actionRequest, "doActionAfterLogin"); if (doActionAfterLogin) { setForward(actionRequest, "portlet.login.login_redirect"); } } catch (Exception e) { if (e instanceof AuthException) { Throwable cause = e.getCause(); if (cause instanceof PasswordExpiredException || cause instanceof UserLockoutException) { SessionErrors.add(actionRequest, cause.getClass().getName()); } else { if (_log.isInfoEnabled()) { _log.info("Authentication failed"); } SessionErrors.add(actionRequest, e.getClass().getName()); } } else if (e instanceof CompanyMaxUsersException || e instanceof CookieNotSupportedException || e instanceof NoSuchUserException || e instanceof PasswordExpiredException || e instanceof UserEmailAddressException || e instanceof UserIdException || e instanceof UserLockoutException || e instanceof UserPasswordException || e instanceof UserScreenNameException) { SessionErrors.add(actionRequest, e.getClass().getName()); } else { _log.error(e, e); PortalUtil.sendError(e, actionRequest, actionResponse); } } }
From source file:com.liferay.portlet.login.action.SampleLoginAction.java
License:Open Source License
@Override public void processAction(ActionMapping actionMapping, ActionForm actionForm, PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); if (PropsValues.AUTH_LOGIN_DISABLED) { actionResponse.sendRedirect(themeDisplay.getPathMain() + PropsValues.AUTH_LOGIN_DISABLED_PATH); return;//w w w . j a va 2 s.co m } /*if (actionRequest.getRemoteUser() != null) { actionResponse.sendRedirect(themeDisplay.getPathMain()); return; }*/ try { login(themeDisplay, actionRequest, actionResponse); boolean doActionAfterLogin = ParamUtil.getBoolean(actionRequest, "doActionAfterLogin"); if (doActionAfterLogin) { setForward(actionRequest, "portlet.login.login_redirect"); } } catch (Exception e) { if (e instanceof AuthException) { Throwable cause = e.getCause(); if (cause instanceof PasswordExpiredException || cause instanceof UserLockoutException) { SessionErrors.add(actionRequest, cause.getClass()); } else { if (_log.isInfoEnabled()) { _log.info("Authentication failed"); } SessionErrors.add(actionRequest, e.getClass()); } } else if (e instanceof CompanyMaxUsersException || e instanceof CookieNotSupportedException || e instanceof NoSuchUserException || e instanceof PasswordExpiredException || e instanceof UserEmailAddressException || e instanceof UserIdException || e instanceof UserLockoutException || e instanceof UserPasswordException || e instanceof UserScreenNameException) { SessionErrors.add(actionRequest, e.getClass()); } else { _log.error(e, e); PortalUtil.sendError(e, actionRequest, actionResponse); return; } postProcessAuthFailure(actionRequest, actionResponse); } }
From source file:com.test.CharterLogin.java
License:Open Source License
@Override public void processAction(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); if (PropsValues.AUTH_LOGIN_DISABLED) { actionResponse.sendRedirect(themeDisplay.getPathMain() + PropsValues.AUTH_LOGIN_DISABLED_PATH); return;// www.j av a2 s .co m } /*if (actionRequest.getRemoteUser() != null) { actionResponse.sendRedirect(themeDisplay.getPathMain()); return; }*/ try { PortletPreferences preferences = PortletPreferencesFactoryUtil.getPortletSetup(actionRequest); login(themeDisplay, actionRequest, actionResponse, preferences); boolean doActionAfterLogin = ParamUtil.getBoolean(actionRequest, "doActionAfterLogin"); if (doActionAfterLogin) { setForward(actionRequest, "portlet.login.login_redirect"); } } catch (Exception e) { if (e instanceof AuthException) { Throwable cause = e.getCause(); if (cause instanceof PasswordExpiredException || cause instanceof UserLockoutException) { SessionErrors.add(actionRequest, cause.getClass()); } else { if (_log.isInfoEnabled()) { _log.info("Authentication failed"); } SessionErrors.add(actionRequest, e.getClass()); } } else if (e instanceof CompanyMaxUsersException || e instanceof CookieNotSupportedException || e instanceof NoSuchUserException || e instanceof PasswordExpiredException || e instanceof UserEmailAddressException || e instanceof UserIdException || e instanceof UserLockoutException || e instanceof UserPasswordException || e instanceof UserScreenNameException) { SessionErrors.add(actionRequest, e.getClass()); } else { _log.error(e, e); PortalUtil.sendError(e, actionRequest, actionResponse); } } }