MNT-14026: LDAP sync fails to update attribute's value deletion

- Update to null, the node properties for which the corresponding LDAP attribute is missing.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@128140 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Constantin Popa
2016-06-13 11:36:19 +00:00
parent 1cabca593c
commit 65baa06360
2 changed files with 157 additions and 14 deletions

View File

@@ -1150,7 +1150,9 @@ public class LDAPUserRegistry implements UserRegistry, LDAPNameResolver, Initial
String attributeName = attributeMapping.get(key);
if (attributeName != null)
{
Attribute attribute = ldapAttributes.get(attributeName);
Attribute attribute = ldapAttributes.get(attributeName);
String defaultAttribute = attributeDefaults.get(key);
if (attribute != null)
{
String value = (String) attribute.get(0);
@@ -1159,13 +1161,14 @@ public class LDAPUserRegistry implements UserRegistry, LDAPNameResolver, Initial
properties.put(keyQName, value);
}
}
else
else if (defaultAttribute != null)
{
String defaultValue = attributeDefaults.get(key);
if (defaultValue != null)
{
properties.put(keyQName, defaultValue);
}
properties.put(keyQName, defaultAttribute);
}
else
{
// Make sure that a 2nd sync, updates deleted ldap attributes(MNT-14026)
properties.put(keyQName, null);
}
}
else