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

View File

@ -1,7 +1,7 @@
/* 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
* 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];
if (![subscribers containsObject: aclUser])
{
currentUser = [SOGoUser userWithLogin: aclUser];
if ([currentUser hasSubscribedToCalendar: currentFolder])
[subscribers addObject: aclUser];
if ([aclUser hasPrefix: @"@"])
[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
*
* Copyright (C) 2009 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Copyright (C) 2009-2016 Inverse inc.
*
* 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

View File

@ -1,8 +1,6 @@
/* SOGoCalendarProxy.m - this file is part of SOGo
*
* Copyright (C) 2009 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Copyright (C) 2009-2016 Inverse inc.
*
* 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

View File

@ -1,8 +1,6 @@
/* SOGoUser+Appointments.h - this file is part of SOGo
*
* Copyright (C) 2010 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Copyright (C) 2010-2016 Inverse inc.
*
* 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

View File

@ -1,8 +1,6 @@
/* SOGoUser+Appointments.m - this file is part of SOGo
*
* Copyright (C) 2010 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Copyright (C) 2010-2016 Inverse inc.
*
* 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

View File

@ -1865,9 +1865,9 @@ static NSArray *childRecordFields = nil;
- (void) setRoles: (NSArray *) roles
forUser: (NSString *) uid
{
return [self setRoles: roles
forUser: uid
forObjectAtPath: [self pathArrayToFolder]];
return [self setRoles: roles
forUser: uid
forObjectAtPath: [self pathArrayToFolder]];
}
- (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
This file is part of SOGo.

View File

@ -1,15 +1,13 @@
/*
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.
OGo is free software; you can redistribute it and/or modify it under
SOGo 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
Free Software Foundation; either version 2, or (at your option) any
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
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.