From 00a706803643d0a4f495359e5c0a407fd198b058 Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Tue, 14 Feb 2006 11:20:09 +0000 Subject: [PATCH] . Fix for parts 1+3 of AWC-359 (part 2 of the bug is now a 1.3 issue) - Create User action hidden for external auth e.g. NTLM - Delete User works for NTLM (but only removes the Person) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2367 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/java/org/alfresco/web/bean/LoginBean.java | 15 +++++++++++---- .../org/alfresco/web/bean/users/UsersBean.java | 1 + source/web/jsp/users/users.jsp | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/source/java/org/alfresco/web/bean/LoginBean.java b/source/java/org/alfresco/web/bean/LoginBean.java index 4a0d60bb9b..3eca39a58c 100644 --- a/source/java/org/alfresco/web/bean/LoginBean.java +++ b/source/java/org/alfresco/web/bean/LoginBean.java @@ -99,6 +99,16 @@ public class LoginBean { this.navigator = navigator; } + + /** + * @return true if the default Alfresco authentication process is being used, else false + * if an external authorisation mechanism is present. + */ + public boolean isAlfrescoAuth() + { + Map session = FacesContext.getCurrentInstance().getExternalContext().getSessionMap(); + return (session.get(LOGIN_EXTERNAL_AUTH) == null); + } /** * @param val Username from login dialog @@ -263,7 +273,6 @@ public class LoginBean // Authenticate via the authentication service, then save the details of user in an object // in the session - this is used by the servlet filter etc. on each page to check for login - //this.authenticationService = (AuthenticationService)FacesContextUtils.getRequiredWebApplicationContext(FacesContext.getCurrentInstance()).getBean("authenticationService"); this.authenticationService.authenticate(this.username, this.password.toCharArray()); // remove the session invalidated flag (used to remove last username cookie by AuthenticationFilter) @@ -343,8 +352,6 @@ public class LoginBean Map session = context.getExternalContext().getSessionMap(); User user = (User) session.get(AuthenticationHelper.AUTHENTICATION_USER); - boolean alfrescoAuth = (session.get(LOGIN_EXTERNAL_AUTH) == null); - // Invalidate Session for this user. // This causes the sessionDestroyed() event to be processed by ContextListener // which is responsible for invalidating the ticket and clearing the security context @@ -371,7 +378,7 @@ public class LoginBean Application.setLanguage(context, this.language); } - return alfrescoAuth ? "logout" : "relogin"; + return isAlfrescoAuth() ? "logout" : "relogin"; } diff --git a/source/java/org/alfresco/web/bean/users/UsersBean.java b/source/java/org/alfresco/web/bean/users/UsersBean.java index e91d1890da..2ff2b4586f 100644 --- a/source/java/org/alfresco/web/bean/users/UsersBean.java +++ b/source/java/org/alfresco/web/bean/users/UsersBean.java @@ -437,6 +437,7 @@ public class UsersBean implements IContextListener return null; } + // ------------------------------------------------------------------------------ // IContextListener implementation diff --git a/source/web/jsp/users/users.jsp b/source/web/jsp/users/users.jsp index 45dea51357..ab82d8498f 100644 --- a/source/web/jsp/users/users.jsp +++ b/source/web/jsp/users/users.jsp @@ -77,7 +77,7 @@ <%-- Current object actions --%>
- +