1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-08-13 16:53:51 -04:00

LDAP: fix contact search, do not send unrequested attributes

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@701 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-09-06 17:42:12 +00:00
parent 7bfc952437
commit 8183986842

View File

@ -789,9 +789,17 @@ public class LdapConnection extends AbstractConnection {
// convert Contact entries
for (Map.Entry<String, String> entry : person.entrySet()) {
String contactAttribute = entry.getKey();
// get converted attribute name
String ldapAttribute = CONTACT_ATTRIBUTE_MAP.get(contactAttribute);
// no conversion, use exchange attribute name
if (ldapAttribute == null){
ldapAttribute = contactAttribute;
}
String value = entry.getValue();
ldapPerson.put(ldapAttribute == null ? contactAttribute : ldapAttribute, value);
if (value != null
&& (returnAllAttributes || returningAttributes.contains(ldapAttribute.toLowerCase()))) {
ldapPerson.put(ldapAttribute, value);
}
}
}