aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Dav.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-10 17:26:44 -0700
committerredmatrix <git@macgirvin.com>2016-05-10 17:26:44 -0700
commit0b02a6d123b2014705998c94ddf3d460948d3eac (patch)
tree78ff2cab9944a4f5ab3f80ec93cbe1120de90bb2 /Zotlabs/Module/Dav.php
parent40b5b6e9d2da7ab65c8b4d38cdceac83a4d78deb (diff)
downloadvolse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.gz
volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.bz2
volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.zip
initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import)
Diffstat (limited to 'Zotlabs/Module/Dav.php')
-rw-r--r--Zotlabs/Module/Dav.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/Zotlabs/Module/Dav.php b/Zotlabs/Module/Dav.php
index 9af059974..cc6ea4905 100644
--- a/Zotlabs/Module/Dav.php
+++ b/Zotlabs/Module/Dav.php
@@ -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);