* SoObjects/Appointments/SOGoAppointmentObject.m

(PUTAction:): detect conflicting event UID and
      deny the request accordingly.

  * Tests/Integration/test-caldav-scheduling.py:
    new test for bug #1853

Monotone-Parent: 32e30de409bdd4e864d0c454e1939c809fb8edcd
Monotone-Revision: a4ef73c2ad79c8da8d8e0c93767ab06e14bc846b

Monotone-Author: jraby@inverse.ca
Monotone-Date: 2012-06-27T16:06:20
This commit is contained in:
Jean Raby
2012-06-27 16:06:20 +00:00
parent c74b5a1cc1
commit 38b1cbd014
3 changed files with 45 additions and 1 deletions
+11 -1
View File
@@ -1756,15 +1756,25 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent
{
iCalCalendar *calendar;
SOGoUser *ownerUser;
iCalEvent *event;
iCalEvent *event, *conflictingEvent;
NSString *eventUID;
BOOL scheduling;
calendar = [iCalCalendar parseSingleFromSource: [rq contentAsString]];
event = [[calendar events] objectAtIndex: 0];
eventUID = [event uid];
ownerUser = [SOGoUser userWithLogin: owner];
scheduling = [self _shouldScheduleEvent: [event organizer]];
// make sure eventUID doesn't conflict with an existing event - see bug #1853
// TODO: send out a no-uid-conflict (DAV:href) xml element (rfc4791 section 5.3.2.1)
if (conflictingEvent = [container resourceNameForEventUID: eventUID])
{
NSString *reason = [NSString stringWithFormat: @"Event UID already in use. (%s)", eventUID];
return [NSException exceptionWithHTTPStatus:403 reason: reason];
}
//
// New event and we're the organizer -- send invitation to all attendees