From b952c4e43a77c4b633fd7ec5ccf29d8c62f045c4 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 14 Aug 2006 20:35:11 +0000 Subject: [PATCH] Monotone-Parent: 326d1c3e09ab40b1884b684c1cfb0feca9ae3c0d Monotone-Revision: b77c80d28969876aa496ff580015697daf5bbc94 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-08-14T20:35:11 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ SoObjects/Contacts/SOGoContactLDAPFolder.h | 2 ++ SoObjects/Contacts/SOGoContactLDAPFolder.m | 22 +++++++++++++++++++--- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82939a78e..e87a5f49e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2006-08-14 Wolfgang Sourdeau + * SoObjects/Contacts/SOGoContactLDAPFolder.m + ([SOGoContactLDAPFolder + -LDAPSetHostname:setPort:setBindDN:setBindPW:setContactIdentifier: + setUserIdentifier:setRootDN:]): an LDAP field specifying the + loginname of the users can now be specified. + * UI/WebServerResources/generic.js: added code to manage contact lists through the new implementation of the UIxContactSelector. diff --git a/SoObjects/Contacts/SOGoContactLDAPFolder.h b/SoObjects/Contacts/SOGoContactLDAPFolder.h index ff29ea1af..88a89063f 100644 --- a/SoObjects/Contacts/SOGoContactLDAPFolder.h +++ b/SoObjects/Contacts/SOGoContactLDAPFolder.h @@ -33,6 +33,7 @@ { NGLdapConnection *connection; NSString *contactIdentifier; + NSString *userIdentifier; NSString *rootDN; NSString *displayName; NSMutableDictionary *entries; @@ -48,6 +49,7 @@ setBindDN: (NSString *) aBindDN setBindPW: (NSString *) aBindPW setContactIdentifier: (NSString *) aCI + setUserIdentifier: (NSString *) aUI setRootDN: (NSString *) aRootDN; @end diff --git a/SoObjects/Contacts/SOGoContactLDAPFolder.m b/SoObjects/Contacts/SOGoContactLDAPFolder.m index cf2e0169e..966576381 100644 --- a/SoObjects/Contacts/SOGoContactLDAPFolder.m +++ b/SoObjects/Contacts/SOGoContactLDAPFolder.m @@ -42,6 +42,13 @@ #import "SOGoContactLDAPEntry.h" #import "SOGoContactLDAPFolder.h" +#define folderListingFields [NSArray arrayWithObjects: @"c_name", @"cn", \ + @"sn", @"givenname", @"l", \ + @"mail", @"telephonenumber", \ + @"mailNickname", \ + @"sAMAccountName", \ + nil] + @class WOContext; @implementation SOGoContactLDAPFolder @@ -66,6 +73,7 @@ { connection = nil; contactIdentifier = nil; + userIdentifier = nil; rootDN = nil; entries = nil; } @@ -94,6 +102,8 @@ } if (contactIdentifier) [contactIdentifier release]; + if (userIdentifier) + [userIdentifier release]; if (rootDN) [rootDN release]; if (entries) @@ -120,6 +130,7 @@ setBindDN: (NSString *) aBindDN setBindPW: (NSString *) aBindPW setContactIdentifier: (NSString *) aCI + setUserIdentifier: (NSString *) aUI setRootDN: (NSString *) aRootDN; { connection = [[NGLdapConnection alloc] initWithHostName: aHostname @@ -134,6 +145,9 @@ if (contactIdentifier) [contactIdentifier release]; contactIdentifier = [aCI copy]; + if (userIdentifier) + [userIdentifier release]; + userIdentifier = [aUI copy]; } - (NGLdapConnection *) LDAPconnection @@ -149,7 +163,9 @@ - (NSArray *) _searchAttributes { return [NSArray arrayWithObjects: - @"title", + contactIdentifier, + userIdentifier, + @"title", @"company", @"o", @"modifytimestamp", @@ -191,7 +207,6 @@ @"postOfficeBox", @"homePhone", @"cn", - contactIdentifier, @"commonname", @"givenName", @"mozillaHomePostalCode", @@ -354,7 +369,8 @@ while (entry) { [records addObject: [entry asDictionaryWithAttributeNames: nil - andCName: @"cn"]]; + withUID: userIdentifier + andCName: contactIdentifier]]; entry = [contacts nextObject]; }