From 403fbf503f2139f388c5ad4a76b1302833a00a15 Mon Sep 17 00:00:00 2001 From: megan_w Date: Mon, 26 Nov 2007 07:49:27 +0000 Subject: [PATCH] BBS-301 "Novel NetDrive Webdav as 3rd Party Client" Fixed. Netdrive didn't resolve the relative paths correctly and kept the "/ktwebdav/ktwebdav.php" path as part of the folder / document path. --- ktwebdav/ktwebdav.php | 6 ++++++ ktwebdav/lib/KTWebDAVServer.inc.php | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ktwebdav/ktwebdav.php b/ktwebdav/ktwebdav.php index cbdbbec..74c0254 100644 --- a/ktwebdav/ktwebdav.php +++ b/ktwebdav/ktwebdav.php @@ -35,6 +35,12 @@ * Contributor( s): ______________________________________ * */ + + $userAgentValue = $_SERVER['HTTP_USER_AGENT']; + if (stristr($userAgentValue, "Microsoft Data Access Internet Publishing Provider DAV")) { + // Fix for Novell Netdrive + chdir(realpath(dirname(__FILE__))); + } $webdav_pear_path = 'thirdparty/pear'; $kt_pear_path = '../thirdparty/pear'; diff --git a/ktwebdav/lib/KTWebDAVServer.inc.php b/ktwebdav/lib/KTWebDAVServer.inc.php index 2d99a51..500ad7a 100644 --- a/ktwebdav/lib/KTWebDAVServer.inc.php +++ b/ktwebdav/lib/KTWebDAVServer.inc.php @@ -40,8 +40,14 @@ require_once 'HTTP/WebDAV/Server.php'; // thirdparty PEAR require_once 'Config.php'; // thirdparty PEAR require_once 'Log.php'; // thirdparty PEAR -require_once '../config/dmsDefaults.php'; // This is our plug into KT. - +$userAgentValue = $_SERVER['HTTP_USER_AGENT']; +if (stristr($userAgentValue, "Microsoft Data Access Internet Publishing Provider DAV")) { + // Fix for Novell Netdrive + chdir(realpath(dirname(__FILE__))); + require_once '../../config/dmsDefaults.php'; // This is our plug into KT. +}else{ + require_once '../config/dmsDefaults.php'; // This is our plug into KT. +} DEFINE('STATUS_WEBDAV', 5); // Status code to handle 0 byte PUT FIXME: Do we still need this! @@ -1771,7 +1777,7 @@ class KTWebDAVServer extends HTTP_WebDAV_Server // Fix for Mac Goliath // Modified - 25/10/07 - remove ktwebdav from document path - if($this->dav_client == 'MG'){ + if($this->dav_client == 'MG' || $this->dav_client == 'MS'){ $this->ktwebdavLog("Remove ktwebdav from destination path: ".$options['dest'], 'info', true); if(!(strpos($options['dest'], 'ktwebdav/ktwebdav.php/') === FALSE)){ $options['dest'] = substr($options['dest'], 22); @@ -1896,6 +1902,7 @@ class KTWebDAVServer extends HTTP_WebDAV_Server /* ** Ensure that the destination path exists ** */ if ($options['dest'] == '') $options["dest"] = substr($options["dest_url"], strlen($_SERVER["SCRIPT_NAME"])); + $options['dest'] = $this->_slashify($options['dest']); $this->ktwebdavLog("Entering _MOVEFolder. options are " . print_r($options, true), 'info', true); /* ** RFC 2518 Section 8.9.2. A folder move must have a depth of 'infinity'. @@ -1905,9 +1912,9 @@ class KTWebDAVServer extends HTTP_WebDAV_Server return "400 Bad request - depth must be 'inifinity'."; } - // Fix for Mac Goliath + // Fix for Mac Goliath - and for Novell Netdrive // Modified - 30/10/07 - remove ktwebdav from folder path - if($this->dav_client == 'MG'){ + if($this->dav_client == 'MG' || $this->dav_client == 'MS'){ $this->ktwebdavLog("Remove ktwebdav from destination path: ".$options['dest'], 'info', true); if(!(strpos($options['dest'], 'ktwebdav/ktwebdav.php/') === FALSE)){ $options['dest'] = substr($options['dest'], 22); -- libgit2 0.21.4