From 4369754abd4bc1d451a60dba3c496135451cf35a Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 21 Jul 2009 19:44:06 +0000
Subject: [PATCH] Fixed: FS#782 - issue with moving of web to other client

---
 interface/web/sites/web_domain_edit.php         | 6 +++---
 server/plugins-available/apache2_plugin.inc.php | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/interface/web/sites/web_domain_edit.php b/interface/web/sites/web_domain_edit.php
index 7ad4dcc64..7878e82bd 100644
--- a/interface/web/sites/web_domain_edit.php
+++ b/interface/web/sites/web_domain_edit.php
@@ -346,10 +346,10 @@ class page_action extends tform_actions {
 			// Set the values for document_root, system_user and system_group
 			$system_user = 'web'.$this->id;
 			$system_group = 'client'.$client_id;
-			//$document_root = str_replace("[client_id]",$client_id,$document_root);
+			$document_root = str_replace("[client_id]",$client_id,$document_root);
 		
-			// $sql = "UPDATE web_domain SET system_user = '$system_user', system_group = '$system_group', document_root = '$document_root' WHERE domain_id = ".$this->id;
-			$sql = "UPDATE web_domain SET system_user = '$system_user', system_group = '$system_group' WHERE domain_id = ".$this->id;
+			$sql = "UPDATE web_domain SET system_user = '$system_user', system_group = '$system_group', document_root = '$document_root' WHERE domain_id = ".$this->id;
+			//$sql = "UPDATE web_domain SET system_user = '$system_user', system_group = '$system_group' WHERE domain_id = ".$this->id;
 			$app->db->query($sql);
 		}
 		
diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index 5f98d1c09..1a962ec37 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -261,7 +261,7 @@ class apache2_plugin {
 					// Remove trailing slash
 					if(substr($tmp_symlink, -1, 1) == '/') $tmp_symlink = substr($tmp_symlink, 0, -1);
 					// create the symlinks, if not exist
-					if(!is_link($tmp_symlink)) {
+					if(is_link($tmp_symlink)) {
 						exec("rm -f ".escapeshellcmd($tmp_symlink));
 						$app->log("Removed Symlink: rm -f ".$tmp_symlink,LOGLEVEL_DEBUG);
 					}
-- 
GitLab