From c77521cbd02b54d5fd38db8e2229101f87826871 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 22 Oct 2012 16:44:10 +0000 Subject: [PATCH] * CalDAV: fixed parsing of principal urls used by iOS6 for users --- phpgwapi/inc/class.groupdav_principals.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.groupdav_principals.inc.php b/phpgwapi/inc/class.groupdav_principals.inc.php index 5caf571eb5..4d843e49f4 100644 --- a/phpgwapi/inc/class.groupdav_principals.inc.php +++ b/phpgwapi/inc/class.groupdav_principals.inc.php @@ -974,7 +974,7 @@ class groupdav_principals extends groupdav_handler */ static public function url2uid($url, $only_type=null) { - if (!$only_type) $only_type = array('accounts', 'groups', 'resources', 'locations', 'mailto'); + if (!$only_type) $only_type = array('users', 'groups', 'resources', 'locations', 'mailto'); if ($url[0] == '/') { @@ -990,7 +990,7 @@ class groupdav_principals extends groupdav_handler { case 'http': case 'https': - list(,$rest) = explode($GLOBALS['egw_info']['server']['webserver_url'].'/groupdav.php/principals/', $url); + list(,$rest) = explode('/groupdav.php/principals/', $url); list($type, $name) = explode('/', $rest); switch($type) { @@ -1008,7 +1008,7 @@ class groupdav_principals extends groupdav_handler case 'mailto': if (($uid = $GLOBALS['egw']->accounts->name2id($rest, 'account_email'))) { - $type = $uid > 0 ? 'accounts' : 'groups'; + $type = $uid > 0 ? 'users' : 'groups'; break; } // search contacts for email @@ -1039,6 +1039,7 @@ class groupdav_principals extends groupdav_handler { if ($type == 'accounts') { + $type = $id > 0 ? 'users' : 'groups'; $uid = $id; } else @@ -1064,6 +1065,7 @@ class groupdav_principals extends groupdav_handler } return false; } + //error_log(__METHOD__."('$url', ".array2string($only_type).") uid='$uid', type='$type' --> returning ".array2string($uid && in_array($type, $only_type) ? $uid : false)); return $uid && in_array($type, $only_type) ? $uid : false; }