Temporary build fix. Lazy initialisation of authentication filter login page (because config service not bootstrapped at the time of authentication subsystem bootstrap). Will return with better fix.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13677 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2009-03-18 17:50:15 +00:00
parent cdfd0e7993
commit adba68fb87

View File

@@ -54,6 +54,7 @@ public class AuthenticationFilter implements DependencyInjectedFilter
{ {
private String loginPage; private String loginPage;
private ConfigService configService;
/** /**
* @param configService * @param configService
@@ -61,13 +62,22 @@ public class AuthenticationFilter implements DependencyInjectedFilter
*/ */
public void setConfigService(ConfigService configService) public void setConfigService(ConfigService configService)
{ {
ClientConfigElement clientConfig = (ClientConfigElement) configService.getGlobalConfig().getConfigElement( this.configService = configService;
ClientConfigElement.CONFIG_ELEMENT_ID); }
if (clientConfig != null) public synchronized String getLoginPage()
{
if (this.loginPage == null)
{ {
loginPage = clientConfig.getLoginPage(); ClientConfigElement clientConfig = (ClientConfigElement) this.configService.getGlobalConfig()
.getConfigElement(ClientConfigElement.CONFIG_ELEMENT_ID);
if (clientConfig != null)
{
this.loginPage = clientConfig.getLoginPage();
}
} }
return this.loginPage;
} }
public void doFilter(ServletContext context, ServletRequest req, ServletResponse res, FilterChain chain) public void doFilter(ServletContext context, ServletRequest req, ServletResponse res, FilterChain chain)
@@ -77,7 +87,7 @@ public class AuthenticationFilter implements DependencyInjectedFilter
HttpServletResponse httpRes = (HttpServletResponse) res; HttpServletResponse httpRes = (HttpServletResponse) res;
// allow the login page to proceed // allow the login page to proceed
if (!httpReq.getRequestURI().endsWith(this.loginPage)) if (!httpReq.getRequestURI().endsWith(getLoginPage()))
{ {
AuthenticationStatus status = AuthenticationHelper.authenticate(context, httpReq, httpRes, false); AuthenticationStatus status = AuthenticationHelper.authenticate(context, httpReq, httpRes, false);