Improve cache cleanup when removing a group ACL

pull/237/merge
Francis Lachapelle 2017-08-29 15:09:08 -04:00
parent 491e090fb4
commit ee7fdcba9f
1 changed files with 16 additions and 18 deletions

View File

@ -1753,27 +1753,25 @@ static NSArray *childRecordFields = nil;
for (i = 0; i < [usersAndGroups count]; i++)
{
uid = [usersAndGroups objectAtIndex: i];
if (![uid hasPrefix: @"@"])
group = [SOGoGroup groupWithIdentifier: uid inDomain: domain];
if (group)
{
group = [SOGoGroup groupWithIdentifier: uid inDomain: domain];
if (group)
NSArray *members;
SOGoUser *user;
unsigned int j;
// Fetch members to remove them from the cache along the group
members = [group members];
for (j = 0; j < [members count]; j++)
{
NSArray *members;
SOGoUser *user;
unsigned int j;
// Fetch members to remove them from the cache along the group
members = [group members];
for (j = 0; j < [members count]; j++)
{
user = [members objectAtIndex: j];
[groupsMembers addObject: [user login]];
}
// Prefix the UID with the character "@" when dealing with a group
[usersAndGroups replaceObjectAtIndex: i
withObject: [NSString stringWithFormat: @"@%@", uid]];
user = [members objectAtIndex: j];
[groupsMembers addObject: [user login]];
}
if (![uid hasPrefix: @"@"])
// Prefix the UID with the character "@" when dealing with a group
[usersAndGroups replaceObjectAtIndex: i
withObject: [NSString stringWithFormat: @"@%@", uid]];
}
}
objectPath = [objectPathArray componentsJoinedByString: @"/"];