From 420fd612673c02c94c004c92cc349d74bb5a782f Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Thu, 18 Dec 2008 12:06:12 +0000 Subject: [PATCH] Merged V3.0 to HEAD 11849: Code/doc clean-up 11850: Show Folders and Simple View buttons not showing correct caption for overridden default 11851: DocLib "move" action needs delete permission 11852: ETHREEOH-662 Incorrect display of 'Invite', 'Edit Site Details', 'Customize Site', 'Customize Dashboard' buttons group in several cases 11855: Removal of obsolete PageRenderer source and config 11856: Log4j added to classpath for Eclipse project build (for recent NTLM filter logging changes) 11857: Added logging settings for various useful connector/ntlm classes 11858: Fixed the passthru authentication logic when a domain name is not specified by the client. The first passthru server that does not have a domain name set will be used. 11868: Output errors message(s) when the Share URL is configured incorrectly 11871: Removed file checked in accidentally, this is generated by continuous build 11872: Changed the WebDAV user object session attribute so that it does not clash with the web-client user attribute. The WebDAV user object is not derived from the User object that the web-client uses. 11874: Fixed ETHREEOH-732: Enabling benchmark-override-context.xml leads to ClassNotFoundException 11875: Fixed ETHREEOH-733: Spring jar missing benchmark remote client git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12484 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../auth/BaseSSOAuthenticationFilter.java | 34 +++++++++++++++++-- .../auth/KerberosAuthenticationFilter.java | 4 +++ .../webdav/auth/NTLMAuthenticationFilter.java | 4 +++ .../alfresco/repo/webdav/auth/WebDAVUser.java | 2 -- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java b/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java index d27cd0be03..6f0baddd61 100644 --- a/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java +++ b/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java @@ -78,6 +78,10 @@ public abstract class BaseSSOAuthenticationFilter implements Filter // Note: copied from the AbstractAuthenticationFilter to avoid project dependencies protected static final String NO_AUTH_REQUIRED = "alfNoAuthRequired"; + + // Attribute used by WebDAV filters for storing the WebDAV user details + + protected static final String WEBDAV_AUTH_USER = "_alfDAVAuthTicket"; // Allow an authenitcation ticket to be passed as part of a request to bypass authentication @@ -115,6 +119,10 @@ public abstract class BaseSSOAuthenticationFilter implements Filter private boolean m_ticketLogons; + // User object attribute name + + private String m_userAttributeName = AUTHENTICATION_USER; + /** * Initialize the filter * @@ -236,7 +244,27 @@ public abstract class BaseSSOAuthenticationFilter implements Filter */ protected SessionUser getSessionUser(HttpSession session) { - return (SessionUser)session.getAttribute( AUTHENTICATION_USER); + return (SessionUser)session.getAttribute( getUserAttributeName()); + } + + /** + * Return the user object session attribute name + * + * @return String + */ + protected final String getUserAttributeName() + { + return m_userAttributeName; + } + + /** + * Set the user object attribute name + * + * @param userAttr String + */ + protected final void setUserAttributeName( String userAttr) + { + m_userAttributeName = userAttr; } /** @@ -313,7 +341,7 @@ public abstract class BaseSSOAuthenticationFilter implements Filter // Store the user on the session - session.setAttribute( AUTHENTICATION_USER, user); + session.setAttribute( getUserAttributeName(), user); session.setAttribute( LOGIN_EXTERNAL_AUTH, Boolean.TRUE); return user; @@ -442,7 +470,7 @@ public abstract class BaseSSOAuthenticationFilter implements Filter // Store the User object in the Session - the authentication servlet will then proceed - req.getSession().setAttribute(AUTHENTICATION_USER, user); + req.getSession().setAttribute( getUserAttributeName(), user); } // Indicate the ticket parameter was specified, and valid diff --git a/source/java/org/alfresco/repo/webdav/auth/KerberosAuthenticationFilter.java b/source/java/org/alfresco/repo/webdav/auth/KerberosAuthenticationFilter.java index 60646fdcea..c2ea5ca0d2 100644 --- a/source/java/org/alfresco/repo/webdav/auth/KerberosAuthenticationFilter.java +++ b/source/java/org/alfresco/repo/webdav/auth/KerberosAuthenticationFilter.java @@ -63,6 +63,10 @@ public class KerberosAuthenticationFilter extends BaseKerberosAuthenticationFilt // Enable ticket based logons setTicketLogons( true); + + // Use the WebDAV specific attribute to store the user details + + setUserAttributeName( WEBDAV_AUTH_USER); } /* (non-Javadoc) diff --git a/source/java/org/alfresco/repo/webdav/auth/NTLMAuthenticationFilter.java b/source/java/org/alfresco/repo/webdav/auth/NTLMAuthenticationFilter.java index 4cfd73751f..7619f2ada2 100644 --- a/source/java/org/alfresco/repo/webdav/auth/NTLMAuthenticationFilter.java +++ b/source/java/org/alfresco/repo/webdav/auth/NTLMAuthenticationFilter.java @@ -60,6 +60,10 @@ public class NTLMAuthenticationFilter extends BaseNTLMAuthenticationFilter // Enable ticket based logons setTicketLogons( true); + + // Use the WebDAV specific attribute to store the user details + + setUserAttributeName( WEBDAV_AUTH_USER); } /* (non-Javadoc) diff --git a/source/java/org/alfresco/repo/webdav/auth/WebDAVUser.java b/source/java/org/alfresco/repo/webdav/auth/WebDAVUser.java index 9dece83f05..acde710031 100644 --- a/source/java/org/alfresco/repo/webdav/auth/WebDAVUser.java +++ b/source/java/org/alfresco/repo/webdav/auth/WebDAVUser.java @@ -25,8 +25,6 @@ package org.alfresco.repo.webdav.auth; -import java.io.Serializable; - import org.alfresco.repo.SessionUser; import org.alfresco.service.cmr.repository.NodeRef;