mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixes for:
- ALF-1692 "Error message appears when trying to log in with incorrect tenant-username" - ALF-3489 "Inconsistency in how Alfresco handles case sensitivity in tenant creation and tenant login" git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29547 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -31,6 +31,7 @@ import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
import org.springframework.extensions.surf.util.ParameterCheck;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -564,8 +565,7 @@ public class MultiTServiceImpl implements TenantService
|
||||
int idx = username.lastIndexOf(SEPARATOR);
|
||||
if ((idx > 0) && (idx < (username.length()-1)))
|
||||
{
|
||||
String tenantDomain = username.substring(idx+1);
|
||||
|
||||
String tenantDomain = getTenantDomain(username.substring(idx+1));
|
||||
checkTenantEnabled(tenantDomain);
|
||||
|
||||
return tenantDomain;
|
||||
@@ -592,6 +592,7 @@ public class MultiTServiceImpl implements TenantService
|
||||
// Check that all the passed values are not null
|
||||
ParameterCheck.mandatory("name", name);
|
||||
|
||||
name = getTenantDomain(name);
|
||||
String tenantDomain = getCurrentUserDomain();
|
||||
|
||||
String nameDomain = DEFAULT_DOMAIN;
|
||||
@@ -634,7 +635,8 @@ public class MultiTServiceImpl implements TenantService
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Invalid tenant domain: " + tenantDomain);
|
||||
}
|
||||
|
||||
|
||||
tenantDomain = getTenantDomain(tenantDomain);
|
||||
return baseUsername + SEPARATOR + tenantDomain;
|
||||
}
|
||||
}
|
||||
@@ -653,6 +655,7 @@ public class MultiTServiceImpl implements TenantService
|
||||
*/
|
||||
public Tenant getTenant(String tenantDomain)
|
||||
{
|
||||
tenantDomain = getTenantDomain(tenantDomain);
|
||||
Tenant tenant = tenantsCache.get(tenantDomain);
|
||||
if (tenant == null)
|
||||
{
|
||||
@@ -708,4 +711,10 @@ public class MultiTServiceImpl implements TenantService
|
||||
tenantsCache.remove(tenantDomain);
|
||||
}
|
||||
|
||||
protected String getTenantDomain(String tenantDomain)
|
||||
{
|
||||
ParameterCheck.mandatory("tenantDomain", tenantDomain);
|
||||
return tenantDomain.toLowerCase(I18NUtil.getLocale());
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user