[Pkg-owncloud-commits] [php-sabredav] 09/275: Finding attendees.

David Prévot taffit at moszumanska.debian.org
Thu Sep 25 14:55:45 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit f92ae19059a58ae749e39dd5b9ab141200c3811a
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Thu Aug 22 14:56:31 2013 +0100

    Finding attendees.
---
 lib/Sabre/CalDAV/ICalendar.php       |  7 +++++--
 lib/Sabre/CalDAV/Schedule/Plugin.php | 24 ++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/lib/Sabre/CalDAV/ICalendar.php b/lib/Sabre/CalDAV/ICalendar.php
index 8be36d3..37adf88 100644
--- a/lib/Sabre/CalDAV/ICalendar.php
+++ b/lib/Sabre/CalDAV/ICalendar.php
@@ -1,7 +1,10 @@
 <?php
 
 namespace Sabre\CalDAV;
-use Sabre\DAV;
+
+use
+    Sabre\DAV,
+    Sabre\DAVACL;
 
 /**
  * Calendar interface
@@ -12,7 +15,7 @@ use Sabre\DAV;
  * @author Evert Pot (http://evertpot.com/)
  * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
  */
-interface ICalendar extends DAV\ICollection {
+interface ICalendar extends DAV\ICollection, DAVACL\IACL {
 
     /**
      * Performs a calendar-query on the contents of this calendar.
diff --git a/lib/Sabre/CalDAV/Schedule/Plugin.php b/lib/Sabre/CalDAV/Schedule/Plugin.php
index 25a6fa6..5d5b2f8 100644
--- a/lib/Sabre/CalDAV/Schedule/Plugin.php
+++ b/lib/Sabre/CalDAV/Schedule/Plugin.php
@@ -381,6 +381,30 @@ class Plugin extends ServerPlugin {
             return;
         }
 
+        // Finding all the email addresses for the user that owns the
+        // calendar.
+        $calendarOwner = $node->getOwner();
+
+        $CAUS = '{' . self::NS_CALDAV . '}calendar-user-address-set';
+
+        $properties = $this->server->getProperties(
+            $calendarOwner,
+            [$CAUS],
+        );
+
+        // If we can't find this information, we'll stop processing
+        if (!isset($properties[$CAUS])) {
+            return;
+        }
+
+        $addresses = $properties[$CUAS]->getHrefs();
+
+        // We're only handling creation of new objects by the ORGANIZER.
+        // Support for ATTENDEE will come later.
+        if (!in_array($organizer, $addresses)) {
+            return;
+        }
+
     }
 
     /**

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list