supported-report-set as required for CardDAV and Sogo connector

This commit is contained in:
Ralf Becker 2010-01-07 02:04:09 +00:00
parent 2e99a3fb20
commit b446f6de4e
2 changed files with 26 additions and 1 deletions

View File

@ -325,6 +325,22 @@ class addressbook_groupdav extends groupdav_handler
return '"'.$result[0]['modified'].'"';
}
/**
* Add extra properties for addressbook collections
*
* @param array $props=array() regular props by the groupdav handler
* @return array
*/
static function extra_properties(array $props=array())
{
// supported reports (required property for CardDAV)
$props[] = HTTP_WebDAV_Server::mkprop('supported-report-set',array(
HTTP_WebDAV_Server::mkprop('supported-report','addressbook-query'),
HTTP_WebDAV_Server::mkprop('supported-report','addressbook-multiget'),
));
return $props;
}
/**
* Get the handler and set the supported fields
*

View File

@ -497,7 +497,16 @@ class groupdav extends HTTP_WebDAV_Server
default:
$ns = $prop['ns'];
}
$arr[$ns.':'.$prop['name']] = $prop['val'];
// allow multiple values for same name
if (isset($arr[$ns.':'.$prop['name']]))
{
$arr[$ns.':'.$prop['name']] = (array)$arr[$ns.':'.$prop['name']];
$arr[$ns.':'.$prop['name']][] = $prop['val'];
}
else
{
$arr[$ns.':'.$prop['name']] = $prop['val'];
}
}
return $arr;
}