From 92f835dba0ff2400a56fb04a56d01aaf3e202a4c Mon Sep 17 00:00:00 2001 From: megan_w Date: Thu, 31 Jan 2008 14:26:35 +0000 Subject: [PATCH] KTS-2879 "WebDAV from Mac Finder does not work to local dms. Suspect it could be https." Fixed. The page displaying the url for connecting to webdav now displays https not http and indicates if safemode is enabled. --- ktwebdav/lib/KTWebDAVServer.inc.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ktwebdav/lib/KTWebDAVServer.inc.php b/ktwebdav/lib/KTWebDAVServer.inc.php index 8ccc134..2a21f56 100644 --- a/ktwebdav/lib/KTWebDAVServer.inc.php +++ b/ktwebdav/lib/KTWebDAVServer.inc.php @@ -1074,13 +1074,25 @@ class KTWebDAVServer extends HTTP_WebDAV_Server } $srv_proto = split('/', $_SERVER['SERVER_PROTOCOL']); + $proto = strtolower($srv_proto[0]); + + // check if ssl enabled + if($proto == 'http' && $default->sslEnabled){ + $proto = 'https'; + } + + $dataSafe = ''; + if($this->safeMode != 'off'){ + $dataSafe = "
NOTE: Safe mode is currently enabled, only viewing and downloading of documents will be allowed.


"; + } $data = "KTWebDAV - The KnowledgeTree WebDAV Server"; $data .= ""; $data .= "

"; $data .= "

Welcome to KnowledgeTree WebDAV Server



"; $data .= "
To access KTWebDAV copy the following URL and paste it into your WebDAV enabled client...


"; - $data .= "
" . strtolower($srv_proto[0]) . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "
"; + $data .= $dataSafe; + $data .= "
" . $proto . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "
"; $data .= ""; $options['mimetype'] = 'text/html'; -- libgit2 0.21.4