Change dav handle configuration (move to /index.php/dav/)

This commit is contained in:
RainLoop Team 2013-12-23 20:11:42 +04:00
parent 1c50b8df07
commit 248aab17c2
7 changed files with 40 additions and 23 deletions

View file

@ -715,6 +715,8 @@ class ServiceActions
{
try
{
include_once RAINLOOP_APP_LIBRARIES_PATH.'RainLoop/SabreDAV/MbStringFix.php';
\set_error_handler(function ($errno, $errstr, $errfile, $errline ) {
throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
});
@ -743,18 +745,17 @@ class ServiceActions
$oPrincipalCollection, $oAddressBookRoot
));
$oServer->setBaseUri('/');
$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()));
$oServer->exec();
}
catch (\Exception $oException)
@ -763,6 +764,19 @@ class ServiceActions
}
}
/**
* @return string
*/
public function ServiceDav()
{
if ($this->oActions->Config()->Get('contacts', 'allow_sync', false))
{
$this->HostDav();
}
return '';
}
/**
* @return string
*/