merge of '3f0a698566b940e183824009e4aae638d5263054'

and '7c369f5daacf319b74a648fea43f833dda69d81d'

Monotone-Parent: 3f0a698566b940e183824009e4aae638d5263054
Monotone-Parent: 7c369f5daacf319b74a648fea43f833dda69d81d
Monotone-Revision: 991fcab97beb9fd908675007805ffd9ce421800e

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-10-23T21:06:27
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau 2009-10-23 21:06:27 +00:00
commit 6e973a44b2
4 changed files with 62 additions and 39 deletions

View file

@ -7,6 +7,25 @@
* SoObjects/SOGo/SOGoUserManager.m (_registerSource:): added * SoObjects/SOGo/SOGoUserManager.m (_registerSource:): added
sanity checks and warnings to the user. sanity checks and warnings to the user.
2009-10-23 Ludovic Marcotte <lmarcotte@inverse.ca>
* SoObjects/SOGo/SOGoUserFolder.m (-subFoldersFromFolder:)
Addded a check to NOT return web calendars in this query.
2009-10-23 Francis Lachapelle <flachapelle@inverse.ca>
* UI/MailerUI/UIxMailMainFrame.m (-formattedMailtoString:): fixed
the case when dealing with a NGVCardReference (from a list) with
no FN attribute and no N attribute.
(-composeAction): fixed the case when dealing with a contact with
no email address.
(-composeAction): fixed the case when dealing with a contact from
an LDAP source.
* UI/Scheduler/UIxComponentEditor.m (-calendarList): added proper
verification of deletion rights on the current calendar and
creation rights on other calendars.
2009-10-22 Ludovic Marcotte <lmarcotte@inverse.ca> 2009-10-22 Ludovic Marcotte <lmarcotte@inverse.ca>
* SoObjects/SOGo/SOGoUserManager.m * SoObjects/SOGo/SOGoUserManager.m

View file

