From 1a541271a5e331a2bdab764662c69532bffaff81 Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Wed, 30 Jan 2013 09:20:20 -0500
Subject: [PATCH] - Fixed FS#2646 - Moving website to another client not working.

---
 server/plugins-available/nginx_plugin.inc.php |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php
index 1c37a5a..fb1c3f6 100644
--- a/server/plugins-available/nginx_plugin.inc.php
+++ b/server/plugins-available/nginx_plugin.inc.php
@@ -446,12 +446,14 @@
 
 			//* Check if there is already some data in the new docroot and rename it as we need a clean path to move the existing site to the new path
 			if(@is_dir($data['new']['document_root'])) {
-				$app->system->rename($data['new']['document_root'],$data['new']['document_root'].'_bak_'.date('Y_m_d'));
-				$app->log('Renaming existing directory in new docroot location. mv '.$data['new']['document_root'].' '.$data['new']['document_root'].'_bak_'.date('Y_m_d'),LOGLEVEL_DEBUG);
+				$app->system->web_folder_protection($data['new']['document_root'],false);
+				$app->system->rename($data['new']['document_root'],$data['new']['document_root'].'_bak_'.date('Y_m_d_H_i_s'));
+				$app->log('Renaming existing directory in new docroot location. mv '.$data['new']['document_root'].' '.$data['new']['document_root'].'_bak_'.date('Y_m_d_H_i_s'),LOGLEVEL_DEBUG);
 			}
 			
 			//* Create new base directory, if it does not exist yet
 			if(!is_dir($new_dir)) $app->system->mkdirpath($new_dir);
+			$app->system->web_folder_protection($data['old']['document_root'],false);
 			exec('mv '.escapeshellarg($data['old']['document_root']).' '.escapeshellarg($new_dir));
 			//$app->system->rename($data['old']['document_root'],$new_dir);
 			$app->log('Moving site to new document root: mv '.$data['old']['document_root'].' '.$new_dir,LOGLEVEL_DEBUG);

--
Gitblit v1.9.1