mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-15 15:02:20 +00:00
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/BRANCHES/DEV/5.2.N/root@125792 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -848,6 +848,9 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
|
||||
properties.put(ContentModel.PROP_USERNAME, realUserName);
|
||||
}
|
||||
}
|
||||
|
||||
checkIfPersonShouldBeDisabledAndSetAspect(personNode, properties);
|
||||
|
||||
Map<QName, Serializable> update = nodeService.getProperties(personNode);
|
||||
update.putAll(properties);
|
||||
|
||||
@@ -987,6 +990,8 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
|
||||
beforeCreateNodeValidationBehaviour.enable();
|
||||
}
|
||||
|
||||
checkIfPersonShouldBeDisabledAndSetAspect(personRef, properties);
|
||||
|
||||
if (zones != null)
|
||||
{
|
||||
for (String zone : zones)
|
||||
@@ -1004,6 +1009,26 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
|
||||
return personRef;
|
||||
}
|
||||
|
||||
private void checkIfPersonShouldBeDisabledAndSetAspect(NodeRef person, Map<QName, Serializable> properties)
|
||||
{
|
||||
if (properties.get(ContentModel.PROP_ENABLED) != null)
|
||||
{
|
||||
boolean isEnabled = Boolean.parseBoolean(properties.get(ContentModel.PROP_ENABLED).toString());
|
||||
|
||||
if (isEnabled)
|
||||
{
|
||||
if (nodeService.hasAspect(person, ContentModel.ASPECT_PERSON_DISABLED))
|
||||
{
|
||||
nodeService.removeAspect(person, ContentModel.ASPECT_PERSON_DISABLED);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nodeService.addAspect(person, ContentModel.ASPECT_PERSON_DISABLED, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
Reference in New Issue
Block a user