Skip to content
Snippets Groups Projects
Commit e928a6d6 authored by Thomas Mortagne's avatar Thomas Mortagne
Browse files

XWIKI-12771: Add support for list value in LDAP sync

parent 580e77b6
No related branches found
No related tags found
No related merge requests found
......@@ -1085,13 +1085,16 @@ private Map<String, Object> toMap(List<XWikiLDAPSearchAttribute> searchAttribute
List<String> listValue = new ArrayList<>();
listValue.add((String) existingValue);
listValue.add(lval);
map.put(xattr, listValue);
} else if (existingValue instanceof List) {
List<String> listValue = (List<String>) existingValue;
listValue.add(lval);
} else {
map.put(xattr, lval);
}
} else {
map.put(xattr, lval);
}
map.put(xattr, lval);
}
}
......@@ -1170,7 +1173,8 @@ protected void updateUserFromLDAP(XWikiDocument userProfile, List<XWikiLDAPSearc
it.remove();
}
} else {
Object objValue = ((BaseProperty) userObj.get(key)).getValue();
BaseProperty property = (BaseProperty) userObj.get(key);
Object objValue = property != null ? ((BaseProperty) userObj.get(key)).getValue() : null;
if (objValue != null && objValue.equals(value)) {
it.remove();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment