CardDAV (beta/unstable)

This commit is contained in:
RainLoop Team 2013-12-24 03:56:47 +04:00
parent 248aab17c2
commit fb54efe922
25 changed files with 133 additions and 26 deletions

View file

@ -1878,7 +1878,7 @@ class Actions
$this->setConfigFromParams($oConfig, 'ContactsEnable', 'contacts', 'enable', 'bool');
$this->setConfigFromParams($oConfig, 'ContactsSharing', 'contacts', 'allow_sharing', 'bool');
$this->setConfigFromParams($oConfig, 'ContactsSync', 'contacts', 'allow_carddav_sync', 'bool');
$this->setConfigFromParams($oConfig, 'ContactsSync', 'contacts', 'allow_sync', 'bool');
$this->setConfigFromParams($oConfig, 'ContactsPdoDsn', 'contacts', 'pdo_dsn', 'string');
$this->setConfigFromParams($oConfig, 'ContactsPdoUser', 'contacts', 'pdo_user', 'string');
$this->setConfigFromParams($oConfig, 'ContactsPdoPassword', 'contacts', 'pdo_password', 'dummy');

View file

@ -202,6 +202,7 @@ Enables caching in the system'),
'Experimental settings. Handle with care.
'),
'sync_dav_digest_auth' => array(false),
'sync_use_dav_browser' => array(true),
'allow_message_append' => array(false),
'date_from_headers' => array(false),
'cache_system_data' => array(true),

View file

@ -745,16 +745,30 @@ class ServiceActions
$oPrincipalCollection, $oAddressBookRoot
));
$aPath = \trim($this->oHttp->GetPath(), '/\\ ');
$oServer->setBaseUri((0 < \strlen($aPath) ? '/'.$aPath : '').'/index.php/dav/');
// $oServer->setBaseUri('/');
if (false === \strpos($this->oHttp->GetUrl(), '/index.php/dav/'))
{
$oServer->setBaseUri('/');
}
else
{
$aPath = \trim($this->oHttp->GetPath(), '/\\ ');
$oServer->setBaseUri((0 < \strlen($aPath) ? '/'.$aPath : '').'/index.php/dav/');
}
// 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 \Sabre\CardDAV\VCFExportPlugin());
$oServer->addPlugin(new \RainLoop\SabreDAV\Logger($this->Logger()));
$oServer->addPlugin(new \RainLoop\SabreDAV\Logger($this->Logger()));
if ($this->Config()->Get('labs', 'sync_use_dav_browser', false))
{
$oServer->addPlugin(new \Sabre\DAV\Browser\Plugin());
}
$this->Plugins()->RunHook('filter.sabre-dav-before-exec', array(&$oServer));
$oServer->exec();
}