From 58053eae9b6a9c8865ef9375e54038fdafe91e84 Mon Sep 17 00:00:00 2001
From: mcramer <m.cramer@pixcept.de>
Date: Wed, 22 Aug 2012 09:56:07 +0000
Subject: [PATCH] Bugfix: Web folder protection did not work on web deletion
 Bugfix: $app->system->unlink function had wrong parameter name, no files were
 deleted ever

---
 server/lib/classes/system.inc.php               | 2 +-
 server/plugins-available/apache2_plugin.inc.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/lib/classes/system.inc.php b/server/lib/classes/system.inc.php
index b1f9103309..5b666752aa 100644
--- a/server/lib/classes/system.inc.php
+++ b/server/lib/classes/system.inc.php
@@ -699,7 +699,7 @@ class system{
 		}
 	}
 	
-	function unlink($file) {
+	function unlink($filename) {
 		if(file_exists($filename)) {
 			return unlink($filename);
 		}
diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index a111dd658f..f56d375b06 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -1452,7 +1452,7 @@ class apache2_plugin {
 		$app->uses('system');
 		$web_config = $app->getconf->get_server_config($conf['server_id'], 'web');
 		
-		$app->system->web_folder_protection($data['new']['document_root'],false);
+		$app->system->web_folder_protection($data['old']['document_root'],false);
 
 		//* Check if this is a chrooted setup
 		if($web_config['website_basedir'] != '' && @is_file($web_config['website_basedir'].'/etc/passwd')) {
-- 
GitLab