LDAP: iCal autocomplete fix

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@461 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-03-19 11:23:04 +00:00
parent 83fc7db9e0
commit 69cc508651
1 changed files with 12 additions and 3 deletions

View File

@ -103,7 +103,7 @@ public class LdapConnection extends AbstractConnection {
"</dict>" +
"<key>https</key>" +
"<dict>" +
"<key>enabled</key>" +
"<key>disabled</key>" +
"<false/>" +
"<key>port</key>" +
"<integer>0</integer>" +
@ -686,6 +686,15 @@ public class LdapConnection extends AbstractConnection {
if (needObjectClasses) {
ldapPerson.put("objectClass", PERSON_OBJECT_CLASSES);
}
if (session.getAlias().equals(ldapPerson.get("uid"))) {
if (returningAttributes.contains("uidnumber")) {
ldapPerson.put("uidnumber", userName);
}
if (returningAttributes.contains("apple-generateduid")) {
ldapPerson.put("apple-generateduid", userName);
ldapPerson.put("uid", userName);
}
}
DavGatewayTray.debug("LDAP_REQ_SEARCH " + currentMessageId + " send uid=" + ldapPerson.get("uid") + baseContext + " " + ldapPerson);
sendEntry(currentMessageId, "uid=" + ldapPerson.get("uid") + baseContext, ldapPerson);
}
@ -716,7 +725,7 @@ public class LdapConnection extends AbstractConnection {
protected String hostName() {
try {
return java.net.InetAddress.getLocalHost().getHostName();
return java.net.InetAddress.getLocalHost().getCanonicalHostName();
} catch (java.net.UnknownHostException ex) {
DavGatewayTray.debug("Couldn't get hostname");
}
@ -748,7 +757,7 @@ public class LdapConnection extends AbstractConnection {
addIf(attributes, returningAttributes, "cn", hostName());
String dn = "cn=" + hostName() + ", " + COMPUTER_CONTEXT;
DavGatewayTray.debug("Sending computer context " + dn);
DavGatewayTray.debug("Sending computer context " + dn+" "+attributes);
sendEntry(currentMessageId, dn, attributes);
}