Commit 403fbf503f2139f388c5ad4a76b1302833a00a15

Authored by megan_w
1 parent 97fc0e27

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.

KTS-2344
"WEBDAV Not working in 3.4.2 (was in 3.4.1-1)"
Fixed.

Committed By: Megan Watson
Reviewed By: Conrad Vermeulen

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7734 c91229c3-7414-0410-bfa2-8a42b809f60b
ktwebdav/ktwebdav.php
... ... @@ -35,6 +35,12 @@
35 35 * Contributor( s): ______________________________________
36 36 *
37 37 */
  38 +
  39 + $userAgentValue = $_SERVER['HTTP_USER_AGENT'];
  40 + if (stristr($userAgentValue, "Microsoft Data Access Internet Publishing Provider DAV")) {
  41 + // Fix for Novell Netdrive
  42 + chdir(realpath(dirname(__FILE__)));
  43 + }
38 44  
39 45 $webdav_pear_path = 'thirdparty/pear';
40 46 $kt_pear_path = '../thirdparty/pear';
... ...
ktwebdav/lib/KTWebDAVServer.inc.php
... ... @@ -40,8 +40,14 @@ require_once 'HTTP/WebDAV/Server.php'; // thirdparty PEAR
40 40 require_once 'Config.php'; // thirdparty PEAR
41 41 require_once 'Log.php'; // thirdparty PEAR
42 42  
43   -require_once '../config/dmsDefaults.php'; // This is our plug into KT.
44   -
  43 +$userAgentValue = $_SERVER['HTTP_USER_AGENT'];
  44 +if (stristr($userAgentValue, "Microsoft Data Access Internet Publishing Provider DAV")) {
  45 + // Fix for Novell Netdrive
  46 + chdir(realpath(dirname(__FILE__)));
  47 + require_once '../../config/dmsDefaults.php'; // This is our plug into KT.
  48 +}else{
  49 + require_once '../config/dmsDefaults.php'; // This is our plug into KT.
  50 +}
45 51  
46 52 DEFINE('STATUS_WEBDAV', 5); // Status code to handle 0 byte PUT FIXME: Do we still need this!
47 53  
... ... @@ -1771,7 +1777,7 @@ class KTWebDAVServer extends HTTP_WebDAV_Server
1771 1777  
1772 1778 // Fix for Mac Goliath
1773 1779 // Modified - 25/10/07 - remove ktwebdav from document path
1774   - if($this->dav_client == 'MG'){
  1780 + if($this->dav_client == 'MG' || $this->dav_client == 'MS'){
1775 1781 $this->ktwebdavLog("Remove ktwebdav from destination path: ".$options['dest'], 'info', true);
1776 1782 if(!(strpos($options['dest'], 'ktwebdav/ktwebdav.php/') === FALSE)){
1777 1783 $options['dest'] = substr($options['dest'], 22);
... ... @@ -1896,6 +1902,7 @@ class KTWebDAVServer extends HTTP_WebDAV_Server
1896 1902  
1897 1903 /* ** Ensure that the destination path exists ** */
1898 1904 if ($options['dest'] == '') $options["dest"] = substr($options["dest_url"], strlen($_SERVER["SCRIPT_NAME"]));
  1905 + $options['dest'] = $this->_slashify($options['dest']);
1899 1906 $this->ktwebdavLog("Entering _MOVEFolder. options are " . print_r($options, true), 'info', true);
1900 1907  
1901 1908 /* ** 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
1905 1912 return "400 Bad request - depth must be 'inifinity'.";
1906 1913 }
1907 1914  
1908   - // Fix for Mac Goliath
  1915 + // Fix for Mac Goliath - and for Novell Netdrive
1909 1916 // Modified - 30/10/07 - remove ktwebdav from folder path
1910   - if($this->dav_client == 'MG'){
  1917 + if($this->dav_client == 'MG' || $this->dav_client == 'MS'){
1911 1918 $this->ktwebdavLog("Remove ktwebdav from destination path: ".$options['dest'], 'info', true);
1912 1919 if(!(strpos($options['dest'], 'ktwebdav/ktwebdav.php/') === FALSE)){
1913 1920 $options['dest'] = substr($options['dest'], 22);
... ...