Merged 5.2.N (5.2.1) to HEAD (5.2)

125792 rmunteanu: Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)
      125621 rmunteanu: Merged 5.0.N (5.0.4) to 5.1.N (5.1.2)
         125577 abalmus: MNT-15038 : Unexpected behavior when disabling Active Directory user (New feature to sync userAccountControl)
            - Implemented new requirements and tests


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@127813 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-06-04 11:00:24 +00:00
parent bd2cf2c35d
commit b4576ce3ca
15 changed files with 491 additions and 22 deletions

View File

@@ -31,6 +31,7 @@ import java.util.Set;
import org.alfresco.repo.management.subsystems.ActivateableBean;
import org.alfresco.repo.security.authentication.AuthenticationComponent.UserNameValidationMode;
import org.alfresco.repo.tenant.TenantContextHolder;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.util.Pair;
public class AuthenticationServiceImpl extends AbstractAuthenticationService implements ActivateableBean
@@ -42,7 +43,14 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService imp
private boolean allowsUserCreation = true;
private boolean allowsUserDeletion = true;
private boolean allowsUserPasswordChange = true;
private PersonService personService;
public void setPersonService(PersonService personService)
{
this.personService = personService;
}
public AuthenticationServiceImpl()
{
super();
@@ -336,6 +344,11 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService imp
*/
public boolean getAuthenticationEnabled(String userName) throws AuthenticationException
{
if (personService.personExists(userName))
{
return personService.isEnabled(userName);
}
return true;
}
}