mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.2 to HEAD
16652: Fix ETHREEOH-1052 - usage is not displayed (for admin & guest - after initial bootstrap, before restart) 16778: Fix ETHREEOH-3009 - Patch required for UserUsageTrackingComponent so that new queries work on upgraded repository git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16922 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2008 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
|
||||
@@ -24,8 +24,8 @@
|
||||
*/
|
||||
package org.alfresco.repo.security.authentication;
|
||||
|
||||
import java.util.Stack;
|
||||
|
||||
import java.util.Stack;
|
||||
|
||||
import net.sf.acegisecurity.Authentication;
|
||||
import net.sf.acegisecurity.GrantedAuthority;
|
||||
import net.sf.acegisecurity.GrantedAuthorityImpl;
|
||||
@@ -37,10 +37,10 @@ import net.sf.acegisecurity.providers.dao.User;
|
||||
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.service.cmr.security.PermissionService;
|
||||
import org.alfresco.util.EqualsHelper;
|
||||
import org.alfresco.util.EqualsHelper;
|
||||
import org.alfresco.util.log.NDC;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
/**
|
||||
@@ -508,6 +508,7 @@ public class AuthenticationUtil implements InitializingBean
|
||||
}
|
||||
AuthenticationUtil.setRunAsUser(uid);
|
||||
}
|
||||
logNDC(uid);
|
||||
result = runAsWork.doWork();
|
||||
return result;
|
||||
}
|
||||
@@ -528,12 +529,15 @@ public class AuthenticationUtil implements InitializingBean
|
||||
if (originalFullAuthentication == null)
|
||||
{
|
||||
AuthenticationUtil.clearCurrentSecurityContext();
|
||||
logNDC(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
AuthenticationUtil.setFullAuthentication(originalFullAuthentication);
|
||||
AuthenticationUtil.setRunAsAuthentication(originalRunAsAuthentication);
|
||||
}
|
||||
|
||||
logNDC(getUserName(originalFullAuthentication));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -599,22 +603,25 @@ public class AuthenticationUtil implements InitializingBean
|
||||
{
|
||||
NDC.remove();
|
||||
|
||||
if (isMtEnabled())
|
||||
if (userName != null)
|
||||
{
|
||||
String[] parts = splitUserTenant(userName);
|
||||
if (parts.length == 2)
|
||||
if (isMtEnabled())
|
||||
{
|
||||
NDC.push("Tenant:" + parts[1] + " User:" + parts[0]);
|
||||
String[] parts = splitUserTenant(userName);
|
||||
if (parts.length == 2)
|
||||
{
|
||||
NDC.push("Tenant:" + parts[1] + " User:" + parts[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
NDC.push("User:" + userName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NDC.push("User:" + userName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NDC.push("User:" + userName);
|
||||
}
|
||||
}
|
||||
|
||||
private static String[] splitUserTenant(String userName)
|
||||
|
Reference in New Issue
Block a user