From 21e0cd87113c80bbe2a2d1865879058b4728c8fb Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 4 Aug 2016 14:13:00 -0400 Subject: [PATCH] (fix) change 403 to 409 so Lightning doesn't fail silently --- NEWS | 1 + SoObjects/Appointments/SOGoAppointmentObject.m | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index dcba8a2f3..d996f21ae 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Bug fixes - [web] added support for multiple description values in LDAP entries (#3750) - [eas] fixed long GUID issue preventing sometimes synchronisation (#3460) - [core] fixing sogo-tool backup with multi-domain configuration but domain-less logins + - [core] during event scheduling, use 409 instead of 403 so Lightning doesn't fail silently 3.1.4 (2016-07-12) ------------------ diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index d85463383..43b895d8f 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -555,7 +555,7 @@ [user cn], @"Cn", [user systemEmail], @"SystemEmail", nil]; reason = [values keysWithFormat: [self labelForKey: @"Cannot access resource: \"%{Cn} %{SystemEmail}\""]]; - return [NSException exceptionWithHTTPStatus:403 reason: reason]; + return [NSException exceptionWithHTTPStatus:409 reason: reason]; } fbInfo = [NSMutableArray arrayWithArray: [folder fetchFreeBusyInfosFrom: start @@ -671,7 +671,7 @@ info = [NSDictionary dictionaryWithObject: reason forKey: @"reject"]; - return [NSException exceptionWithHTTPStatus: 403 + return [NSException exceptionWithHTTPStatus: 409 reason: [info jsonRepresentation]]; } } @@ -706,7 +706,7 @@ [info setObject: conflicts forKey: @"conflicts"]; - return [NSException exceptionWithHTTPStatus: 403 + return [NSException exceptionWithHTTPStatus: 409 reason: [info jsonRepresentation]]; } } // if ([fbInfo count]) ... @@ -1506,14 +1506,14 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent if (delegatedUid) delegatedUser = [SOGoUser userWithLogin: delegatedUid]; if (delegatedUser != nil && [event userIsOrganizer: delegatedUser]) - ex = [NSException exceptionWithHTTPStatus: 403 + ex = [NSException exceptionWithHTTPStatus: 409 reason: @"delegate is organizer"]; if ([event isAttendee: [[delegate email] rfc822Email]]) - ex = [NSException exceptionWithHTTPStatus: 403 + ex = [NSException exceptionWithHTTPStatus: 409 reason: @"delegate is a participant"]; else if ([SOGoGroup groupWithEmail: [[delegate email] rfc822Email] inDomain: [ownerUser domain]]) - ex = [NSException exceptionWithHTTPStatus: 403 + ex = [NSException exceptionWithHTTPStatus: 409 reason: @"delegate is a group"]; } if (ex == nil) @@ -1999,7 +1999,7 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent // TODO: send out a no-uid-conflict (DAV:href) xml element (rfc4791 section 5.3.2.1) if ([container resourceNameForEventUID: eventUID]) { - return [NSException exceptionWithHTTPStatus: 403 + return [NSException exceptionWithHTTPStatus: 409 reason: [NSString stringWithFormat: @"Event UID already in use. (%@)", eventUID]]; } @@ -2207,9 +2207,9 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent } // We first check of the sequences are alright. We don't accept attendees - // accepting "old" invitations. If that's the case, we return a 403 + // accepting "old" invitations. If that's the case, we return a 409 if ([[newEvent sequence] intValue] < [[oldEvent sequence] intValue]) - return [NSException exceptionWithHTTPStatus: 403 + return [NSException exceptionWithHTTPStatus: 409 reason: @"sequences don't match"]; // Remove the RSVP attribute, as an action from the attendee