diff --git a/Tools/SOGoToolManageACL.m b/Tools/SOGoToolManageACL.m index ef509aed5..a1f3455af 100644 --- a/Tools/SOGoToolManageACL.m +++ b/Tools/SOGoToolManageACL.m @@ -32,6 +32,7 @@ #import #import +#import #import #import #import @@ -215,7 +216,30 @@ typedef enum [allSQLUsers addObject: @"anonymous"]; } else - [allSQLUsers addObject: user]; + { + NSDictionary *dict; + + dict = [[SOGoUserManager sharedUserManager] contactInfosForUserWithUIDorEmail: user]; + + if (dict && [[dict objectForKey: @"isGroup"] boolValue]) + { + id source; + NSArray *members; + int i; + + source = [[SOGoUserManager sharedUserManager] sourceWithID: [dict objectForKey: @"SOGoSource"]]; + if ([source conformsToProtocol: @protocol(SOGoMembershipSource)]) + { + members = [(id)(source) membersForGroupWithUID: [dict objectForKey: @"c_uid"]]; + for (i = 0; i < [members count]; i++) + { + [allSQLUsers addObject: [[members objectAtIndex: i] objectForKey: @"c_uid"]]; + } + } + } + else + [allSQLUsers addObject: user]; + } pool = [[NSAutoreleasePool alloc] init]; max = [allSQLUsers count];