/**
  * 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('report', array($this, 'report'));
     $server->xmlNamespaces[Sabre\CalDAV\Plugin::NS_CALDAV] = 'cal';
     $server->xmlNamespaces[Sabre\CalDAV\Plugin::NS_CALENDARSERVER] = 'cs';
     $server->resourceTypeMapping['Sabre\\CalDAV\\ICalendar'] = '{urn:ietf:params:xml:ns:caldav}calendar';
     /*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',
     
                 // scheduling extension
                 '{' . self::NS_CALDAV . '}calendar-user-address-set',
     
                 // CalendarServer extensions
                 '{' . self::NS_CALENDARSERVER . '}getctag',
                 '{' . self::NS_CALENDARSERVER . '}calendar-proxy-read-for',
                 '{' . self::NS_CALENDARSERVER . '}calendar-proxy-write-for'
     
             );*/
 }
Exemplo n.º 2
0
 /**
  * Initializes the plugin and subscribes to events
  *
  * @param DAV\Server $server
  * @return void
  */
 public function initialize(DAV\Server $server)
 {
     $this->server = $server;
     $this->server->subscribeEvent('beforeMethod', array($this, 'httpGetInterceptor'));
     $this->server->subscribeEvent('onHTMLActionsPanel', array($this, 'htmlActionsPanel'), 200);
     if ($this->enablePost) {
         $this->server->subscribeEvent('unknownMethod', array($this, 'httpPOSTHandler'));
     }
 }
Exemplo 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 DAV\Server $server
  * @return void
  */
 public function initialize(DAV\Server $server)
 {
     $this->server = $server;
     $server->resourceTypeMapping['Sabre\\CalDAV\\ISharedCalendar'] = '{' . Plugin::NS_CALENDARSERVER . '}shared';
     array_push($this->server->protectedProperties, '{' . Plugin::NS_CALENDARSERVER . '}invite', '{' . Plugin::NS_CALENDARSERVER . '}allowed-sharing-modes', '{' . 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)
 {
     $this->server = $server;
     $server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
     /* Namespaces */
     $server->xmlNamespaces[self::NS_OWNCLOUD] = 'owncloud';
     array_push($server->protectedProperties, '{' . self::NS_OWNCLOUD . '}id');
 }
Exemplo n.º 5
0
 /**
  * Initializes the plugin and registers event handlers
  *
  * @param DAV\Server $server
  * @return void
  */
 public function initialize(DAV\Server $server)
 {
     $this->server = $server;
     $this->server->subscribeEvent('beforeMethod', array($this, 'beforeMethod'), 90);
 }
Exemplo n.º 6
0
 /**
  * Initializes the plugin and subscribes to events
  *
  * @param DAV\Server $server
  * @return void
  */
 public function initialize(DAV\Server $server)
 {
     $this->server = $server;
     $this->server->subscribeEvent('beforeMethod', array($this, 'httpGetInterceptor'));
 }
Exemplo n.º 7
0
require '../../GO.php';
//require_once \GO::config()->root_path.'go/vendor/SabreDAV/lib/Sabre/autoload.php';
// Authentication backend
$authBackend = new \GO\Dav\Auth\Backend();
if (!\GO::modules()->isInstalled('dav')) {
    $msg = 'DAV module not installed. Install it at Start menu -> Apps.';
    trigger_error($msg, E_USER_WARNING);
    exit($msg);
}
$root = new \GO\Dav\Fs\RootDirectory();
$tree = new \GO\Dav\ObjectTree($root);
// The rootnode needs in turn to be passed to the server class
$server = new Sabre\DAV\Server($tree);
$server->debugExceptions = \GO::config()->debug;
$server->subscribeEvent('exception', function ($e) {
    \GO::debug((string) $e);
});
//baseUri can also be /webdav/ with:
//Alias /webdav/ /path/to/files.php
$baseUri = strpos($_SERVER['REQUEST_URI'], 'files.php') ? \GO::config()->host . 'modules/dav/files.php/' : '/webdav/';
$server->setBaseUri($baseUri);
$tmpDir = \GO::config()->getTempFolder()->createChild('dav', false);
$locksDir = $tmpDir->createChild('locksdb', false);
$locksDir->create();
// Support for LOCK and UNLOCK
//$lockBackend = new Sabre\DAV\Locks\Backend\FS($locksDir->path());
$lockBackend = new Sabre\DAV\Locks\Backend\PDO(\GO::getDbConnection(), 'dav_locks');
$lockPlugin = new Sabre\DAV\Locks\Plugin($lockBackend);
$server->addPlugin($lockPlugin);
// Support for html frontend
$browser = new Sabre\DAV\Browser\Plugin();
 /**
  * Initializes the plugin 
  * 
  * @param Sabre\DAV\Server $server 
  * @return void
  */
 public function initialize(Sabre\DAV\Server $server)
 {
     $this->server = $server;
     $server->subscribeEvent('report', array($this, 'report'));
 }