diff --git a/source/java/org/alfresco/repo/webdav/auth/BaseKerberosAuthenticationFilter.java b/source/java/org/alfresco/repo/webdav/auth/BaseKerberosAuthenticationFilter.java index 5423206630..b18e1de0d2 100644 --- a/source/java/org/alfresco/repo/webdav/auth/BaseKerberosAuthenticationFilter.java +++ b/source/java/org/alfresco/repo/webdav/auth/BaseKerberosAuthenticationFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2009 Alfresco Software Limited. + * Copyright (C) 2005-2009 Alfresco Software Limited. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -18,7 +18,7 @@ * As a special exception to the terms and conditions of version 2.0 of * the GPL, you may redistribute this Program in connection with Free/Libre * and Open Source Software ("FLOSS") applications as described in Alfresco's - * FLOSS exception. You should have recieved a copy of the text describing + * FLOSS exception. You should have received a copy of the text describing * the FLOSS exception, and it is also available here: * http://www.alfresco.com/legal/licensing" */ @@ -130,12 +130,12 @@ public abstract class BaseKerberosAuthenticationFilter extends BaseSSOAuthentica /* (non-Javadoc) - * @see org.alfresco.repo.web.filter.beans.BaseSSOAuthenticationFilter#afterPropertiesSet() + * @see org.alfresco.repo.webdav.auth.BaseSSOAuthenticationFilter#init() */ @Override - public void afterPropertiesSet() throws Exception + protected void init() throws ServletException { - super.afterPropertiesSet(); + super.init(); if ( m_krbRealm == null) { diff --git a/source/java/org/alfresco/repo/webdav/auth/BaseNTLMAuthenticationFilter.java b/source/java/org/alfresco/repo/webdav/auth/BaseNTLMAuthenticationFilter.java index 75f4fd4563..32c77a9651 100644 --- a/source/java/org/alfresco/repo/webdav/auth/BaseNTLMAuthenticationFilter.java +++ b/source/java/org/alfresco/repo/webdav/auth/BaseNTLMAuthenticationFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2007 Alfresco Software Limited. + * Copyright (C) 2005-2009 Alfresco Software Limited. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -18,9 +18,9 @@ * As a special exception to the terms and conditions of version 2.0 of * the GPL, you may redistribute this Program in connection with Free/Libre * and Open Source Software ("FLOSS") applications as described in Alfresco's - * FLOSS exception. You should have recieved a copy of the text describing + * FLOSS exception. You should have received a copy of the text describing * the FLOSS exception, and it is also available here: - * http://www.alfresco.com/legal/licensing + * http://www.alfresco.com/legal/licensing" */ package org.alfresco.repo.webdav.auth; @@ -128,14 +128,15 @@ public abstract class BaseNTLMAuthenticationFilter extends BaseSSOAuthentication m_mapUnknownUserToGuest = mapUnknownUserToGuest; } + /* (non-Javadoc) - * @see org.alfresco.repo.web.filter.beans.BaseSSOAuthenticationFilter#afterPropertiesSet() + * @see org.alfresco.repo.webdav.auth.BaseSSOAuthenticationFilter#init() */ @Override - public void afterPropertiesSet() throws Exception + protected void init() throws ServletException { // Call the base SSO filter initialization - super.afterPropertiesSet(); + super.init(); // Check that the authentication component supports the required mode diff --git a/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java b/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java index 627fa56a9a..149887eab2 100644 --- a/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java +++ b/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java @@ -170,7 +170,7 @@ public abstract class BaseSSOAuthenticationFilter implements DependencyInjectedF * @param active * true if the bean is active and initialization should complete */ - public void setActive(boolean active) + public final void setActive(boolean active) { this.m_isActive = active; } @@ -179,15 +179,29 @@ public abstract class BaseSSOAuthenticationFilter implements DependencyInjectedF * (non-Javadoc) * @see org.alfresco.repo.management.subsystems.ActivateableBean#isActive() */ - public boolean isActive() + public final boolean isActive() { return m_isActive; } - /* (non-Javadoc) + /* + * (non-Javadoc) * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() */ - public void afterPropertiesSet() throws Exception + public final void afterPropertiesSet() throws ServletException + { + // Don't trigger initialization if this component has been disabled + if (isActive()) + { + init(); + } + } + + /** + * Initializes the filter. Only called if the filter is active, as indicated by {@link #isActive()}. Subclasses + * should override. + */ + protected void init() throws ServletException { } diff --git a/source/java/org/alfresco/repo/webdav/auth/KerberosAuthenticationFilter.java b/source/java/org/alfresco/repo/webdav/auth/KerberosAuthenticationFilter.java index e3df1ba6d4..a8bd987dc5 100644 --- a/source/java/org/alfresco/repo/webdav/auth/KerberosAuthenticationFilter.java +++ b/source/java/org/alfresco/repo/webdav/auth/KerberosAuthenticationFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2007 Alfresco Software Limited. + * Copyright (C) 2005-2009 Alfresco Software Limited. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -18,7 +18,7 @@ * As a special exception to the terms and conditions of version 2.0 of * the GPL, you may redistribute this Program in connection with Free/Libre * and Open Source Software ("FLOSS") applications as described in Alfresco's - * FLOSS exception. You should have recieved a copy of the text describing + * FLOSS exception. You should have received a copy of the text describing * the FLOSS exception, and it is also available here: * http://www.alfresco.com/legal/licensing" */ @@ -26,6 +26,7 @@ package org.alfresco.repo.webdav.auth; import java.io.IOException; +import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; @@ -46,16 +47,17 @@ public class KerberosAuthenticationFilter extends BaseKerberosAuthenticationFilt private static Log logger = LogFactory.getLog(KerberosAuthenticationFilter.class); + /* (non-Javadoc) - * @see org.alfresco.repo.webdav.auth.BaseKerberosAuthenticationFilter#afterPropertiesSet() + * @see org.alfresco.repo.webdav.auth.BaseKerberosAuthenticationFilter#init() */ @Override - public void afterPropertiesSet() throws Exception + protected void init() throws ServletException { // Call the base Kerberos filter initialization - super.afterPropertiesSet(); + super.init(); // Enable ticket based logons diff --git a/source/java/org/alfresco/repo/webdav/auth/NTLMAuthenticationFilter.java b/source/java/org/alfresco/repo/webdav/auth/NTLMAuthenticationFilter.java index 105bfda98e..b09359e0d3 100644 --- a/source/java/org/alfresco/repo/webdav/auth/NTLMAuthenticationFilter.java +++ b/source/java/org/alfresco/repo/webdav/auth/NTLMAuthenticationFilter.java @@ -18,7 +18,7 @@ * As a special exception to the terms and conditions of version 2.0 of * the GPL, you may redistribute this Program in connection with Free/Libre * and Open Source Software ("FLOSS") applications as described in Alfresco's - * FLOSS exception. You should have recieved a copy of the text describing + * FLOSS exception. You should have received a copy of the text describing * the FLOSS exception, and it is also available here: * http://www.alfresco.com/legal/licensing" */ @@ -26,6 +26,7 @@ package org.alfresco.repo.webdav.auth; import java.io.IOException; +import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; @@ -45,14 +46,15 @@ public class NTLMAuthenticationFilter extends BaseNTLMAuthenticationFilter // Debug logging private static Log logger = LogFactory.getLog(NTLMAuthenticationFilter.class); + /* (non-Javadoc) - * @see org.alfresco.repo.webdav.auth.BaseNTLMAuthenticationFilter#afterPropertiesSet() + * @see org.alfresco.repo.webdav.auth.BaseNTLMAuthenticationFilter#init() */ @Override - public void afterPropertiesSet() throws Exception + protected void init() throws ServletException { - super.afterPropertiesSet(); + super.init(); // Enable ticket based logons