mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixes for ALFCOM-2910 and ALFCOM-2986
- Also fixes an underlying issue where RepositoryAuthenticationDao.getUserOrNull() method cannot handle username's containing quotes during the Lucene based lookup git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14841 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -57,6 +57,7 @@ import org.alfresco.service.namespace.NamespacePrefixResolver;
|
|||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||||
import org.springframework.dao.DataAccessException;
|
import org.springframework.dao.DataAccessException;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
public class RepositoryAuthenticationDao implements MutableAuthenticationDao
|
public class RepositoryAuthenticationDao implements MutableAuthenticationDao
|
||||||
{
|
{
|
||||||
@@ -152,18 +153,14 @@ public class RepositoryAuthenticationDao implements MutableAuthenticationDao
|
|||||||
|
|
||||||
public NodeRef getUserOrNull(String searchUserName)
|
public NodeRef getUserOrNull(String searchUserName)
|
||||||
{
|
{
|
||||||
if (searchUserName == null)
|
if (searchUserName == null || searchUserName.length() == 0)
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (searchUserName.length() == 0)
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
SearchParameters sp = new SearchParameters();
|
SearchParameters sp = new SearchParameters();
|
||||||
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
|
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
|
||||||
sp.setQuery("@usr\\:username:\"" + searchUserName + "\"");
|
sp.setQuery("@usr\\:username:\"" + StringUtils.delete(searchUserName, "\"") + "\"");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user