Ejemplo n.º 1
0
 /**
  * Initializes the plugin and registers event handlers 
  * 
  * @param \Sabre\DAV\Server $server 
  * @return void
  */
 public function initialize(\Sabre\DAV\Server $server)
 {
     $this->server = $server;
     $this->server->subscribeEvent('beforeMethod', array($this, 'beforeMethod'), 90);
     $this->server->subscribeEvent('afterCreateFile', array($this, 'afterCreateFile'), 90);
     $this->server->subscribeEvent('afterWriteContent', array($this, 'afterWriteContent'), 90);
 }
Ejemplo n.º 2
0
 /**
  * Initializes the plugin
  *
  * This method is automatically called by the Server class after addPlugin.
  *
  * @param DAV\Server $server
  * @return void
  */
 public function initialize(DAV\Server $server)
 {
     $this->server = $server;
     $server->subscribeEvent('unknownMethod', array($this, 'unknownMethod'));
     $server->subscribeEvent('beforeMethod', array($this, 'beforeMethod'), 50);
     $server->subscribeEvent('afterGetProperties', array($this, 'afterGetProperties'));
 }
Ejemplo n.º 3
0
 public function initialize(\Sabre\DAV\Server $server)
 {
     $this->server = $server;
     $server->subscribeEvent('beforeMethod', array($this, 'httpGetInterceptor'));
     $server->subscribeEvent('beforeMethod', array($this, 'beforeMethod'));
     $server->subscribeEvent('beforeCreateFile', array($this, 'beforeCreateFile'));
 }
Ejemplo n.º 4
0
 /**
  * Initializes the plugin
  *
  * @param \Sabre\DAV\Server $server
  * @return void
  */
 public function initialize(\Sabre\DAV\Server $server)
 {
     $this->server = $server;
     $this->server->subscribeEvent('beforeMethod', array($this, 'beforeMethod'));
     $this->server->subscribeEvent('beforeBind', array($this, 'beforeBind'), 30);
     $this->server->subscribeEvent('afterUnbind', array($this, 'afterUnbind'), 30);
 }
Ejemplo n.º 5
0
 /**
  * This initializes the plugin.
  *
  * This function is called by \Sabre\DAV\Server, after
  * addPlugin is called.
  *
  * This method should set up the required event subscriptions.
  *
  * @param \Sabre\DAV\Server $server
  * @return void
  */
 public function initialize(\Sabre\DAV\Server $server)
 {
     $server->xmlNamespaces[self::NS_OWNCLOUD] = 'oc';
     $server->propertyMap[self::TAGS_PROPERTYNAME] = 'OC\\Connector\\Sabre\\TagList';
     $this->server = $server;
     $this->server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
     $this->server->subscribeEvent('beforeGetPropertiesForPath', array($this, 'beforeGetPropertiesForPath'));
     $this->server->subscribeEvent('updateProperties', array($this, 'updateProperties'));
 }
Ejemplo n.º 6
0
 /**
  * This initializes the plugin.
  *
  * This function is called by \Sabre\DAV\Server, after
  * addPlugin is called.
  *
  * This method should set up the required event subscriptions.
  *
  * @param \Sabre\DAV\Server $server
  * @return void
  */
 public function initialize(\Sabre\DAV\Server $server)
 {
     $server->xmlNamespaces[self::NS_OWNCLOUD] = 'oc';
     $server->protectedProperties[] = '{' . self::NS_OWNCLOUD . '}id';
     $server->protectedProperties[] = '{' . self::NS_OWNCLOUD . '}permissions';
     $this->server = $server;
     $this->server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
     $this->server->subscribeEvent('afterCreateFile', array($this, 'sendFileIdHeader'));
     $this->server->subscribeEvent('afterWriteContent', array($this, 'sendFileIdHeader'));
 }
 /**
  * Initializes the plugin 
  * 
  * @param \Sabre\DAV\Server $server 
  * @return void
  */
 public function initialize(\Sabre\DAV\Server $server)
 {
     $this->server = $server;
     $this->server->subscribeEvent('unknownMethod', array($this, 'httpPOSTHandler'));
     $server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
     $server->xmlNamespaces[\Sabre\CalDAV\Plugin::NS_CALENDARSERVER] = 'cs';
     $server->resourceTypeMapping['\\Sabre\\CalDAV\\ICalendar'] = '{urn:ietf:params:xml:ns:caldav}calendar';
 }
 /**
  * Initializes the plugin 
  * 
  * @param \Sabre\DAV\Server $server 
  * @return void
  */
 public function initialize(\Sabre\DAV\Server $server)
 {
     $this->server = $server;
     $server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
     $server->xmlNamespaces[\Sabre\CalDAV\Plugin::NS_CALDAV] = 'cal';
     $server->resourceTypeMapping['\\Sabre\\CalDAV\\ICalendar'] = '{urn:ietf:params:xml:ns:caldav}calendar';
     // auto-scheduling extension
     array_push($server->protectedProperties, '{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}schedule-calendar-transp', '{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}schedule-default-calendar-URL', '{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}schedule-tag');
 }
 /**
  * Initializes the plugin 
  * 
  * @param \Sabre\DAV\Server $server 
  * @return void
  */
 public function initialize(\Sabre\DAV\Server $server)
 {
     $this->server = $server;
     $server->xmlNamespaces[\Sabre\CalDAV\Plugin::NS_CALDAV] = 'cal';
     $server->xmlNamespaces[\Sabre\CalDAV\Plugin::NS_CALENDARSERVER] = 'cs';
     #$server->subscribeEvent('beforeGetProperties',array($this,'beforeGetProperties'));
     $server->subscribeEvent('report', array($this, 'report'));
     array_push($server->protectedProperties, '{' . \Sabre\CalDAV\Plugin::NS_CALENDARSERVER . '}record-type', '{' . \Sabre\CalDAV\Plugin::NS_CALENDARSERVER . '}first-name', '{' . \Sabre\CalDAV\Plugin::NS_CALENDARSERVER . '}last-name');
 }
