Esempio n. 1
0
 /**
  * Initializes the plugin
  *
  * This method is automatically called by the Server class after addPlugin.
  * 
  * @param Sabre_DAV_Server $server 
  * @return void
  */
 public function initialize(Sabre_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'));
 }
Esempio n. 2
0
 /**
  * Initializes the plugin and subscribes to events 
  * 
  * @param Sabre_DAV_Server $server 
  * @return void
  */
 public function initialize(Sabre_DAV_Server $server)
 {
     $this->server = $server;
     $this->server->subscribeEvent('beforeMethod', array($this, 'httpGetInterceptor'));
     if ($this->enablePost) {
         $this->server->subscribeEvent('unknownMethod', array($this, 'httpPOSTHandler'));
     }
 }
Esempio n. 3
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';
     $this->server = $server;
     $this->server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
     $this->server->subscribeEvent('afterCreateFile', array($this, 'sendFileIdHeader'));
     $this->server->subscribeEvent('afterWriteContent', array($this, 'sendFileIdHeader'));
 }
 /**
  * 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;
     //$server->resourceTypeMapping['Sabre_CalDAV_IShareableCalendar'] = '{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}shared-owner';
     $server->resourceTypeMapping['Sabre_CalDAV_ISharedCalendar'] = '{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}shared';
     array_push($this->server->protectedProperties, '{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}invite', '{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}allowed-sharing-modes', '{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}shared-url');
     $this->server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
     $this->server->subscribeEvent('afterGetProperties', array($this, 'afterGetProperties'));
     $this->server->subscribeEvent('updateProperties', array($this, 'updateProperties'));
     $this->server->subscribeEvent('unknownMethod', array($this, 'unknownMethod'));
 }
 /**
  * Initializes the plugin 
  *
  * @param Sabre_DAV_Server $server 
  * @return void 
  */
 public function initialize(Sabre_DAV_Server $server)
 {
     /* Events */
     $server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
     $server->subscribeEvent('report', array($this, 'report'));
     /* 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';
     $this->server = $server;
 }
Esempio n. 6
0
 /**
  * Initializes the plugin
  *
  * Registers all required events and features.
  *
  * @param Sabre_DAV_Server $server
  * @return void
  */
 public function initialize(Sabre_DAV_Server $server)
 {
     $ns = '{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}';
     $this->server = $server;
     $server->resourceTypeMapping['Sabre_CalDAV_Schedule_IOutbox'] = $ns . 'schedule-outbox';
     $server->resourceTypeMapping['Sabre_CalDAV_Schedule_IInbox'] = $ns . 'schedule-inbox';
     // This ensures that a users' addresses are all searchable.
     $aclPlugin = $this->server->getPlugin('acl');
     if (!$aclPlugin) {
         throw new Sabre_DAV_Exception('ACL plugin must be loaded for the Scheduling plugin to work. We\'re doooomed');
     }
     $server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
     $server->subscribeEvent('unknownMethod', array($this, 'unknownMethod'));
     // $server->subscribeEvent('afterBind',array($this,'afterBind'));
 }
 /**
  * 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';
     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');
 }
Esempio n. 8
0
 function testUpdatePropertiesEventSuccess()
 {
     $tree = array(new Sabre_DAV_SimpleDirectory('foo'));
     $server = new Sabre_DAV_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);
 }
Esempio n. 9
0
 /**
  * Initializes the plugin
  *
  * @param Sabre_DAV_Server $server
  * @return void
  */
 public function initialize(Sabre_DAV_Server $server)
 {
     /* Events */
     $server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
     $server->subscribeEvent('updateProperties', array($this, 'updateProperties'));
     $server->subscribeEvent('report', array($this, 'report'));
     $server->subscribeEvent('onHTMLActionsPanel', array($this, 'htmlActionsPanel'));
     $server->subscribeEvent('onBrowserPostAction', array($this, 'browserPostAction'));
     /* 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;
 }
 /**
  * Initializes the plugin and subscribes to events
  *
  * @param Sabre_DAV_Server $server
  * @return void
  */
 public function initialize(Sabre_DAV_Server $server)
 {
     $this->server = $server;
     $this->server->subscribeEvent('beforeMethod', array($this, 'httpGetInterceptor'));
 }
 /**
  * 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);
 }
 /**
  * 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);
 }
Esempio n. 13
0
 /**
  * Sets up the plugin
  *
  * This method is automatically called by the server class.
  * 
  * @param Sabre_DAV_Server $server 
  * @return void
  */
 public function initialize(Sabre_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';
 }
Esempio n. 14
0
 /**
  * Initializes the plugin
  *
  * @param Sabre_DAV_Server $server
  * @return void
  */
 public function initialize(Sabre_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->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->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_ProxyRead'] = '{http://calendarserver.org/ns/}calendar-proxy-read';
     $server->resourceTypeMapping['Sabre_CalDAV_Principal_ProxyWrite'] = '{http://calendarserver.org/ns/}calendar-proxy-write';
     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');
 }
Esempio n. 15
0
 /**
  * Initializes the plugin 
  * 
  * @param Sabre_DAV_Server $server 
  * @return void
  */
 public function initialize(Sabre_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);
 }
Esempio n. 16
0
 /**
  * Initializes the plugin 
  * 
  * @param Sabre_DAV_Server $server 
  * @return void
  */
 public function initialize(Sabre_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('afterGetProperties', array($this, 'afterGetProperties'));
     $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';
     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-user-address-set');
 }
Esempio n. 17
0
 function initialize(Sabre_DAV_Server $server)
 {
     $server->subscribeEvent('beforeMethod', array($this, 'beforeMethod'));
 }
Esempio n. 18
0
 /**
  * Initializes the plugin
  *
  * This method is automatically called by the Server class after addPlugin.
  *
  * @param Sabre_DAV_Server $server
  * @return void
  */
 public function initialize(Sabre_DAV_Server $server)
 {
     $this->server = $server;
     $server->subscribeEvent('unknownMethod', array($this, 'unknownMethod'));
 }
Esempio n. 19
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);
 }
Esempio n. 20
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;
     $this->server->subscribeEvent('beforeWriteContent', array($this, 'checkQuota'), 10);
     $this->server->subscribeEvent('beforeCreateFile', array($this, 'checkQuota'), 10);
 }
 /**
  * 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
  */
 public function initialize(Sabre_DAV_Server $server)
 {
     $this->server = $server;
     $server->subscribeEvent('afterCreateFile', array($this, 'verifyContentLength'), 10);
     $server->subscribeEvent('afterWriteContent', array($this, 'verifyContentLength'), 10);
 }