From 7443fdc6398dc598cdd97f2da40efed742ed257e Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 26 Sep 2011 10:20:27 +0000 Subject: [PATCH] * GroupDAV/KDE assume KDE 4.7+ uses native Akonadi resource, while below pre-Akonadi GroupDAV resource is used: unfortunately both have contradicting requirements --- phpgwapi/inc/class.groupdav.inc.php | 5 ++++- phpgwapi/inc/class.groupdav_handler.inc.php | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.groupdav.inc.php b/phpgwapi/inc/class.groupdav.inc.php index ea4f3358a4..c897263efc 100644 --- a/phpgwapi/inc/class.groupdav.inc.php +++ b/phpgwapi/inc/class.groupdav.inc.php @@ -206,9 +206,12 @@ class groupdav extends HTTP_WebDAV_Server // identify clients, which do NOT support path AND full url in of PROPFIND request switch(($agent = groupdav_handler::get_agent())) { + case 'akonadi': + $this->cnrnd = true; // Akonadi seems to require redundant namespaces, see KDE bug #265096 https://bugs.kde.org/show_bug.cgi?id=265096 + break; case 'kde': // KAddressbook (at least in 3.5 can NOT subscribe / does NOT find addressbook) $this->client_require_href_as_url = true; - $this->cnrnd = true; // Akonadi seems to require redundant namespaces, see KDE bug #265096 https://bugs.kde.org/show_bug.cgi?id=265096 + $this->cnrnd = false; // KDE before Akonadi seems NOT to work with cnrnd (redundant namespaces) break; case 'cfnetwork': // Apple addressbook app case 'dataaccess': // iPhone addressbook diff --git a/phpgwapi/inc/class.groupdav_handler.inc.php b/phpgwapi/inc/class.groupdav_handler.inc.php index 71659f498d..3e2fda8392 100644 --- a/phpgwapi/inc/class.groupdav_handler.inc.php +++ b/phpgwapi/inc/class.groupdav_handler.inc.php @@ -351,6 +351,7 @@ abstract class groupdav_handler 'zideone' => 'zideone', // zideone outlook plugin 'lightning' => 'lightning', // Lighting (SOGo connector for addressbook) 'webkit' => 'webkit', // Webkit Browser (also reports KHTML!) + 'akonadi' => 'akonadi', // new KDE PIM framework (also reports KHTML!) 'khtml' => 'kde', // KDE clients 'neon' => 'neon', 'ical4ol' => 'ical4ol', // iCal4OL client @@ -377,6 +378,15 @@ abstract class groupdav_handler if ((int)$matches[1] < 868) $agent .= '_old'; } break; + case 'kde': + // Akonadi (new KDE Pim framework) unfortunately has same user-agent as old kde + // we can only assume KDE 4.7+ uses Akonadi native resource, while below this was not available + // Unfortunately the old pre-Akonadi GroupDAV resource can still be used, but we have no way of detecting it + if (preg_match('/KHTML\/([0-9.]+)/', $_SERVER['HTTP_USER_AGENT'], $matches) && (float)$matches[1] >= 4.7) + { + $agent = 'akonadi'; + } + break; } } }