Ejemplo n.º 10
0
 function testUpdatePropertiesEventSuccess()
 {
     $tree = array(new SimpleCollection('foo'));
     $server = new Server($tree);
     $server->subscribeEvent('updateProperties', array($this, 'updatepropsuccess'));
     $result = $server->updateProperties('foo', array('{DAV:}foo' => 'bar', '{DAV:}foo2' => 'bla'));
     $expected = array('href' => 'foo', '200' => array('{DAV:}foo' => null), '201' => array('{DAV:}foo2' => null));
     $this->assertEquals($expected, $result);
 }
 /**
  * Initializes the plugin 
  * 
  * @param \Sabre\DAV\Server $server 
  * @return void
  */
 public function initialize(\Sabre\DAV\Server $server)
 {
     $this->server = $server;
     $self = $this;
     $server->subscribeEvent('report', function ($reportName, $dom, $uri) use($self, $server) {
         if ($reportName === '{DAV:}sync-collection') {
             $server->transactionType = 'report-sync-collection';
             $self->syncCollection($uri, $dom);
             return false;
         }
     });
 }
Ejemplo n.º 12
0
 /**
  * Initializes the plugin
  *
  * @param DAV\Server $server
  * @return void
  */
 public function initialize(DAV\Server $server)
 {
     /* Events */
     $server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
     $server->subscribeEvent('afterGetProperties', array($this, 'afterGetProperties'));
     $server->subscribeEvent('updateProperties', array($this, 'updateProperties'));
     $server->subscribeEvent('report', array($this, 'report'));
     $server->subscribeEvent('onHTMLActionsPanel', array($this, 'htmlActionsPanel'));
     $server->subscribeEvent('onBrowserPostAction', array($this, 'browserPostAction'));
     $server->subscribeEvent('beforeWriteContent', array($this, 'beforeWriteContent'));
     $server->subscribeEvent('beforeCreateFile', array($this, 'beforeCreateFile'));
     /* Namespaces */
     $server->xmlNamespaces[self::NS_CARDDAV] = 'card';
     /* Mapping Interfaces to {DAV:}resourcetype values */
     $server->resourceTypeMapping['Sabre\\CardDAV\\IAddressBook'] = '{' . self::NS_CARDDAV . '}addressbook';
     $server->resourceTypeMapping['Sabre\\CardDAV\\IDirectory'] = '{' . self::NS_CARDDAV . '}directory';
     /* Adding properties that may never be changed */
     $server->protectedProperties[] = '{' . self::NS_CARDDAV . '}supported-address-data';
     $server->protectedProperties[] = '{' . self::NS_CARDDAV . '}max-resource-size';
     $server->protectedProperties[] = '{' . self::NS_CARDDAV . '}addressbook-home-set';
     $server->protectedProperties[] = '{' . self::NS_CARDDAV . '}supported-collation-set';
     $server->propertyMap['{http://calendarserver.org/ns/}me-card'] = 'Sabre\\DAV\\Property\\Href';
     $this->server = $server;
 }
