forked from extern/egroupware
* CalDAV/CardDAV: return urn:uuid as last record in calendar-user-address-set, as according to iCal4OL developer, some clients might have problems with it, also adding both full uri and just path of principal url, as calendarserver does it
This commit is contained in:
parent
a6f541edba
commit
e69918f583
@ -735,9 +735,7 @@ class addressbook_groupdav extends groupdav_handler
|
||||
{
|
||||
if (!isset($modified)) $modified = $this->getctag($path, $user);
|
||||
|
||||
return (strpos($this->base_uri, 'http') === 0 ? '' : // need a full uri, not just a path
|
||||
($_SERVER["HTTPS"] === "on" ? "https:" : "http:") .'//' . $_SERVER['HTTP_HOST']).
|
||||
$this->base_uri.$path.$modified;
|
||||
return $this->base_uri().$path.$modified;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -551,6 +551,34 @@ abstract class groupdav_handler
|
||||
// we urldecode here, as HTTP_WebDAV_Server uses a minimal (#?%) urlencoding for incomming pathes and urlencodes pathes in propfind
|
||||
return $this->groupdav->add_resource($path.urldecode($this->get_path($entry)), $props, $privileges);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return base uri, making sure it's either a full uri (incl. protocoll and host) or just a path
|
||||
*
|
||||
* base_uri of WebDAV class can be both, depending on EGroupware config
|
||||
*
|
||||
* @param boolean $full_uri=true
|
||||
* @return string eg. https://domain.com/egroupware/groupdav.php
|
||||
*/
|
||||
public function base_uri($full_uri=true)
|
||||
{
|
||||
static $uri;
|
||||
static $path;
|
||||
|
||||
if (!isset($uri))
|
||||
{
|
||||
$uri = $path = $this->groupdav->base_uri;
|
||||
if ($uri[0] == '/')
|
||||
{
|
||||
$uri = ($_SERVER["HTTPS"] === "on" ? "https:" : "http:") .'//' . $_SERVER['HTTP_HOST'] . $uri;
|
||||
}
|
||||
else
|
||||
{
|
||||
$path = parse_url($uri, PHP_URL_PATH);
|
||||
}
|
||||
}
|
||||
return $full_uri ? $uri : $path;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -937,8 +937,10 @@ class groupdav_principals extends groupdav_handler
|
||||
HTTP_WebDAV_Server::mkprop('href',$this->base_uri.'/'.$account['account_lid'].'/inbox/'))),
|
||||
'calendar-user-address-set' => HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-user-address-set',array(
|
||||
HTTP_WebDAV_Server::mkprop('href','MAILTO:'.$account['account_email']),
|
||||
HTTP_WebDAV_Server::mkprop('href',$this->base_uri(true).'/principals/users/'.$account['account_lid'].'/'),
|
||||
HTTP_WebDAV_Server::mkprop('href',$this->base_uri(false).'/principals/users/'.$account['account_lid'].'/'),
|
||||
HTTP_WebDAV_Server::mkprop('href','urn:uuid:'.common::generate_uid('accounts', $account['account_id'])),
|
||||
HTTP_WebDAV_Server::mkprop('href',$this->base_uri.'/principals/users/'.$account['account_lid'].'/'))),
|
||||
)),
|
||||
'calendar-user-type' => HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-user-type','INDIVIDUAL'),
|
||||
// Calendarserver
|
||||
'email-address-set' => HTTP_WebDAV_Server::mkprop(groupdav::CALENDARSERVER,'email-address-set',array(
|
||||
@ -1093,8 +1095,10 @@ class groupdav_principals extends groupdav_handler
|
||||
'addressbook-home-set' => HTTP_WebDAV_Server::mkprop(groupdav::CARDDAV,'addressbook-home-set',array(
|
||||
HTTP_WebDAV_Server::mkprop('href',$this->base_uri.'/'.$account['account_lid'].'/'))),
|
||||
'calendar-user-address-set' => HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-user-address-set',array(
|
||||
HTTP_WebDAV_Server::mkprop('href',$this->base_uri(true).'/principals/groups/'.$account['account_lid'].'/'),
|
||||
HTTP_WebDAV_Server::mkprop('href',$this->base_uri(false).'/principals/groups/'.$account['account_lid'].'/'),
|
||||
HTTP_WebDAV_Server::mkprop('href','urn:uuid:'.common::generate_uid('accounts', $account['account_id'])),
|
||||
HTTP_WebDAV_Server::mkprop('href',$this->base_uri.'/principals/groups/'.$account['account_lid'].'/'))),
|
||||
)),
|
||||
'record-type' => HTTP_WebDAV_Server::mkprop(groupdav::CALENDARSERVER,'record-type','groups'),
|
||||
'calendar-user-type' => HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-user-type','GROUP'),
|
||||
'group-member-set' => $this->principal_set('group-member-set', $groupmembers),
|
||||
@ -1117,8 +1121,10 @@ class groupdav_principals extends groupdav_handler
|
||||
'getetag' => $this->get_resource_etag($resource),
|
||||
'displayname' => $displayname,
|
||||
'calendar-user-address-set' => HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-user-address-set',array(
|
||||
HTTP_WebDAV_Server::mkprop('href',$this->base_uri(true).'/principals/'.$name.'/'),
|
||||
HTTP_WebDAV_Server::mkprop('href',$this->base_uri(false).'/principals/'.$name.'/'),
|
||||
HTTP_WebDAV_Server::mkprop('href','urn:uuid:'.common::generate_uid('resources', $resource['res_id'])),
|
||||
HTTP_WebDAV_Server::mkprop('href',$this->base_uri.'/principals/'.$name.'/'))),
|
||||
)),
|
||||
'record-type' => HTTP_WebDAV_Server::mkprop(groupdav::CALENDARSERVER,'record-type',$is_location ? 'locations' : 'resources'),
|
||||
'calendar-user-type' => HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-user-type',$is_location ? 'ROOM' : 'RESOURCE'),
|
||||
'resource-id' => array(HTTP_WebDAV_Server::mkprop('href','urn:uuid:'.common::generate_uid('resources', $resource['res_id']))),
|
||||
|
Loading…
Reference in New Issue
Block a user