1<?php
2/**
3 * @package tikiwiki
4 */
5// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
6//
7// All Rights Reserved. See copyright.txt for details and a complete list of authors.
8// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
9// $Id$
10
11// TESTING STEPS:
12// 1. Use browser with the base uri
13// 2. Use davfs or other webdav client
14// 3. Use litmus testing tool http://www.webdav.org/neon/litmus/ - currently only
15// prop-related tests fail because we don't support custom properties (yet)
16
17use Sabre\DAV;
18use Tiki\SabreDav\Directory;
19use Tiki\SabreDav\BasicAuth;
20use Tiki\SabreDav\LocksBackend;
21
22require_once 'tiki-setup.php';
23$access->check_feature('feature_webdav');
24
25$publicDir = new Directory($prefs['fgal_root_id']);
26
27$server = new DAV\Server($publicDir);
28$server->setBaseUri($tikiroot.'tiki-webdav.php');
29
30// This ensures that we get a pretty index in the browser, but it is optional.
31$server->addPlugin(new DAV\Browser\Plugin());
32
33$authBackend = new BasicAuth();
34$authPlugin = new DAV\Auth\Plugin($authBackend);
35$server->addPlugin($authPlugin);
36
37$locksBackend = new LocksBackend($tikipath.'temp/davlocks');
38$locksPlugin = new DAV\Locks\Plugin($locksBackend);
39$server->addPlugin($locksPlugin);
40
41$server->exec();
42