Ejemplo n.º 13
0
 function initialize(Server $server)
 {
     $this->server = $server;
     $server->subscribeEvent('beforeMethod', array($this, 'httpPostInterceptor'));
 }
Ejemplo n.º 14
0
 /**
  * Initializes the plugin
  *
  * @param DAV\Server $server
  * @return void
  */
 public function initialize(DAV\Server $server)
 {
     // Using a relatively low priority (200) to allow other extensions
     // to set the content-type first.
     $server->subscribeEvent('afterGetProperties', array($this, 'afterGetProperties'), 200);
 }
Ejemplo n.º 15
0
 public function initialize(\Sabre\DAV\Server $server)
 {
     $this->server = $server;
     $server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
     $server->subscribeEvent('afterGetProperties', array($this, 'afterGetProperties'));
 }
Ejemplo n.º 16
0
 /**
  * This initializes the plugin.
  *
  * This function is called by \Sabre\DAV\Server, after
  * addPlugin is called.
  *
  * This method should set up the requires event subscriptions.
  *
  * @param \Sabre\DAV\Server $server
  * @return void
  */
 public function initialize(\Sabre\DAV\Server $server)
 {
     $this->server = $server;
     $server->subscribeEvent('beforeWriteContent', array($this, 'checkQuota'), 10);
     $server->subscribeEvent('beforeCreateFile', array($this, 'checkQuota'), 10);
 }
Ejemplo n.º 17
0
 /**
  * Sets up the plugin
  *
  * This method is automatically called by the server class.
  *
  * @param DAV\Server $server
  * @return void
  */
 public function initialize(DAV\Server $server)
 {
     $this->server = $server;
     $server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
     $server->subscribeEvent('beforeMethod', array($this, 'beforeMethod'), 20);
     $server->subscribeEvent('beforeBind', array($this, 'beforeBind'), 20);
     $server->subscribeEvent('beforeUnbind', array($this, 'beforeUnbind'), 20);
     $server->subscribeEvent('updateProperties', array($this, 'updateProperties'));
     $server->subscribeEvent('beforeUnlock', array($this, 'beforeUnlock'), 20);
     $server->subscribeEvent('report', array($this, 'report'));
     $server->subscribeEvent('unknownMethod', array($this, 'unknownMethod'));
     array_push($server->protectedProperties, '{DAV:}alternate-URI-set', '{DAV:}principal-URL', '{DAV:}group-membership', '{DAV:}principal-collection-set', '{DAV:}current-user-principal', '{DAV:}supported-privilege-set', '{DAV:}current-user-privilege-set', '{DAV:}acl', '{DAV:}acl-restrictions', '{DAV:}inherited-acl-set', '{DAV:}owner', '{DAV:}group');
     // Automatically mapping nodes implementing IPrincipal to the
     // {DAV:}principal resourcetype.
     $server->resourceTypeMapping['Sabre\\DAVACL\\IPrincipal'] = '{DAV:}principal';
     // Mapping the group-member-set property to the HrefList property
     // class.
     $server->propertyMap['{DAV:}group-member-set'] = 'Sabre\\DAV\\Property\\HrefList';
 }
