1.1 --- a/imiptools/handlers/__init__.py Thu Sep 10 22:09:38 2015 +0200
1.2 +++ b/imiptools/handlers/__init__.py Thu Sep 10 23:56:21 2015 +0200
1.3 @@ -155,6 +155,14 @@
1.4 if not organiser_filter_fn(dict([organiser_item])):
1.5 return None
1.6
1.7 + # Test against any previously-received organiser details.
1.8 +
1.9 + obj = self.get_stored_object_version()
1.10 + if obj:
1.11 + stored_organiser = get_uri(obj.get_value("ORGANIZER"))
1.12 + if stored_organiser != organiser:
1.13 + return None
1.14 +
1.15 return organiser_item
1.16
1.17 def require_attendees(self, from_organiser=True):
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/tests/templates/event-request-imposter.txt Thu Sep 10 23:56:21 2015 +0200
2.3 @@ -0,0 +1,35 @@
2.4 +Content-Type: multipart/alternative; boundary="===============0047278175=="
2.5 +MIME-Version: 1.0
2.6 +From: vincent.vole@example.com
2.7 +To: resource-room-confroom@example.com
2.8 +Subject: Invitation!
2.9 +
2.10 +--===============0047278175==
2.11 +Content-Type: text/plain; charset="us-ascii"
2.12 +MIME-Version: 1.0
2.13 +Content-Transfer-Encoding: 7bit
2.14 +
2.15 +This message contains an event. The organiser is not the real organiser!
2.16 +
2.17 +--===============0047278175==
2.18 +MIME-Version: 1.0
2.19 +Content-Transfer-Encoding: 7bit
2.20 +Content-Type: text/calendar; charset="us-ascii"; method="REQUEST"
2.21 +
2.22 +BEGIN:VCALENDAR
2.23 +PRODID:-//imip-agent/test//EN
2.24 +METHOD:REQUEST
2.25 +VERSION:2.0
2.26 +BEGIN:VEVENT
2.27 +ORGANIZER:mailto:vincent.vole@example.com
2.28 +ATTENDEE;ROLE=CHAIR:mailto:paul.boddie@example.com
2.29 +ATTENDEE;RSVP=TRUE:mailto:resource-room-confroom@example.com
2.30 +DTSTAMP:20141125T004600Z
2.31 +DTSTART;TZID=Europe/Oslo:20141126T163000
2.32 +DTEND;TZID=Europe/Oslo:20141126T170000
2.33 +SUMMARY:Meeting at 4:30pm
2.34 +UID:event1@example.com
2.35 +END:VEVENT
2.36 +END:VCALENDAR
2.37 +
2.38 +--===============0047278175==--
3.1 --- a/tests/test_resource_invitation.sh Thu Sep 10 22:09:38 2015 +0200
3.2 +++ b/tests/test_resource_invitation.sh Thu Sep 10 23:56:21 2015 +0200
3.3 @@ -58,6 +58,24 @@
3.4 && echo "Success" \
3.5 || echo "Failed"
3.6
3.7 + "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-imposter.txt" 2>> $ERROR \
3.8 +| "$SHOWMAIL" \
3.9 +> out2i.tmp
3.10 +
3.11 + ! grep -q 'METHOD:REPLY' out2i.tmp \
3.12 +&& echo "Success" \
3.13 +|| echo "Failed"
3.14 +
3.15 + "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
3.16 +| "$SHOWMAIL" \
3.17 +> out3i.tmp
3.18 +
3.19 + grep -q 'METHOD:REPLY' out3i.tmp \
3.20 +&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out3i.tmp \
3.21 +&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T153000Z/20141126T160000Z' out3i.tmp \
3.22 +&& echo "Success" \
3.23 +|| echo "Failed"
3.24 +
3.25 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-conflict.txt" 2>> $ERROR \
3.26 | "$SHOWMAIL" \
3.27 > out4.tmp