* WebDAV/GroupDAV/CalDAV/CardDAV: removed option only used for old KDE GroupDAV resource and unknown WebDAV clients producing invalid XML, fix for community bug #3152

This commit is contained in:
Ralf Becker 2012-08-13 09:32:03 +00:00
parent 7eec30c57a
commit c23f7fc95b
3 changed files with 2 additions and 28 deletions

View File

@ -86,13 +86,5 @@ if (strpos($_SERVER['REQUEST_URI'],'/webdav.php/clientsync') !== false &&
$GLOBALS['egw']->session->commit_session(); $GLOBALS['egw']->session->commit_session();
$webdav_server = new vfs_webdav_server(); $webdav_server = new vfs_webdav_server();
$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
if (strstr($user_agent, 'microsoft-webdav') !== false ||
strstr($user_agent, 'neon') !== false ||
strstr($user_agent, 'bitkinex') !== false)
{
// Windows 7 et.al. special treatment
$webdav_server->cnrnd = true;
}
$webdav_server->ServeRequest(); $webdav_server->ServeRequest();
//error_log(sprintf('WebDAV %s request: status "%s", took %5.3f s'.($headertime?' (header include took %5.3f s)':''),$_SERVER['REQUEST_METHOD'].' '.$_SERVER['PATH_INFO'],$webdav_server->_http_status,microtime(true)-$starttime,$headertime-$starttime)); //error_log(sprintf('WebDAV %s request: status "%s", took %5.3f s'.($headertime?' (header include took %5.3f s)':''),$_SERVER['REQUEST_METHOD'].' '.$_SERVER['PATH_INFO'],$webdav_server->_http_status,microtime(true)-$starttime,$headertime-$starttime));

View File

@ -209,39 +209,29 @@ class groupdav extends HTTP_WebDAV_Server
set_exception_handler(array(__CLASS__,'exception_handler')); set_exception_handler(array(__CLASS__,'exception_handler'));
// crrnd: client refuses redundand namespace declarations // crrnd: client refuses redundand namespace declarations
// cnrnd: client needs redundand namespace declarations
// setting redundand namespaces as the default for (Cal|Card|Group)DAV, as the majority of the clients either require or can live with it // setting redundand namespaces as the default for (Cal|Card|Group)DAV, as the majority of the clients either require or can live with it
$this->cnrnd = true; $this->crrnd = false;
// identify clients, which do NOT support path AND full url in <D:href> of PROPFIND request // identify clients, which do NOT support path AND full url in <D:href> of PROPFIND request
switch(($agent = groupdav_handler::get_agent())) 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) case 'kde': // KAddressbook (at least in 3.5 can NOT subscribe / does NOT find addressbook)
$this->client_require_href_as_url = true; $this->client_require_href_as_url = true;
$this->cnrnd = false; // KDE before Akonadi seems NOT to work with cnrnd (redundant namespaces)
break; break;
case 'cfnetwork': // Apple addressbook app case 'cfnetwork': // Apple addressbook app
case 'dataaccess': // iPhone addressbook case 'dataaccess': // iPhone addressbook
$this->client_require_href_as_url = false; $this->client_require_href_as_url = false;
$this->cnrnd = true;
break; break;
case 'davkit': // iCal app in OS X 10.6 created wrong request, if full url given case 'davkit': // iCal app in OS X 10.6 created wrong request, if full url given
case 'coredav': // iCal app in OS X 10.7 case 'coredav': // iCal app in OS X 10.7
case 'calendarstore': // Apple iCal 5.0.1 under OS X 10.7.2 case 'calendarstore': // Apple iCal 5.0.1 under OS X 10.7.2
$this->client_require_href_as_url = false; $this->client_require_href_as_url = false;
$this->cnrnd = true;
break; break;
case 'cfnetwork_old': case 'cfnetwork_old':
$this->crrnd = true; // Older Apple Addressbook.app does not cope with namespace redundancy $this->crrnd = true; // Older Apple Addressbook.app does not cope with namespace redundancy
break; break;
case 'neon':
$this->cnrnd = true; // neon clients like cadaver
break;
} }
if ($this->debug) error_log(__METHOD__."() HTTP_USER_AGENT='$_SERVER[HTTP_USER_AGENT]' --> '$agent' --> client_requires_href_as_url=$this->client_require_href_as_url, crrnd(client refuses redundand namespace declarations)=$this->crrnd, cnrnd(client needs redundand namespace declarations)=$this->cnrnd"); if ($this->debug) error_log(__METHOD__."() HTTP_USER_AGENT='$_SERVER[HTTP_USER_AGENT]' --> '$agent' --> client_requires_href_as_url=$this->client_require_href_as_url, crrnd(client refuses redundand namespace declarations)=$this->crrnd");
// adding EGroupware version to X-Dav-Powered-By header eg. "EGroupware 1.8.001 CalDAV/CardDAV/GroupDAV server" // adding EGroupware version to X-Dav-Powered-By header eg. "EGroupware 1.8.001 CalDAV/CardDAV/GroupDAV server"
$this->dav_powered_by = str_replace('EGroupware','EGroupware '.$GLOBALS['egw_info']['server']['versions']['phpgwapi'], $this->dav_powered_by = str_replace('EGroupware','EGroupware '.$GLOBALS['egw_info']['server']['versions']['phpgwapi'],

View File

@ -70,13 +70,5 @@ catch (egw_exception_no_permission_app $e)
$GLOBALS['egw']->session->commit_session(); $GLOBALS['egw']->session->commit_session();
$webdav_server = new vfs_webdav_server(); $webdav_server = new vfs_webdav_server();
$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
if (strstr($user_agent, 'microsoft-webdav') !== false ||
strstr($user_agent, 'neon') !== false ||
strstr($user_agent, 'bitkinex') !== false)
{
// Windows 7 et.al. special treatment
$webdav_server->cnrnd = true;
}
$webdav_server->ServeRequest(); $webdav_server->ServeRequest();
//error_log(sprintf('WebDAV %s request: status "%s", took %5.3f s'.($headertime?' (header include took %5.3f s)':''),$_SERVER['REQUEST_METHOD'].' '.$_SERVER['PATH_INFO'],$webdav_server->_http_status,microtime(true)-$starttime,$headertime-$starttime)); //error_log(sprintf('WebDAV %s request: status "%s", took %5.3f s'.($headertime?' (header include took %5.3f s)':''),$_SERVER['REQUEST_METHOD'].' '.$_SERVER['PATH_INFO'],$webdav_server->_http_status,microtime(true)-$starttime,$headertime-$starttime));