From cba976066e756cd142933b8bb55878d435e0db0b Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 26 Oct 2010 08:24:55 -0400
Subject: [PATCH] Fixed: FS#1381 - correct webdav setup

---
 server/plugins-available/apache2_plugin.inc.php |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index 80d6849..4c15aa8 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -1246,7 +1246,8 @@
 				/*
 				 * add all the webdav-dirs to the webdav-section
 				*/
-				$files = scandir($webdavRoot);
+				$files = @scandir($webdavRoot);
+				if(is_array($files)) {
 				foreach($files as $file) {
 					if (substr($file, strlen($file) - strlen('.htdigest')) == '.htdigest') {
 						/*
@@ -1254,8 +1255,10 @@
 						*/
 						$fn = substr($file, 0, strlen($file) - strlen('.htdigest'));
 						$output .= "\n";
-						$output .= "      Alias /" . $fn . " " . $webdavRoot . "/" . $fn . "\n";
-						$output .= "      <Location /" . $fn . ">\n";
+						//$output .= "      Alias /" . $fn . " " . $webdavRoot . "/" . $fn . "\n";
+						//$output .= "      <Location /" . $fn . ">\n";
+						$output .= "      Alias /webdav/" . $fn . ' ' . substr($webdavRoot,0,-3) . '/' . $fn . "\n";
+						$output .= "      <Location /webdav/" . $fn . ">\n";
 						$output .= "        DAV On\n";
 						$output .= "        AuthType Digest\n";
 						$output .= "        AuthName \"" . $fn . "\"\n";
@@ -1267,6 +1270,7 @@
 						$output .= "      </Location> \n";
 					}
 				}
+				}
 			}
 			/*
 			 *  is the "replace-comment-end" found...

--
Gitblit v1.9.1