Commit 58031816aeedd6ce55a6854cbf2f0e225bf8ccf2
1 parent
bcbd509f
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. Committed by: Megan Watson Reviewed by: Conrad Vermeulen git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7991 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
13 additions
and
1 deletions
ktwebdav/lib/KTWebDAVServer.inc.php
| @@ -1074,13 +1074,25 @@ class KTWebDAVServer extends HTTP_WebDAV_Server | @@ -1074,13 +1074,25 @@ class KTWebDAVServer extends HTTP_WebDAV_Server | ||
| 1074 | } | 1074 | } |
| 1075 | 1075 | ||
| 1076 | $srv_proto = split('/', $_SERVER['SERVER_PROTOCOL']); | 1076 | $srv_proto = split('/', $_SERVER['SERVER_PROTOCOL']); |
| 1077 | + $proto = strtolower($srv_proto[0]); | ||
| 1078 | + | ||
| 1079 | + // check if ssl enabled | ||
| 1080 | + if($proto == 'http' && $default->sslEnabled){ | ||
| 1081 | + $proto = 'https'; | ||
| 1082 | + } | ||
| 1083 | + | ||
| 1084 | + $dataSafe = ''; | ||
| 1085 | + if($this->safeMode != 'off'){ | ||
| 1086 | + $dataSafe = "<div style=\"color: orange;\" align=\"center\">NOTE: Safe mode is currently enabled, only viewing and downloading of documents will be allowed.</div><br><br>"; | ||
| 1087 | + } | ||
| 1077 | 1088 | ||
| 1078 | $data = "<html><head><title>KTWebDAV - The KnowledgeTree WebDAV Server</title></head>"; | 1089 | $data = "<html><head><title>KTWebDAV - The KnowledgeTree WebDAV Server</title></head>"; |
| 1079 | $data .= "<body>"; | 1090 | $data .= "<body>"; |
| 1080 | $data .= "<div align=\"center\"><IMG src=\"../resources/graphics/ktlogo-topbar_base.png\" width=\"308\" height=\"61\" border=\"0\"></div><br>"; | 1091 | $data .= "<div align=\"center\"><IMG src=\"../resources/graphics/ktlogo-topbar_base.png\" width=\"308\" height=\"61\" border=\"0\"></div><br>"; |
| 1081 | $data .= "<div align=\"center\"><h2><strong>Welcome to KnowledgeTree WebDAV Server</strong></h2></div><br><br>"; | 1092 | $data .= "<div align=\"center\"><h2><strong>Welcome to KnowledgeTree WebDAV Server</strong></h2></div><br><br>"; |
| 1082 | $data .= "<div align=\"center\">To access KTWebDAV copy the following URL and paste it into your WebDAV enabled client...</div><br><br>"; | 1093 | $data .= "<div align=\"center\">To access KTWebDAV copy the following URL and paste it into your WebDAV enabled client...</div><br><br>"; |
| 1083 | - $data .= "<div align=\"center\"><strong>" . strtolower($srv_proto[0]) . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "</strong></div>"; | 1094 | + $data .= $dataSafe; |
| 1095 | + $data .= "<div align=\"center\"><strong>" . $proto . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "</strong></div>"; | ||
| 1084 | $data .= "</body>"; | 1096 | $data .= "</body>"; |
| 1085 | 1097 | ||
| 1086 | $options['mimetype'] = 'text/html'; | 1098 | $options['mimetype'] = 'text/html'; |