diff --git a/ChangeLog b/ChangeLog index 1508dbabb..675c0aea1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-03-02 Ludovic Marcotte + + * SoObjects/SOGo/SOGoObject.m + ([SOGoObject -davRecordForUser:parameters:]): + Don't initialize the SOGoUser variable of + nocn AND noemail are passed. + 2009-02-23 Ludovic Marcotte * Updated German translation. Patch from diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index 2b5c706b5..2858b14d3 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -1356,19 +1356,19 @@ SEL SOGoSelectorForPropertySetter (NSString *property) parameters: (NSArray *) params { NSMutableString *userRecord; - SOGoUser *sogoUser; userRecord = [NSMutableString string]; [userRecord appendFormat: @"%@", [user stringByEscapingXMLString]]; - sogoUser = [SOGoUser userWithLogin: user roles: nil]; + // Make sure to not call [SOGoUser userWithLogin...] here if nocn AND noemail + // is specified. We'll avoid generating LDAP calls by doing so. if (![params containsObject: @"nocn"]) { NSString *cn; - cn = [sogoUser cn]; + cn = [[SOGoUser userWithLogin: user roles: nil] cn]; if (!cn) cn = user; [userRecord appendFormat: @"%@", @@ -1379,7 +1379,8 @@ SEL SOGoSelectorForPropertySetter (NSString *property) { NSString *email; - email = [[sogoUser allEmails] objectAtIndex: 0]; + email = [[[SOGoUser userWithLogin: user roles: nil] + allEmails] objectAtIndex: 0]; if (email) [userRecord appendFormat: @"%@", [email stringByEscapingXMLString]];