mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-04 11:05:27 +00:00
See ChangeLog
Monotone-Parent: e290f01a5006f7dc9a5dec96622f04d6bcdb008c Monotone-Revision: ee481548c9940bbd1cea617d613818d78b722854 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2009-04-13T15:01:21 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
2009-04-13 Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||
|
||||
* SoObjects/Contacts/SOGoContactLDAPFolder.m and
|
||||
SoObjects/SOGo/LDAPSource.h: renamed allEntryIDs to
|
||||
allEntryUIDs and we now use the UID instead of the ID
|
||||
when returning all entries since when the callback
|
||||
is invoked, we use the UID and NOT the ID.
|
||||
|
||||
|
||||
* SoObjects/SOGo/LDAPSource.m: cleaned up and
|
||||
also correctly implemented -lookupContactEntry.
|
||||
* SoObjects/Contacts/SOGoContactLDAPFolder.m:
|
||||
we now use the correctly implemented -lookupContactEntry
|
||||
method instead of -lookupContactEntryWithUIDorEmail
|
||||
|
||||
2009-04-09 Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||
|
||||
* Reverted previous patch and provided the correct
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
|
||||
if (!obj)
|
||||
{
|
||||
ldifEntry = [ldapSource lookupContactEntryWithUIDorEmail: objectName];
|
||||
ldifEntry = [ldapSource lookupContactEntry: objectName];
|
||||
if (ldifEntry)
|
||||
obj = [SOGoContactLDIFEntry contactEntryWithName: objectName
|
||||
withLDIFEntry: ldifEntry
|
||||
@@ -190,7 +190,7 @@
|
||||
|
||||
- (NSArray *) toOneRelationshipKeys
|
||||
{
|
||||
return [ldapSource allEntryUIDs];
|
||||
return [ldapSource allEntryIDs];
|
||||
}
|
||||
|
||||
- (NSArray *) _flattenedRecords: (NSArray *) records
|
||||
|
||||
@@ -72,9 +72,9 @@
|
||||
- (BOOL) checkLogin: (NSString *) login
|
||||
andPassword: (NSString *) password;
|
||||
|
||||
- (NSDictionary *) lookupContactEntry: (NSString *) entryID;
|
||||
- (NSDictionary *) lookupContactEntry: (NSString *) theID;
|
||||
- (NSDictionary *) lookupContactEntryWithUIDorEmail: (NSString *) entryID;
|
||||
- (NSArray *) allEntryUIDs;
|
||||
- (NSArray *) allEntryIDs;
|
||||
- (NSArray *) fetchContactsMatching: (NSString *) filter;
|
||||
- (NSString *) sourceID;
|
||||
|
||||
|
||||
+39
-18
@@ -355,7 +355,7 @@ static NSLock *lock;
|
||||
qualifier: qualifier
|
||||
attributes: attributes];
|
||||
}
|
||||
else /* else we do like it was before */
|
||||
else
|
||||
{
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
@@ -492,11 +492,11 @@ static NSLock *lock;
|
||||
|
||||
- (NSArray *) _searchAttributes
|
||||
{
|
||||
NSUserDefaults *ud;
|
||||
NSString *contactInfo;
|
||||
|
||||
if (!searchAttributes)
|
||||
{
|
||||
NSUserDefaults *ud;
|
||||
NSString *contactInfo;
|
||||
|
||||
ud = [NSUserDefaults standardUserDefaults];
|
||||
searchAttributes = [NSMutableArray new];
|
||||
if (CNField)
|
||||
@@ -517,7 +517,7 @@ static NSLock *lock;
|
||||
return searchAttributes;
|
||||
}
|
||||
|
||||
- (NSArray *) allEntryUIDs
|
||||
- (NSArray *) allEntryIDs
|
||||
{
|
||||
NSMutableArray *ids;
|
||||
NSEnumerator *entries;
|
||||
@@ -534,7 +534,7 @@ static NSLock *lock;
|
||||
{
|
||||
NSArray *attributes;
|
||||
|
||||
attributes = [NSArray arrayWithObject: UIDField];
|
||||
attributes = [NSArray arrayWithObject: IDField];
|
||||
if ([_scope caseInsensitiveCompare: @"BASE"] == NSOrderedSame)
|
||||
entries = [ldapConnection baseSearchAtBaseDN: baseDN
|
||||
qualifier: nil
|
||||
@@ -543,7 +543,7 @@ static NSLock *lock;
|
||||
entries = [ldapConnection flatSearchAtBaseDN: baseDN
|
||||
qualifier: nil
|
||||
attributes: attributes];
|
||||
else /* else we do like it was before */
|
||||
else
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier: nil
|
||||
attributes: attributes];
|
||||
@@ -556,7 +556,7 @@ static NSLock *lock;
|
||||
currentEntry = [entries nextObject];
|
||||
while (currentEntry)
|
||||
{
|
||||
value = [[currentEntry attributeWithName: UIDField]
|
||||
value = [[currentEntry attributeWithName: IDField]
|
||||
stringValueAtIndex: 0];
|
||||
if ([value length] > 0)
|
||||
[ids addObject: value];
|
||||
@@ -714,7 +714,7 @@ static NSLock *lock;
|
||||
return contacts;
|
||||
}
|
||||
|
||||
- (NSDictionary *) lookupContactEntry: (NSString *) entryID;
|
||||
- (NSDictionary *) lookupContactEntry: (NSString *) theID
|
||||
{
|
||||
NSDictionary *contactEntry;
|
||||
NGLdapEntry *ldapEntry;
|
||||
@@ -725,13 +725,34 @@ static NSLock *lock;
|
||||
|
||||
contactEntry = nil;
|
||||
|
||||
if ([entryID length] > 0)
|
||||
if ([theID length] > 0)
|
||||
{
|
||||
if ([self _initLDAPConnection])
|
||||
ldapEntry
|
||||
= [ldapConnection entryAtDN: [NSString stringWithFormat: @"%@=%@,%@",
|
||||
IDField, entryID, baseDN]
|
||||
attributes: [self _searchAttributes]];
|
||||
{
|
||||
NSEnumerator *entries;
|
||||
EOQualifier *qualifier;
|
||||
NSArray *attributes;
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat: @"(%@='%@')", IDField, theID];
|
||||
qualifier = [EOQualifier qualifierWithQualifierFormat: s];
|
||||
attributes = [self _searchAttributes];
|
||||
|
||||
if ([_scope caseInsensitiveCompare: @"BASE"] == NSOrderedSame)
|
||||
entries = [ldapConnection baseSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: attributes];
|
||||
else if ([_scope caseInsensitiveCompare: @"ONE"] == NSOrderedSame)
|
||||
entries = [ldapConnection flatSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: attributes];
|
||||
else
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: attributes];
|
||||
|
||||
ldapEntry = [entries nextObject];
|
||||
}
|
||||
else
|
||||
ldapEntry = nil;
|
||||
|
||||
@@ -748,11 +769,10 @@ static NSLock *lock;
|
||||
return contactEntry;
|
||||
}
|
||||
|
||||
- (NSDictionary *) lookupContactEntryWithUIDorEmail: (NSString *) uid;
|
||||
- (NSDictionary *) lookupContactEntryWithUIDorEmail: (NSString *) uid
|
||||
{
|
||||
NSDictionary *contactEntry;
|
||||
NGLdapEntry *ldapEntry;
|
||||
NSEnumerator *entries;
|
||||
|
||||
#if defined(THREADSAFE)
|
||||
[lock lock];
|
||||
@@ -763,7 +783,8 @@ static NSLock *lock;
|
||||
if ([uid length] > 0)
|
||||
{
|
||||
if ([self _initLDAPConnection])
|
||||
{
|
||||
{
|
||||
NSEnumerator *entries;
|
||||
EOQualifier *qualifier;
|
||||
NSArray *attributes;
|
||||
|
||||
@@ -778,7 +799,7 @@ static NSLock *lock;
|
||||
entries = [ldapConnection flatSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: attributes];
|
||||
else /* else we do like it was before */
|
||||
else
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: attributes];
|
||||
|
||||
@@ -40,4 +40,4 @@
|
||||
</var:foreach>
|
||||
</tbody>
|
||||
</table>
|
||||
</var:component>
|
||||
</var:component>
|
||||
|
||||
Reference in New Issue
Block a user