See ChangeLog
Monotone-Parent: 2ff14c56a17684b19765d7bcced2675ab78095b7 Monotone-Revision: a638a09e849ae382ffe2e645259462cb8007bccd Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2008-11-24T21:25:42 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
57765e6911
commit
b3e5fb6c92
|
@ -1,3 +1,7 @@
|
|||
2008-11-24 Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||
|
||||
* We now sort the results in the subsription window
|
||||
|
||||
2008-11-24 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/SOGoParentFolder.m ([SOGoParentFolder
|
||||
|
|
|
@ -103,6 +103,11 @@
|
|||
return keysWithFormat;
|
||||
}
|
||||
|
||||
- (NSComparisonResult) caseInsensitiveDisplayNameCompare: (NSDictionary *) theDictionary
|
||||
{
|
||||
return [[self objectForKey: @"cn"] caseInsensitiveCompare: [theDictionary objectForKey: @"cn"]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSMutableDictionary (SOGoDictionaryUtilities)
|
||||
|
|
|
@ -293,18 +293,26 @@ static NSString *LDAPContactInfoAttribute = nil;
|
|||
- (NSString *) _davFetchUsersMatching: (NSString *) user
|
||||
{
|
||||
LDAPUserManager *um;
|
||||
NSEnumerator *users;
|
||||
NSMutableString *fetch;
|
||||
NSDictionary *currentUser;
|
||||
NSString *field;
|
||||
NSArray *users;
|
||||
int i;
|
||||
|
||||
#warning the attributes returned here should match the one requested in the query
|
||||
fetch = [NSMutableString string];
|
||||
|
||||
um = [LDAPUserManager sharedUserManager];
|
||||
users = [[um fetchUsersMatching: user] objectEnumerator];
|
||||
while ((currentUser = [users nextObject]))
|
||||
|
||||
// We sort our array - this is pretty useful for the
|
||||
// SOGo Integrator extension, among other things.
|
||||
users = [[[[um fetchUsersMatching: user] objectEnumerator] allObjects]
|
||||
sortedArrayUsingSelector: @selector(caseInsensitiveDisplayNameCompare:)];
|
||||
|
||||
for (i = 0; i < [users count]; i++)
|
||||
{
|
||||
currentUser = [users objectAtIndex: i];
|
||||
|
||||
[fetch appendString: @"<user>"];
|
||||
field = [currentUser objectForKey: @"c_uid"];
|
||||
[fetch appendFormat: @"<id>%@</id>",
|
||||
|
|
|
@ -297,6 +297,8 @@ static NSString *LDAPContactInfoAttribute = nil;
|
|||
NSMutableString *responseString;
|
||||
NSDictionary *contact;
|
||||
NSString *contactInfo;
|
||||
NSArray *allUsers;
|
||||
int i;
|
||||
|
||||
response = [context response];
|
||||
[response setStatus: 200];
|
||||
|
@ -304,8 +306,15 @@ static NSString *LDAPContactInfoAttribute = nil;
|
|||
forKey: @"Content-Type"];
|
||||
|
||||
responseString = [NSMutableString new];
|
||||
while ((contact = [users nextObject]))
|
||||
|
||||
// We sort our array - this is pretty useful for the Web
|
||||
// interface of SOGo.
|
||||
allUsers = [[users allObjects]
|
||||
sortedArrayUsingSelector: @selector(caseInsensitiveDisplayNameCompare:)];
|
||||
|
||||
for (i = 0; i < [allUsers count]; i++)
|
||||
{
|
||||
contact = [allUsers objectAtIndex: i];
|
||||
uid = [contact objectForKey: @"c_uid"];
|
||||
if ([LDAPContactInfoAttribute length])
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue