1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 11:12:22 -05:00

LDAP: exclude non contact entries from search, fiw map key and sn copy for iCal

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@705 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-09-07 12:24:50 +00:00
parent e0b1d6c954
commit 4ace24e406
2 changed files with 7 additions and 6 deletions

View File

@ -2642,9 +2642,10 @@ public class ExchangeSession {
"\"urn:schemas:contacts:telephoneNumber\"," +
"\"urn:schemas:contacts:title\"," +
"\"urn:schemas:httpmail:textdescription\"")
.append(" FROM Scope('SHALLOW TRAVERSAL OF \"").append(contactsUrl).append("\"')\n");
.append(" FROM Scope('SHALLOW TRAVERSAL OF \"").append(contactsUrl).append("\"')\n")
.append(" WHERE \"DAV:contentclass\" = 'urn:content-classes:person' \n");
if (searchFilter != null && searchFilter.length() > 0) {
searchRequest.append(" WHERE ").append(searchFilter);
searchRequest.append(" AND ").append(searchFilter);
}
MultiStatusResponse[] responses = DavGatewayHttpClientFacade.executeSearchMethod(
httpClient, URIUtil.encodePath(contactsUrl), searchRequest.toString());
@ -2687,7 +2688,7 @@ public class ExchangeSession {
results.put(item.get("uid"), item);
}
LOGGER.debug("contactFind " + searchFilter + ": " + results.size() + " result(s)");
LOGGER.debug("contactFind " + ((searchFilter==null)?"":searchFilter) + ": " + results.size() + " result(s)");
return results;
}

View File

@ -553,7 +553,7 @@ public class LdapConnection extends AbstractConnection {
if (ldapFilter.isFullSearch()) {
// append personal contacts first
for (Map<String, String> person : session.contactFind(null).values()) {
persons.put(person.get("AN"), person);
persons.put(person.get("uid"), person);
if (persons.size() == sizeLimit) {
break;
}
@ -575,7 +575,7 @@ public class LdapConnection extends AbstractConnection {
} else {
// append personal contacts first
for (Map<String, String> person : session.contactFind(ldapFilter.getContactSearchFilter()).values()) {
persons.put(person.get("AN"), person);
persons.put(person.get("uid"), person);
if (persons.size() == sizeLimit) {
break;
}
@ -804,7 +804,7 @@ public class LdapConnection extends AbstractConnection {
}
// iCal: copy cn to sn
if (iCalSearch && ldapPerson.get("cn") != null) {
if (iCalSearch && ldapPerson.get("cn") != null && returningAttributes.contains("sn")) {
ldapPerson.put("sn", ldapPerson.get("cn"));
}