(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,20 +360,16 @@
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]];
authenticationSource = [[localContext activeUser] authenticationSource];
records = [authenticationSource
fetchContactsMatching: value
inDomain: [activeUser domain]];
max = [records count]; max = [records count];
for (count = 0; count < max; count++) for (count = 0; count < max; count++)
{ {
@ -385,7 +382,6 @@
} }
} }
} }
}
- (void) _fillCollections: (NSMutableArray *) collections - (void) _fillCollections: (NSMutableArray *) collections
where: (NSString *) key where: (NSString *) key
@ -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
@ -730,6 +730,10 @@ static SoSecurityManager *sm = nil;
{ {
aclUser = [aclUsers objectAtIndex: userCount]; aclUser = [aclUsers objectAtIndex: userCount];
if (![subscribers containsObject: aclUser]) if (![subscribers containsObject: aclUser])
{
if ([aclUser hasPrefix: @"@"])
[subscribers addObject: aclUser];
else
{ {
currentUser = [SOGoUser userWithLogin: aclUser]; currentUser = [SOGoUser userWithLogin: aclUser];
if ([currentUser hasSubscribedToCalendar: currentFolder]) if ([currentUser hasSubscribedToCalendar: currentFolder])
@ -738,6 +742,7 @@ static SoSecurityManager *sm = nil;
} }
} }
} }
}
return subscribers; return subscribers;
} }

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

@ -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.