From 6b61cd87013af2f3d622636c993789b5f00626e3 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 11 Jun 2009 22:13:10 +0000 Subject: [PATCH] Monotone-Parent: c00d2fadae3d5733fb53c91e14b43a56d1e1ca58 Monotone-Revision: b8d56bd5a31be825cfe66b8fe9f9a15269a09fbc Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-06-11T22:13:10 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ SoObjects/SOGo/SOGoUserFolder.m | 40 +++++++++++++++++---------------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e7a3278e..5673f01e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-06-11 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoUserFolder.m (-davUserQuery:): do not return + the user information for the current user. + * UI/MainUI/SOGoUserHomePage.m (-usersSearchAction): do not return the user information for the current user. (-foldersSearchAction): the method only search folders for the diff --git a/SoObjects/SOGo/SOGoUserFolder.m b/SoObjects/SOGo/SOGoUserFolder.m index 99bdaec51..bd82de9ad 100644 --- a/SoObjects/SOGo/SOGoUserFolder.m +++ b/SoObjects/SOGo/SOGoUserFolder.m @@ -382,13 +382,14 @@ static NSString *LDAPContactInfoAttribute = nil; LDAPUserManager *um; NSMutableString *fetch; NSDictionary *currentUser; - NSString *field; + NSString *field, *login; NSArray *users; int i; #warning the attributes returned here should match the one requested in the query fetch = [NSMutableString string]; + login = [[context activeUser] login]; um = [LDAPUserManager sharedUserManager]; // We sort our array - this is pretty useful for the @@ -398,25 +399,26 @@ static NSString *LDAPContactInfoAttribute = nil; for (i = 0; i < [users count]; i++) { currentUser = [users objectAtIndex: i]; - - [fetch appendString: @""]; field = [currentUser objectForKey: @"c_uid"]; - [fetch appendFormat: @"%@", - [field stringByEscapingXMLString]]; - field = [currentUser objectForKey: @"cn"]; - [fetch appendFormat: @"%@", - [field stringByEscapingXMLString]]; - field = [currentUser objectForKey: @"c_email"]; - [fetch appendFormat: @"%@", - [field stringByEscapingXMLString]]; - if (LDAPContactInfoAttribute) - { - field = [currentUser objectForKey: LDAPContactInfoAttribute]; - if ([field length]) - [fetch appendFormat: @"%@", - [field stringByEscapingXMLString]]; - } - [fetch appendString: @""]; + if (![field isEqualToString: login]) + { + [fetch appendFormat: @"%@", + [field stringByEscapingXMLString]]; + field = [currentUser objectForKey: @"cn"]; + [fetch appendFormat: @"%@", + [field stringByEscapingXMLString]]; + field = [currentUser objectForKey: @"c_email"]; + [fetch appendFormat: @"%@", + [field stringByEscapingXMLString]]; + if (LDAPContactInfoAttribute) + { + field = [currentUser objectForKey: LDAPContactInfoAttribute]; + if ([field length]) + [fetch appendFormat: @"%@", + [field stringByEscapingXMLString]]; + } + [fetch appendString: @""]; + } } return fetch;