From c79657705b2a95d1f2906952c37b2ac08de67cb2 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 21 Jan 2012 01:45:48 +0000 Subject: [PATCH] * CardDAV: Hack for iOS 5.0.1 addressbook to stop asking directory gateway permissions with depth=1, which might fail on installs with huge addressbooks --- phpgwapi/inc/class.groupdav.inc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.groupdav.inc.php b/phpgwapi/inc/class.groupdav.inc.php index cc15229573..b692bbbdc6 100644 --- a/phpgwapi/inc/class.groupdav.inc.php +++ b/phpgwapi/inc/class.groupdav.inc.php @@ -325,7 +325,7 @@ class groupdav extends HTTP_WebDAV_Server */ function PROPFIND(&$options, &$files, $method='PROPFIND') { - if ($this->debug) error_log(__CLASS__."::$method(".array2string($options,true).')'); + if ($this->debug) error_log(__CLASS__."::$method(".array2string($options).')'); // make options (readonly) available to all class methods, eg. prop_requested $this->propfind_options = $options; @@ -373,6 +373,12 @@ class groupdav extends HTTP_WebDAV_Server // KAddressbook doubles the folder, if the self URL contains the GroupDAV/CalDAV resourcetypes $files['files'][0] = $this->add_app($app,$app=='addressbook'&&$handler->get_agent()=='kde',$user,$path); + // Hack for iOS 5.0.1 addressbook to stop asking directory gateway permissions with depth=1 + if ($method == 'PROPFIND' && $options['path'] == '/addressbook/' && $handler->get_agent() == 'dataaccess') + { + error_log(__CLASS__."::$method(".array2string($options).') Enabling hack for iOS 5.0.1 addressbook: force Depth: 0 on PROPFIND for directory gateway!'); + return true; + } if (!$options['depth']) return true; // depth 0 --> show only the self url } return $handler->propfind($this->_slashify($options['path']),$options,$files,$user,$id);