You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 lines
1.2 KiB

<?php
/**
* @package tikiwiki
*/
// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
// TESTING STEPS:
// 1. Use browser with the base uri
// 2. Use davfs or other webdav client
// 3. Use litmus testing tool http://www.webdav.org/neon/litmus/ - currently only
// prop-related tests fail because we don't support custom properties (yet)
use Sabre\DAV;
use Tiki\SabreDav\Directory;
use Tiki\SabreDav\BasicAuth;
use Tiki\SabreDav\LocksBackend;
require_once 'tiki-setup.php';
$access->check_feature('feature_webdav');
$publicDir = new Directory($prefs['fgal_root_id']);
$server = new DAV\Server($publicDir);
$server->setBaseUri($tikiroot . 'tiki-webdav.php');
// This ensures that we get a pretty index in the browser, but it is optional.
$server->addPlugin(new DAV\Browser\Plugin());
$authBackend = new BasicAuth();
$authPlugin = new DAV\Auth\Plugin($authBackend);
$server->addPlugin($authPlugin);
$locksBackend = new LocksBackend($tikipath . 'temp/davlocks');
$locksPlugin = new DAV\Locks\Plugin($locksBackend);
$server->addPlugin($locksPlugin);
$server->exec();