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/BRANCHES/DEV/5.1.N/root@125621 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Raluca Munteanu
2016-04-20 12:40:15 +00:00
parent e88080bb6d
commit de37b8662d
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;
}
}