diff --git a/ChangeLog b/ChangeLog index 24ce0d8ad..206765292 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2008-02-07 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoUserFolder.m ([-login]): removed useless + method. + ([SOGoUserFolder -ownerInContext:_ctx]): compute the owner name + from a SOGoUser instance initialized with the nameInContainer as + initial login name. This way, all the objects belonging to the + corresponding user will be accessible with all the fields + mentionned in the "bindFields" LDAP settings value. + ([SOGoUserFolder -privateCalendars:keyinContext:localContext]) + ([SOGoUserFolder -privateContacts:_keyinContext:_ctx]): use -[self + ownerInContext:] to determine the OCS path. + * SoObjects/Mailer/SOGoSharedMailAccount.[hm]: removed useless module. diff --git a/SoObjects/SOGo/SOGoUserFolder.h b/SoObjects/SOGo/SOGoUserFolder.h index ccb30545e..d2bd564ab 100644 --- a/SoObjects/SOGo/SOGoUserFolder.h +++ b/SoObjects/SOGo/SOGoUserFolder.h @@ -43,10 +43,6 @@ @interface SOGoUserFolder : SOGoFolder -/* accessors */ - -- (NSString *) login; - /* ownership */ - (NSString *) ownerInContext: (WOContext *) _ctx; diff --git a/SoObjects/SOGo/SOGoUserFolder.m b/SoObjects/SOGo/SOGoUserFolder.m index d8a475dbb..efd551e77 100644 --- a/SoObjects/SOGo/SOGoUserFolder.m +++ b/SoObjects/SOGo/SOGoUserFolder.m @@ -66,13 +66,6 @@ // [sInfo declareRoles: basicRoles asDefaultForPermission: SoPerm_WebDAVAccess]; // } -/* accessors */ - -- (NSString *) login -{ - return nameInContainer; -} - /* hierarchy */ - (NSArray *) toManyRelationshipKeys @@ -97,7 +90,15 @@ - (NSString *) ownerInContext: (WOContext *) _ctx { - return nameInContainer; + SOGoUser *ownerUser; + + if (!owner) + { + ownerUser = [SOGoUser userWithLogin: nameInContainer roles: nil]; + owner = [ownerUser login]; + } + + return owner; } /* looking up shared objects */ @@ -327,14 +328,17 @@ // : [super permissionForKey: key]); // } -- (SOGoAppointmentFolders *) privateCalendars: (NSString *) _key - inContext: (WOContext *) _ctx +- (SOGoAppointmentFolders *) privateCalendars: (NSString *) key + inContext: (WOContext *) localContext { SOGoAppointmentFolders *calendars; - - calendars = [$(@"SOGoAppointmentFolders") objectWithName: _key inContainer: self]; - [calendars setBaseOCSPath: [NSString stringWithFormat: @"/Users/%@/Calendar", - nameInContainer]]; + NSString *baseOCSPath; + + calendars = [$(@"SOGoAppointmentFolders") objectWithName: key + inContainer: self]; + baseOCSPath = [NSString stringWithFormat: @"/Users/%@/Calendar", + [self ownerInContext: nil]]; + [calendars setBaseOCSPath: baseOCSPath]; return calendars; } @@ -343,10 +347,12 @@ inContext: (WOContext *) _ctx { SOGoContactFolders *contacts; + NSString *baseOCSPath; contacts = [$(@"SOGoContactFolders") objectWithName:_key inContainer: self]; - [contacts setBaseOCSPath: [NSString stringWithFormat: @"/Users/%@/Contacts", - nameInContainer]]; + baseOCSPath = [NSString stringWithFormat: @"/Users/%@/Contacts", + [self ownerInContext: nil]]; + [contacts setBaseOCSPath: baseOCSPath]; return contacts; }