initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import)

This commit is contained in:
redmatrix
2016-05-10 17:26:44 -07:00
parent 40b5b6e9d2
commit 0b02a6d123
735 changed files with 64728 additions and 42397 deletions

View File

@@ -60,8 +60,16 @@ class Dav extends \Zotlabs\Web\Controller {
if ($which)
profile_load($a, $which, $profile);
$auth = new \Zotlabs\Storage\BasicAuth();
$authBackend = new \Sabre\DAV\Auth\Backend\BasicCallBack(function($userName,$password) {
if(account_verify_password($userName,$password))
return true;
return false;
});
$ob_hash = get_observer_hash();
if ($ob_hash) {
@@ -92,6 +100,12 @@ class Dav extends \Zotlabs\Web\Controller {
// A SabreDAV server-object
$server = new SDAV\Server($rootDirectory);
$authPlugin = new \Sabre\DAV\Auth\Plugin($authBackend);
$server->addPlugin($authPlugin);
// prevent overwriting changes each other with a lock backend
$lockBackend = new SDAV\Locks\Backend\File('store/[data]/locks');
$lockPlugin = new SDAV\Locks\Plugin($lockBackend);