From 243fee317e7c659d84b2c08c265ef07322b0858b Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Wed, 20 May 2015 12:21:59 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud) 104577: Merge RA-SPRINT4 to HEAD-BUG-FIX (5.1) 102942: RA-202: Break dependency to spring-surf in alfresco-platform git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@104646 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/java/org/alfresco/web/bean/LoginBean.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/java/org/alfresco/web/bean/LoginBean.java b/source/java/org/alfresco/web/bean/LoginBean.java index 7f98939dda..339c18f9df 100644 --- a/source/java/org/alfresco/web/bean/LoginBean.java +++ b/source/java/org/alfresco/web/bean/LoginBean.java @@ -52,7 +52,6 @@ import org.alfresco.web.ui.common.PanelGenerator; import org.alfresco.web.ui.common.Utils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.extensions.surf.site.AuthenticationUtil; /** * JSF Managed Bean. Backs the "login.jsp" view to provide the form fields used @@ -78,6 +77,10 @@ public class LoginBean implements Serializable */ private static final String PARAM_OUTCOME = "outcome"; + /** flag to set in the user Session when an external authentication mechanism is used + * this informs the framework that user cannot Change Password or Logout in the usual way */ + private static final String SESSION_ATTRIBUTE_EXTERNAL_AUTH= "_alfExternalAuth"; + private static final long serialVersionUID = 7417882503323795282L; /** @@ -497,9 +500,10 @@ public class LoginBean implements Serializable return outcome; } - public boolean getIsExternalAuthentication(){ + public boolean getIsExternalAuthentication() + { HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest(); - return AuthenticationUtil.isExternalAuthentication(request); + return (request.getSession().getAttribute(SESSION_ATTRIBUTE_EXTERNAL_AUTH) != null); } // ------------------------------------------------------------------------------