Ejemplo n.º 18
0
 /**
  * Initializes the plugin
  *
  * @param DAV\Server $server
  * @return void
  */
 public function initialize(DAV\Server $server)
 {
     $this->server = $server;
     $server->subscribeEvent('unknownMethod', array($this, 'unknownMethod'));
     //$server->subscribeEvent('unknownMethod',array($this,'unknownMethod2'),1000);
     $server->subscribeEvent('report', array($this, 'report'));
     $server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
     $server->subscribeEvent('onHTMLActionsPanel', array($this, 'htmlActionsPanel'));
     $server->subscribeEvent('onBrowserPostAction', array($this, 'browserPostAction'));
     $server->subscribeEvent('beforeWriteContent', array($this, 'beforeWriteContent'));
     $server->subscribeEvent('beforeCreateFile', array($this, 'beforeCreateFile'));
     $server->subscribeEvent('beforeMethod', array($this, 'beforeMethod'));
     $server->xmlNamespaces[self::NS_CALDAV] = 'cal';
     $server->xmlNamespaces[self::NS_CALENDARSERVER] = 'cs';
     $server->propertyMap['{' . self::NS_CALDAV . '}supported-calendar-component-set'] = 'Sabre\\CalDAV\\Property\\SupportedCalendarComponentSet';
     $server->propertyMap['{' . self::NS_CALDAV . '}schedule-calendar-transp'] = 'Sabre\\CalDAV\\Property\\ScheduleCalendarTransp';
     $server->resourceTypeMapping['\\Sabre\\CalDAV\\ICalendar'] = '{urn:ietf:params:xml:ns:caldav}calendar';
     $server->resourceTypeMapping['\\Sabre\\CalDAV\\Schedule\\IOutbox'] = '{urn:ietf:params:xml:ns:caldav}schedule-outbox';
     $server->resourceTypeMapping['\\Sabre\\CalDAV\\Principal\\IProxyRead'] = '{http://calendarserver.org/ns/}calendar-proxy-read';
     $server->resourceTypeMapping['\\Sabre\\CalDAV\\Principal\\IProxyWrite'] = '{http://calendarserver.org/ns/}calendar-proxy-write';
     $server->resourceTypeMapping['\\Sabre\\CalDAV\\Notifications\\ICollection'] = '{' . self::NS_CALENDARSERVER . '}notification';
     array_push($server->protectedProperties, '{' . self::NS_CALDAV . '}supported-calendar-component-set', '{' . self::NS_CALDAV . '}supported-calendar-data', '{' . self::NS_CALDAV . '}max-resource-size', '{' . self::NS_CALDAV . '}min-date-time', '{' . self::NS_CALDAV . '}max-date-time', '{' . self::NS_CALDAV . '}max-instances', '{' . self::NS_CALDAV . '}max-attendees-per-instance', '{' . self::NS_CALDAV . '}calendar-home-set', '{' . self::NS_CALDAV . '}supported-collation-set', '{' . self::NS_CALDAV . '}calendar-data', '{' . self::NS_CALDAV . '}schedule-inbox-URL', '{' . self::NS_CALDAV . '}schedule-outbox-URL', '{' . self::NS_CALDAV . '}calendar-user-address-set', '{' . self::NS_CALDAV . '}calendar-user-type', '{' . self::NS_CALENDARSERVER . '}getctag', '{' . self::NS_CALENDARSERVER . '}calendar-proxy-read-for', '{' . self::NS_CALENDARSERVER . '}calendar-proxy-write-for', '{' . self::NS_CALENDARSERVER . '}notification-URL', '{' . self::NS_CALENDARSERVER . '}notificationtype');
 }
 /**
  * Initializes the plugin 
  * 
  * @param \Sabre\DAV\Server $server 
  * @return void
  */
 public function initialize(\Sabre\DAV\Server $server)
 {
     $this->server = $server;
     $server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
     $server->xmlNamespaces[\Sabre\CalDAV\Plugin::NS_CALDAV] = 'cal';
 }
Ejemplo n.º 20
0
 /**
  * Initializes the plugin
  *
  * This method is automatically called by the Server class after addPlugin.
  *
  * @param DAV\Server $server
  * @return void
  */
 public function initialize(DAV\Server $server)
 {
     $this->server = $server;
     $server->subscribeEvent('unknownMethod', array($this, 'unknownMethod'));
 }
Ejemplo n.º 21
0
 /**
  * Initializes the plugin and registers event handlers
  *
  * @param \Sabre\DAV\Server $server
  * @return void
  */
 public function initialize(DAV\Server $server)
 {
     $this->server = $server;
     $this->server->subscribeEvent('beforeMethod', array($this, 'beforeMethod'), 90);
 }
Ejemplo n.º 22
0
 /**
  * This initializes the plugin.
  *
  * This function is called by \Sabre\DAV\Server, after
  * addPlugin is called.
  *
  * This method should set up the required event subscriptions.
  *
  * @param \Sabre\DAV\Server $server
  * @return void
  */
 public function initialize(\Sabre\DAV\Server $server)
 {
     $server->subscribeEvent('exception', array($this, 'logException'), 10);
 }
 /**
  * This initializes the plugin.
  *
  * This function is called by \Sabre\DAV\Server, after
  * addPlugin is called.
  *
  * This method should set up the required event subscriptions.
  *
  * @param \Sabre\DAV\Server $server
  * @return void
  */
 public function initialize(\Sabre\DAV\Server $server)
 {
     $this->server = $server;
     $this->server->subscribeEvent('beforeMethod', array($this, 'checkAppEnabled'), 30);
 }
Ejemplo n.º 24
0
 /**
  * This initializes the plugin.
  *
  * This function is called by \Sabre\DAV\Server, after
  * addPlugin is called.
  *
  * This method should set up the required event subscriptions.
  *
  * @param \Sabre\DAV\Server $server
  * @return void
  */
 public function initialize(\Sabre\DAV\Server $server)
 {
     $this->server = $server;
     $this->server->subscribeEvent('beforeMethod', array($this, 'checkMaintenanceMode'), 10);
 }