From 8f183cdd2c3c835e6398c52e7dad394b83363905 Mon Sep 17 00:00:00 2001 From: mguessan Date: Wed, 3 Nov 2010 22:43:18 +0000 Subject: [PATCH] LDAP: additional attributes for iPad git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1523 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/ldap/LdapConnection.java | 8 ++++++++ src/test/davmail/ldap/TestLdap.java | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/java/davmail/ldap/LdapConnection.java b/src/java/davmail/ldap/LdapConnection.java index 8048d4e7..23d3005c 100644 --- a/src/java/davmail/ldap/LdapConnection.java +++ b/src/java/davmail/ldap/LdapConnection.java @@ -208,11 +208,13 @@ public class LdapConnection extends AbstractConnection { LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("nsaimid", "im"); LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("nscpaimscreenname", "im"); LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("apple-imhandle", "im"); + LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("imhandle", "im"); LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("xmozillasecondemail", "smtpemail2"); LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("notes", "description"); LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("pagerphone", "pager"); + LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("pager", "pager"); LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("locality", "l"); LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("homephone", "homePhone"); @@ -255,6 +257,12 @@ public class LdapConnection extends AbstractConnection { LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("homedirectory", null); LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("authauthority", null); + LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("applefloor", null); + LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("buildingname", null); + LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("destinationindicator", null); + LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("postaladdress", null); + LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("homepostaladdress", null); + // iCal search attribute LDAP_TO_CONTACT_ATTRIBUTE_MAP.put("apple-serviceslocator", "apple-serviceslocator"); } diff --git a/src/test/davmail/ldap/TestLdap.java b/src/test/davmail/ldap/TestLdap.java index e818c50d..94533d1e 100644 --- a/src/test/davmail/ldap/TestLdap.java +++ b/src/test/davmail/ldap/TestLdap.java @@ -144,5 +144,12 @@ public class TestLdap extends AbstractExchangeSessionTestCase { searchControls.setReturningAttributes(new String[]{"givenName"}); NamingEnumeration searchResults = ldapContext.search("ou=people", "(cn=*a*)", searchControls); } + + public void testSearchIPad() throws NamingException { + SearchControls searchControls = new SearchControls(); + searchControls.setSearchScope(SearchControls.ONELEVEL_SCOPE); + searchControls.setReturningAttributes(new String[]{"postalcode", "labeleduri", "street", "givenname", "telephonenumber", "facsimiletelephonenumber", "title", "imhandle", "homepostaladdress", "st", "homephone", "applefloor", "jpegphoto", "pager", "mail", "sn", "buildingname", "ou", "destinationindicator", "c", "o", "l", "co", "postaladdress", "cn", "mobile"}); + NamingEnumeration searchResults = ldapContext.search("ou=people", "(|(mail=Test*)(cn=Test*)(givenname=Test*)(sn=Test*))", searchControls); + } }