(fix) search in all domain sources for Apple Calendar and properly handle groups

pull/222/head
Ludovic Marcotte 2016-09-26 15:22:49 -04:00
parent ae58c771b6
commit c1326dc20e
9 changed files with 34 additions and 44 deletions

View File

@ -36,6 +36,7 @@
#import <SOGo/SOGoPermissions.h> #import <SOGo/SOGoPermissions.h>
#import <SOGo/SOGoUser.h> #import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserFolder.h> #import <SOGo/SOGoUserFolder.h>
#import <SOGo/SOGoUserManager.h>
#import "SOGo+DAV.h" #import "SOGo+DAV.h"
@ -359,31 +360,26 @@
withEmailAddressSetMatching: (NSString *) value withEmailAddressSetMatching: (NSString *) value
inContext: (WOContext *) localContext inContext: (WOContext *) localContext
{ {
id <SOGoSource> authenticationSource; SOGoUserManager *um;
SOGoUser *activeUser;
NSArray *records; NSArray *records;
NSUInteger count, max; NSUInteger count, max;
NSString *uid; NSString *uid;
SOGoUserFolder *collection; SOGoUserFolder *collection;
activeUser = [localContext activeUser]; um = [SOGoUserManager sharedUserManager];
if ([activeUser respondsToSelector: @selector (authenticationSource)]) records = [um fetchUsersMatching: value
inDomain: [[localContext activeUser] domain]];
max = [records count];
for (count = 0; count < max; count++)
{ {
authenticationSource = [[localContext activeUser] authenticationSource]; uid = [[records objectAtIndex: count] objectForKey: @"c_uid"];
records = [authenticationSource if ([uid length] > 0)
fetchContactsMatching: value {
inDomain: [activeUser domain]]; collection = [[SOGoUser userWithLogin: uid]
max = [records count];
for (count = 0; count < max; count++)
{
uid = [[records objectAtIndex: count] objectForKey: @"c_uid"];
if ([uid length] > 0)
{
collection = [[SOGoUser userWithLogin: uid]
homeFolderInContext: localContext]; homeFolderInContext: localContext];
[collections addObject: collection]; [collections addObject: collection];
} }
}
} }
} }
@ -579,7 +575,6 @@
@"addressbook", @"calendar-access", @"addressbook", @"calendar-access",
@"calendar-schedule", @"calendar-auto-schedule", @"calendar-schedule", @"calendar-auto-schedule",
@"calendar-proxy", @"calendar-proxy",
@"calendar-query-extended", @"calendar-query-extended",
@"extended-mkcol", @"extended-mkcol",
@"calendarserver-principal-property-search", @"calendarserver-principal-property-search",

View File

@ -1,7 +1,7 @@
/* SOGoAppointmentFolders.m - this file is part of SOGo /* SOGoAppointmentFolders.m - this file is part of SOGo
* *
* Copyright (C) 2007-2015 Inverse inc. * Copyright (C) 2007-2016 Inverse inc.
* *
* This file is free software; you can redistribute it and/or modify * This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -731,9 +731,14 @@ static SoSecurityManager *sm = nil;
aclUser = [aclUsers objectAtIndex: userCount]; aclUser = [aclUsers objectAtIndex: userCount];
if (![subscribers containsObject: aclUser]) if (![subscribers containsObject: aclUser])
{ {
currentUser = [SOGoUser userWithLogin: aclUser]; if ([aclUser hasPrefix: @"@"])
if ([currentUser hasSubscribedToCalendar: currentFolder]) [subscribers addObject: aclUser];
[subscribers addObject: aclUser]; else
{
currentUser = [SOGoUser userWithLogin: aclUser];
if ([currentUser hasSubscribedToCalendar: currentFolder])
[subscribers addObject: aclUser];
}
} }
} }
} }

View File

@ -1,8 +1,6 @@
/* SOGoCalendarProxy.h - this file is part of SOGo /* SOGoCalendarProxy.h - this file is part of SOGo
* *
* Copyright (C) 2009 Inverse inc. * Copyright (C) 2009-2016 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* *
* This file is free software; you can redistribute it and/or modify * This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,8 +1,6 @@
/* SOGoCalendarProxy.m - this file is part of SOGo /* SOGoCalendarProxy.m - this file is part of SOGo
* *
* Copyright (C) 2009 Inverse inc. * Copyright (C) 2009-2016 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* *
* This file is free software; you can redistribute it and/or modify * This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,8 +1,6 @@
/* SOGoUser+Appointments.h - this file is part of SOGo /* SOGoUser+Appointments.h - this file is part of SOGo
* *
* Copyright (C) 2010 Inverse inc. * Copyright (C) 2010-2016 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* *
* This file is free software; you can redistribute it and/or modify * This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,8 +1,6 @@
/* SOGoUser+Appointments.m - this file is part of SOGo /* SOGoUser+Appointments.m - this file is part of SOGo
* *
* Copyright (C) 2010 Inverse inc. * Copyright (C) 2010-2016 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* *
* This file is free software; you can redistribute it and/or modify * This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1865,9 +1865,9 @@ static NSArray *childRecordFields = nil;
- (void) setRoles: (NSArray *) roles - (void) setRoles: (NSArray *) roles
forUser: (NSString *) uid forUser: (NSString *) uid
{ {
return [self setRoles: roles return [self setRoles: roles
forUser: uid forUser: uid
forObjectAtPath: [self pathArrayToFolder]]; forObjectAtPath: [self pathArrayToFolder]];
} }
- (void) removeAclsForUsers: (NSArray *) users - (void) removeAclsForUsers: (NSArray *) users

View File

@ -1,5 +1,5 @@
/* /*
Copyright (C) 2006-2014 Inverse inc. Copyright (C) 2006-2016 Inverse inc.
Copyright (C) 2004-2005 SKYRIX Software AG Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of SOGo. This file is part of SOGo.

View File

@ -1,15 +1,13 @@
/* /*
Copyright (C) 2004-2005 SKYRIX Software AG Copyright (C) 2004-2005 SKYRIX Software AG
Copyright (C) 2007-2011 Inverse inc. Copyright (C) 2007-2016 Inverse inc.
This file is part of OpenGroupware.org. SOGo is free software; you can redistribute it and/or modify it under
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any Free Software Foundation; either version 2, or (at your option) any
later version. later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY SOGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details. License for more details.