Merged V2.1 to HEAD

6636: Temporary hack to fix build.  
   6637: Better handling of binary string bufs, disable link validation when poll interval is <= 0
   6638: Forgotten files for TXT to PDF transformer.
   6639: Fix for AWC-1541
   6641: Fix for WCM-792.
   6642: A little extra PropertyValue support for createNode, too.
   6643: Fix for WCM-791
   6644: Closure of AR-1528: Check concurrency handling of DuplicateChildNodeNameException
   6647: Fix WCM-794
   6648: WCM-656
   6650: Applied user supplied patch to fix AWC-1546 - Cannot mount AVM using CIFS on new alfresco installation.
   6651: Index tidy ups
   6654: Various minor updates for passthru authentication debugging and error handling.
   6657: Fix for WCM-799 (Some items selected for submission were not present)
   6659: Updated installers.
   6660: Partial fix to AWC-1524
   6661: Fix WCM-803
   6664: Including  hibernate-3.2.1.jar in $VIRTUAL_TOMCAT_HOME/server/lib/ 
   6665: adding an automated unit test for output path patterns.
   6668: Fixed to add shale-test-1.0.4.jar to Eclipse classpath (PHH oked)
   6681: Fixes WCM-811 - Lookup.getIndirectionPath() had a bit of a howler in it.
   6684: UncategorizedSQLException with the word 'deadlock' in the message is now cause for retrying a transaction.
   6691: Fix for WCM-813 (lock not removed when expiration date set and no workflow on web project)
   6696: Imporved SSO filters for SiteMinder etc + test filter
   6697: Support for scheduled import
   6699: Fix for the compliation target:  compile-benchmarkframework 
   6701: Fix for 1.6 JVMs (1.5 gets by with lucky ordering)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6749 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-09-11 04:18:53 +00:00
parent f279d99d80
commit ac03bb5f8c
14 changed files with 486 additions and 728 deletions

View File

@@ -92,42 +92,6 @@ public class HTTPRequestAuthenticationFilter extends AbstractAuthenticationFilte
private Pattern authPattern = null;
/**
* Define the HTTP header that contains the user name
*
* @param httpServletRequestAuthHeaderName
*/
public HTTPRequestAuthenticationFilter(String httpServletRequestAuthHeaderName)
{
this(httpServletRequestAuthHeaderName, null);
}
/**
* Define the header that contains the user name and how to extract the user name.
*
* @param httpServletRequestAuthHeaderName
* @param authPatternString
*/
public HTTPRequestAuthenticationFilter(String httpServletRequestAuthHeaderName, String authPatternString)
{
super();
assert (httpServletRequestAuthHeaderName != null);
this.httpServletRequestAuthHeaderName = httpServletRequestAuthHeaderName;
this.authPatternString = authPatternString;
if (this.authPatternString != null)
{
try
{
authPattern = Pattern.compile(this.authPatternString);
}
catch (PatternSyntaxException e)
{
logger.warn("Invalid pattern: " + this.authPatternString, e);
authPattern = null;
}
}
}
public void destroy()
{
// Nothing to do
@@ -341,27 +305,51 @@ public class HTTPRequestAuthenticationFilter extends AbstractAuthenticationFilte
I18NUtil.setLocale(Application.getLanguage(httpSess));
}
public void init(FilterConfig config) throws ServletException
{
// Save the context
this.context = config.getServletContext();
// Setup the authentication context
WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(context);
ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
transactionService = serviceRegistry.getTransactionService();
nodeService = serviceRegistry.getNodeService();
authService = serviceRegistry.getAuthenticationService();
transactionService = serviceRegistry.getTransactionService();
personService = (PersonService) ctx.getBean("PersonService"); // transactional and permission-checked
authComponent = (AuthenticationComponent) ctx.getBean("authenticationComponent");
authService = (AuthenticationService) ctx.getBean("authenticationService");
personService = (PersonService) ctx.getBean("personService");
// Get a list of the available locales
ConfigService configServiceService = (ConfigService) ctx.getBean("webClientConfigService");
LanguagesConfigElement configElement = (LanguagesConfigElement) configServiceService.getConfig("Languages")
.getConfigElement(LanguagesConfigElement.CONFIG_ELEMENT_ID);
m_languages = configElement.getLanguages();
authPattern = Pattern.compile(authPatternString);
httpServletRequestAuthHeaderName = config.getInitParameter("httpServletRequestAuthHeaderName");
if(httpServletRequestAuthHeaderName == null)
{
httpServletRequestAuthHeaderName = "x-user";
}
this.authPatternString = config.getInitParameter("authPatternString");
if (this.authPatternString != null)
{
try
{
authPattern = Pattern.compile(this.authPatternString);
}
catch (PatternSyntaxException e)
{
logger.warn("Invalid pattern: " + this.authPatternString, e);
authPattern = null;
}
}
}
/**