From 8eb646a8abd3c39d37adb64d3908cd6ee6b1e5a8 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Fri, 24 Jun 2011 04:09:53 -0400
Subject: [PATCH] Fixed a firewall configuration problem.

---
 server/mods-available/remoteaction_core_module.inc.php |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/server/mods-available/remoteaction_core_module.inc.php b/server/mods-available/remoteaction_core_module.inc.php
index 7d1f800..b112e8c 100644
--- a/server/mods-available/remoteaction_core_module.inc.php
+++ b/server/mods-available/remoteaction_core_module.inc.php
@@ -27,7 +27,7 @@
 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-class remoteaction_core_module extends modules_base {
+class remoteaction_core_module {
 	var $module_name = 'remoteaction_core_module';
 	var $class_name = 'remoteaction_core_module';
 	/* No actions at this time. maybe later... */
@@ -134,13 +134,16 @@
 		/*
 		 * Do the update
 		 */
+		exec("aptitude update");
+		exec("aptitude safe-upgrade -y");
+
 		//TODO : change this when distribution information has been integrated into server record
 		if(file_exists('/etc/gentoo-release')) {
 			exec("glsa-check -f --nocolor affected");
 		}
 		else {
 			exec("aptitude update");
-			exec("aptitude upgrade -y");
+			exec("aptitude safe-upgrade -y");
 		}
 		
 		/*
@@ -150,6 +153,10 @@
 	}
 
 	private function _doIspCUpdate($action) {
+		
+		// Ensure that this code is not executed twice as this would cause a loop in case of a failure
+		$this->_actionDone($action['action_id'], 'ok');
+		
 		/*
 		 * Get the version-number of the newest version 
 		 */
@@ -175,17 +182,16 @@
 		exec("tar xvfz ISPConfig-" . $new_version . ".tar.gz");
 
 		/*
-		 * Start the automated update
+		 * Initialize the automated update
+		 * (the update is then done next start of server.sh
 		 */
 		chdir("/tmp/ispconfig3_install/install");
 		exec("touch autoupdate");
-		exec("php -q autoupdate.php");
-
+		
 		/*
 		 * do some clean-up
 		 */
 		exec("rm /tmp/ISPConfig-" . $new_version . ".tar.gz");
-		exec("rm /tmp/ispconfig3_install -R");
 
 		/*
 		 * go back to the "old path"
@@ -195,7 +201,7 @@
 		/*
 		 * All well done!
 		 */
-		$this->_actionDone($action['action_id'], 'ok');
+		//$this->_actionDone($action['action_id'], 'ok');
 	}
 }
 ?>
\ No newline at end of file

--
Gitblit v1.9.1