CardDAV (pre-alpha/unstable)

This commit is contained in:
RainLoop Team 2013-12-23 04:06:48 +04:00
parent 0ec965bccb
commit 599e934b4a
76 changed files with 6984 additions and 1512 deletions

View file

@ -711,16 +711,8 @@ class ServiceActions
));
}
/**
* @return string
*/
public function ServiceDav()
public function HostDav()
{
if (!$this->Config()->Get('contacts', 'allow_carddav_sync', false))
{
return '';
}
try
{
\set_error_handler(function ($errno, $errstr, $errfile, $errline ) {
@ -730,7 +722,7 @@ class ServiceActions
$oPersonalAddressBookProvider = $this->oActions->PersonalAddressBookProvider();
$oAuthBackend = null;
if ($this->Config()->Get('labs', 'use_dav_digest_auth', false))
if ($this->Config()->Get('labs', 'sync_dav_digest_auth', false))
{
$oAuthBackend = new \RainLoop\SabreDAV\AuthDigest($oPersonalAddressBookProvider);
}
@ -751,18 +743,17 @@ class ServiceActions
$oPrincipalCollection, $oAddressBookRoot
));
$aPath = \trim($this->oHttp->GetPath(), '/\\ ');
$oServer->setBaseUri((0 < \strlen($aPath) ? '/'.$aPath : '').'/index.php/dav/');
$oServer->setBaseUri('/');
// Plugins
$oServer->addPlugin(new \Sabre\DAV\Auth\Plugin($oAuthBackend, 'RainLoop'));
$oServer->addPlugin(new \Sabre\DAV\Browser\Plugin());
$oServer->addPlugin(new \Sabre\CardDAV\Plugin());
$oServer->addPlugin(new \Sabre\DAVACL\Plugin());
$oServer->addPlugin(new \RainLoop\SabreDAV\Logger($this->Logger()));
// $oAclPlugin = new \Sabre\DAVACL\Plugin();
// $oAclPlugin->hideNodesFromListings = true;
// $oAclPlugin->allowAccessToNodesWithoutACL = false;
// $oServer->addPlugin($oAclPlugin);
$oServer->exec();
}
@ -770,8 +761,6 @@ class ServiceActions
{
$this->Logger()->WriteException($oException);
}
return '';
}
/**