parent
62fc80de20
commit
b8595d7ae6
|
@ -429,6 +429,7 @@ static Class iCalEventK = nil;
|
|||
NSString *subscriptionPointer, *domain;
|
||||
NSMutableArray *allUsers;
|
||||
SOGoUserSettings *us;
|
||||
SOGoUser *sogoUser;
|
||||
NSDictionary *dict;
|
||||
BOOL rc;
|
||||
int i;
|
||||
|
@ -452,15 +453,11 @@ static Class iCalEventK = nil;
|
|||
NSArray *members;
|
||||
|
||||
members = [(id<SOGoMembershipSource>)(source) membersForGroupWithUID: [dict objectForKey: @"c_uid"]];
|
||||
allUsers = [NSMutableArray array];
|
||||
allUsers = [NSMutableArray arrayWithArray: members];
|
||||
|
||||
for (i = 0; i < [members count]; i++)
|
||||
{
|
||||
[allUsers addObject: [[members objectAtIndex: i] objectForKey: @"c_uid"]];
|
||||
}
|
||||
// We remove the active user from the group (if present) in order to
|
||||
// not subscribe him to their own resource!
|
||||
[allUsers removeObject: [[context activeUser] login]];
|
||||
[allUsers removeObject: [context activeUser]];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -470,15 +467,17 @@ static Class iCalEventK = nil;
|
|||
}
|
||||
else
|
||||
{
|
||||
if (dict)
|
||||
allUsers = [NSArray arrayWithObject: [dict objectForKey: @"c_uid"]];
|
||||
sogoUser = [SOGoUser userWithLogin: theIdentifier roles: nil];
|
||||
if (sogoUser)
|
||||
allUsers = [NSArray arrayWithObject: sogoUser];
|
||||
else
|
||||
allUsers = [NSArray array];
|
||||
}
|
||||
|
||||
for (i = 0; i < [allUsers count]; i++)
|
||||
{
|
||||
us = [SOGoUserSettings settingsForUser: [allUsers objectAtIndex: i]];
|
||||
sogoUser = [allUsers objectAtIndex: i];
|
||||
us = [sogoUser userSettings];
|
||||
moduleSettings = [us objectForKey: [container nameInContainer]];
|
||||
if (!(moduleSettings
|
||||
&& [moduleSettings isKindOfClass: [NSMutableDictionary class]]))
|
||||
|
@ -1520,7 +1519,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
|||
BOOL rememberRecords, canCycle;
|
||||
SOGoUser *ownerUser;
|
||||
|
||||
ownerUser = [SOGoUser userWithLogin: owner roles: nil];
|
||||
ownerUser = [SOGoUser userWithLogin: self->owner roles: nil];
|
||||
rememberRecords = [self _checkIfWeCanRememberRecords: _fields];
|
||||
canCycle = [_component isEqualToString: @"vevent"] || [_component isEqualToString: @"vtodo"];
|
||||
// if (rememberRecords)
|
||||
|
@ -1679,7 +1678,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
|||
}
|
||||
|
||||
currentLogin = [[context activeUser] login];
|
||||
if (![currentLogin isEqualToString: owner])
|
||||
if (![currentLogin isEqualToString: self->owner])
|
||||
{
|
||||
|
||||
if (!_includeProtectedInformation)
|
||||
|
|
|
@ -557,7 +557,7 @@
|
|||
{
|
||||
iCalPerson *person;
|
||||
NSArray *members;
|
||||
NSDictionary *user;
|
||||
SOGoUser *user;
|
||||
id <SOGoSource> source;
|
||||
|
||||
// We did decompose a group...
|
||||
|
@ -574,10 +574,10 @@
|
|||
|
||||
// If the organizer is part of the group, we skip it from
|
||||
// the addition to the attendees' list
|
||||
if ([[user objectForKey: @"c_emails"] containsObject: organizerEmail])
|
||||
if ([user hasEmail: organizerEmail])
|
||||
continue;
|
||||
|
||||
person = [self iCalPersonWithUID: [user objectForKey: @"c_uid"]];
|
||||
person = [self iCalPersonWithUID: [user login]];
|
||||
[person setTag: @"ATTENDEE"];
|
||||
[person setParticipationStatus: [currentAttendee participationStatus]];
|
||||
[person setRsvp: [currentAttendee rsvp]];
|
||||
|
|
|
@ -2085,8 +2085,7 @@ _makeLDAPChanges (NGLdapConnection *ldapConnection,
|
|||
if (user)
|
||||
{
|
||||
[logins addObject: login];
|
||||
[members addObject: [NSDictionary dictionaryWithObject: login
|
||||
forKey: @"c_uid"]];
|
||||
[members addObject: user];
|
||||
}
|
||||
[pool release];
|
||||
}
|
||||
|
@ -2100,15 +2099,14 @@ _makeLDAPChanges (NGLdapConnection *ldapConnection,
|
|||
if (user)
|
||||
{
|
||||
[logins addObject: login];
|
||||
[members addObject: [NSDictionary dictionaryWithObject: login
|
||||
forKey: @"c_uid"]];
|
||||
[members addObject: user];
|
||||
}
|
||||
[pool release];
|
||||
}
|
||||
|
||||
|
||||
// We are done fetching members, let's cache the members of the group
|
||||
// (ie., their UIDs) in memcached to speed up -hasMemberWithUID.
|
||||
// (ie., their UIDs) in memcached to speed up -groupWithUIDHasMemberWithUID.
|
||||
[[SOGoCache sharedCache] setValue: [logins componentsJoinedByString: @","]
|
||||
forKey: [NSString stringWithFormat: @"%@+%@", uid, _domain]];
|
||||
}
|
||||
|
|
|
@ -926,6 +926,7 @@ static NSArray *childRecordFields = nil;
|
|||
NSString *subscriptionPointer, *domain;
|
||||
NSMutableArray *allUsers;
|
||||
SOGoUserSettings *us;
|
||||
SOGoUser *sogoUser;
|
||||
NSDictionary *dict;
|
||||
BOOL rc;
|
||||
int i;
|
||||
|
@ -944,15 +945,11 @@ static NSArray *childRecordFields = nil;
|
|||
NSArray *members;
|
||||
|
||||
members = [(id<SOGoMembershipSource>)(source) membersForGroupWithUID: [dict objectForKey: @"c_uid"]];
|
||||
allUsers = [NSMutableArray array];
|
||||
allUsers = [NSMutableArray arrayWithArray: members];
|
||||
|
||||
for (i = 0; i < [members count]; i++)
|
||||
{
|
||||
[allUsers addObject: [[members objectAtIndex: i] objectForKey: @"c_uid"]];
|
||||
}
|
||||
// We remove the active user from the group (if present) in order to
|
||||
// not subscribe him to their own resource!
|
||||
[allUsers removeObject: [[context activeUser] login]];
|
||||
[allUsers removeObject: [context activeUser]];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -962,8 +959,9 @@ static NSArray *childRecordFields = nil;
|
|||
}
|
||||
else
|
||||
{
|
||||
if (dict)
|
||||
allUsers = [NSArray arrayWithObject: [dict objectForKey: @"c_uid"]];
|
||||
sogoUser = [SOGoUser userWithLogin: theIdentifier roles: nil];
|
||||
if (sogoUser)
|
||||
allUsers = [NSArray arrayWithObject: sogoUser];
|
||||
else
|
||||
allUsers = [NSArray array];
|
||||
}
|
||||
|
@ -976,7 +974,8 @@ static NSArray *childRecordFields = nil;
|
|||
|
||||
for (i = 0; i < [allUsers count]; i++)
|
||||
{
|
||||
us = [SOGoUserSettings settingsForUser: [allUsers objectAtIndex: i]];
|
||||
sogoUser = [allUsers objectAtIndex: i];
|
||||
us = [sogoUser userSettings];
|
||||
moduleSettings = [us objectForKey: [container nameInContainer]];
|
||||
if (!(moduleSettings
|
||||
&& [moduleSettings isKindOfClass: [NSMutableDictionary class]]))
|
||||
|
@ -1797,8 +1796,8 @@ static NSArray *childRecordFields = nil;
|
|||
source = [[SOGoUserManager sharedUserManager] sourceWithID: [dict objectForKey: @"SOGoSource"]];
|
||||
if ([source conformsToProtocol:@protocol(SOGoMembershipSource)])
|
||||
{
|
||||
NSDictionary *user;
|
||||
NSArray *members;
|
||||
SOGoUser *user;
|
||||
unsigned int j;
|
||||
|
||||
// Fetch members to remove them from the cache along the group
|
||||
|
@ -1806,7 +1805,7 @@ static NSArray *childRecordFields = nil;
|
|||
for (j = 0; j < [members count]; j++)
|
||||
{
|
||||
user = [members objectAtIndex: j];
|
||||
[groupsMembers addObject: [user objectForKey: @"c_uid"]];
|
||||
[groupsMembers addObject: [user login]];
|
||||
}
|
||||
|
||||
if (![uid hasPrefix: @"@"])
|
||||
|
|
|
@ -397,7 +397,7 @@
|
|||
NSString *email;
|
||||
SOGoObject <SOGoContactObject> *contact;
|
||||
SOGoObject <SOGoSource> *source;
|
||||
NSDictionary *user;
|
||||
SOGoUser *user;
|
||||
id <WOActionResults> result;
|
||||
unsigned int i, max;
|
||||
|
||||
|
@ -418,14 +418,14 @@
|
|||
{
|
||||
user = [allUsers objectAtIndex: i];
|
||||
allUserEmails = [NSMutableArray array];
|
||||
emails = [[user objectForKey: @"c_emails"] objectEnumerator];
|
||||
emails = [[user allEmails] objectEnumerator];
|
||||
while ((email = [emails nextObject])) {
|
||||
[allUserEmails addObject: [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
email, @"value", @"work", @"type", nil]];
|
||||
}
|
||||
userData = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[user objectForKey: @"c_uid"], @"c_uid",
|
||||
[user objectForKey: @"c_cn"], @"c_cn",
|
||||
[user loginInDomain], @"c_uid",
|
||||
[user cn], @"c_cn",
|
||||
allUserEmails, @"emails", nil];
|
||||
[allUsersData addObject: userData];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue