From e33ec4e3962f38c664310751cf7880bf908c8ef7 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 30 May 2018 12:01:08 -0400 Subject: [PATCH] Debugging output for subscription issue --- SoObjects/SOGo/SOGoGCSFolder.m | 4 +++- SoObjects/SOGo/SOGoGroup.m | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index 34dad387a..99b4f59d3 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -1649,7 +1649,9 @@ static NSArray *childRecordFields = nil; [[SOGoCache sharedCache] registerGroup: group withName: currentUID inDomain: domain]; } - if (group && [group hasMemberWithUID: uid]) + if (!group) + [self errorWithFormat: @"Can't find group %@", group]; + else if ([group hasMemberWithUID: uid]) [acls addObject: [record valueForKey: @"c_role"]]; } } diff --git a/SoObjects/SOGo/SOGoGroup.m b/SoObjects/SOGo/SOGoGroup.m index 9de1aad53..37146fb41 100644 --- a/SoObjects/SOGo/SOGoGroup.m +++ b/SoObjects/SOGo/SOGoGroup.m @@ -61,6 +61,7 @@ #include "SOGoUserManager.h" #include "SOGoUser.h" +#import #import #define CHECK_CLASS(o) ({ \ @@ -281,6 +282,10 @@ [logins addObject: login]; [_members addObject: user]; } + else + { + [self errorWithFormat: @"Invalid uniquemember %@ (%@) in group %@", dn, login, _identifier]; + } [pool release]; } @@ -290,12 +295,15 @@ pool = [NSAutoreleasePool new]; login = [uids objectAtIndex: i]; user = [SOGoUser userWithLogin: login roles: nil]; - if (user) { [logins addObject: [user loginInDomain]]; [_members addObject: user]; } + else + { + [self errorWithFormat: @"Invalid memberuid %@ in group %@", login, _identifier]; + } [pool release]; } @@ -304,6 +312,7 @@ // (ie., their UIDs) in memcached to speed up -hasMemberWithUID. [[SOGoCache sharedCache] setValue: [logins componentsJoinedByString: @","] forKey: [NSString stringWithFormat: @"%@+%@", _identifier, _domain]]; + [self logWithFormat: @"Cached %i members for group %@: %@", [logins count], _identifier, [logins componentsJoinedByString: @","]]; } else { @@ -341,7 +350,8 @@ currentUID = [[_members objectAtIndex: count] login]; rc = [memberUID isEqualToString: currentUID]; } - + if (!rc) + [self logWithFormat: @"User %@ is not a member of group %@", memberUID, _identifier]; } else { @@ -362,6 +372,8 @@ a = [value componentsSeparatedByString: @","]; rc = [a containsObject: memberUID]; + if (!rc) + [self logWithFormat: @"User %@ is not a member of group %@ (cached)", memberUID, _identifier]; } return rc;