* CardDAV: fix not working creation of new CardDAV account with OS X 10.11.4 addressbook (it stays empty)

OS X 10.11.4 addressbook does a propfind for "addressbook-home-set" and "directory-gateway" in the root and does not continue without it
This commit is contained in:
Ralf Becker 2016-04-27 13:27:22 +00:00
parent aa00eb9c27
commit 0e6fd77ffe
2 changed files with 18 additions and 0 deletions

View File

@ -1086,6 +1086,23 @@ class addressbook_groupdav extends Api\CalDAV\Handler
return $shared;
}
/**
* Hook to add properties to CardDAV root
*
* OS X 10.11.4 addressbook does a propfind for "addressbook-home-set" and "directory-gateway"
* in the root and does not continue without it.
*
* @param array $data
*/
public static function groupdav_root_props(array $data)
{
$data['props']['addressbook-home-set'] = Api\CalDAV::mkprop(Api\CalDAV::CARDDAV, 'addressbook-home-set', array(
Api\CalDAV::mkprop('href',$data['caldav']->base_uri.'/'.$GLOBALS['egw_info']['user']['account_lid'].'/')));
$data['props']['directory-gateway'] = Api\CalDAV::mkprop(Api\CalDAV::CARDDAV, 'directory-gateway', array(
Api\CalDAV::mkprop('href',$data['caldav']->base_uri.'/addressbook/')));
}
/**
* Return appliction specific settings
*

View File

@ -47,6 +47,7 @@ $setup_info['addressbook']['hooks']['not_enum_group_acls'] = 'addressbook_hooks:
$setup_info['addressbook']['hooks']['export_limit'] = 'addressbook_hooks::getAppExportLimit';
$setup_info['addressbook']['hooks']['acl_rights'] = 'addressbook_hooks::acl_rights';
$setup_info['addressbook']['hooks']['categories'] = 'addressbook_hooks::categories';
$setup_info['addressbook']['hooks']['groupdav_root_props'] = 'addressbook_groupdav::groupdav_root_props';
/* Dependencies for this app to work */
$setup_info['addressbook']['depends'][] = array(