@ -170,7 +170,8 @@ static NSString *LDAPContactInfoAttribute = nil;
if (![securityManager validatePermission: SOGoPerm_AccessObject if (![securityManager validatePermission: SOGoPerm_AccessObject
onObject: currentFolder inContext: context] onObject: currentFolder inContext: context]
&& [[currentFolder ownerInContext: context] && [[currentFolder ownerInContext: context]
isEqualToString: folderOwner]) isEqualToString: folderOwner]
&& [NSStringFromClass([currentFolder class]) compare: @"SOGoWebAppointmentFolder"] != NSOrderedSame)
{ {
folderName = [NSString stringWithFormat: @"/%@/%@", folderName = [NSString stringWithFormat: @"/%@/%@",
[parentFolder nameInContainer], [parentFolder nameInContainer],

View file

@ -37,6 +37,7 @@
#import <Contacts/SOGoContactGCSList.h> #import <Contacts/SOGoContactGCSList.h>
#import <Contacts/SOGoContactGCSEntry.h> #import <Contacts/SOGoContactGCSEntry.h>
#import <Contacts/SOGoContactFolders.h> #import <Contacts/SOGoContactFolders.h>
#import <Contacts/SOGoContactLDIFEntry.h>
#import <SoObjects/Mailer/SOGoMailObject.h> #import <SoObjects/Mailer/SOGoMailObject.h>
#import <SoObjects/Mailer/SOGoMailAccount.h> #import <SoObjects/Mailer/SOGoMailAccount.h>
@ -175,7 +176,7 @@
{ {
id contact; id contact;
NSArray *accounts, *contactsId, *cards; NSArray *accounts, *contactsId, *cards;
NSString *firstAccount, *firstEscapedAccount, *newLocation, *parameters, *folderId, *uid; NSString *firstAccount, *firstEscapedAccount, *newLocation, *parameters, *folderId, *uid, *formattedMail;
NSEnumerator *uids; NSEnumerator *uids;
NSMutableArray *addresses; NSMutableArray *addresses;
NGVCard *card; NGVCard *card;
@ -224,16 +225,23 @@
cards = [list cardReferences]; cards = [list cardReferences];
count = [cards count]; count = [cards count];
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
[addresses addObject: {
[self formattedMailtoString: [cards objectAtIndex: i]]]; formattedMail = [self formattedMailtoString: [cards objectAtIndex: i]];
if (formattedMail)
[addresses addObject: formattedMail];
}
} }
else if ([contact isKindOfClass: [SOGoContactGCSEntry class]]) else if ([contact isKindOfClass: [SOGoContactGCSEntry class]]
|| [contact isKindOfClass: [SOGoContactLDIFEntry class]])
{ {
// We fetch the preferred email address of the contact or // We fetch the preferred email address of the contact or
// the first defined email address // the first defined email address
card = [contact vCard]; card = [contact vCard];
[addresses addObject: [self formattedMailtoString: card]]; formattedMail = [self formattedMailtoString: card];
if (formattedMail)
[addresses addObject: formattedMail];
} }
uid = [uids nextObject]; uid = [uids nextObject];
} }
@ -279,7 +287,8 @@
// We append the contact's name // We append the contact's name
fn = [NSMutableString stringWithString: [card fn]]; fn = [NSMutableString stringWithString: [card fn]];
if ([fn length] == 0) if ([fn length] == 0
&& [card isKindOfClass: [NGVCard class]])
{ {
n = [card n]; n = [card n];
if (n) if (n)
@ -294,7 +303,7 @@
} }
} }
} }
if (fn) if ([fn length] > 0)
{ {
[fn appendFormat: @" %@", email]; [fn appendFormat: @" %@", email];
rc = fn; rc = fn;

View file

@ -997,25 +997,6 @@ iRANGE(2);
return [NSNumber numberWithInt: participationStatus]; return [NSNumber numberWithInt: participationStatus];
} }
- (NSString *) _permissionForEditing
{
NSString *perm;
if ([[self clientObject] isNew])
perm = SoPerm_AddDocumentsImagesAndFiles;
else
{
if ([privacy isEqualToString: @"PRIVATE"])
perm = SOGoCalendarPerm_ModifyPrivateRecords;
else if ([privacy isEqualToString: @"CONFIDENTIAL"])
perm = SOGoCalendarPerm_ModifyConfidentialRecords;
else
perm = SOGoCalendarPerm_ModifyPublicRecords;
}
return perm;
}
- (NSArray *) calendarList - (NSArray *) calendarList
{ {
SOGoAppointmentFolder *calendar, *currentCalendar; SOGoAppointmentFolder *calendar, *currentCalendar;
@ -1027,19 +1008,32 @@ iRANGE(2);
if (!calendarList) if (!calendarList)
{ {
calendarList = [NSMutableArray new]; calendarList = [NSMutableArray new];
perm = [self _permissionForEditing];
calendarParent
= [[context activeUser] calendarsFolderInContext: context];
sm = [SoSecurityManager sharedSecurityManager];
calendar = [self componentCalendar]; calendar = [self componentCalendar];
allCalendars = [[calendarParent subFolders] objectEnumerator]; sm = [SoSecurityManager sharedSecurityManager];
while ((currentCalendar = [allCalendars nextObject]))
if ([calendar isEqual: currentCalendar] || perm = SoPerm_DeleteObjects;
![sm validatePermission: perm if ([sm validatePermission: perm
onObject: currentCalendar onObject: calendar
inContext: context]) inContext: context])
[calendarList addObject: currentCalendar]; {
// User can't delete components from this calendar;
// don't add any calendar other than the current one
[calendarList addObject: calendar];
}
else
{
// Find which calendars user has creation rights
perm = SoPerm_AddDocumentsImagesAndFiles;
calendarParent
= [[context activeUser] calendarsFolderInContext: context];
allCalendars = [[calendarParent subFolders] objectEnumerator];
while ((currentCalendar = [allCalendars nextObject]))
if ([calendar isEqual: currentCalendar] ||
![sm validatePermission: perm
onObject: currentCalendar
inContext: context])
[calendarList addObject: currentCalendar];
}
} }
return calendarList; return calendarList;