From 8e725d2c1057608431d3d1639c948206d5e24869 Mon Sep 17 00:00:00 2001
From: jwarnier <jwarnier@ispconfig3>
Date: Sun, 05 Sep 2010 08:54:24 -0400
Subject: [PATCH] fix some strings quoting and remove some execs

---
 server/plugins-available/software_update_plugin.inc.php |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/server/plugins-available/software_update_plugin.inc.php b/server/plugins-available/software_update_plugin.inc.php
index be73c8b..55feaee 100644
--- a/server/plugins-available/software_update_plugin.inc.php
+++ b/server/plugins-available/software_update_plugin.inc.php
@@ -73,7 +73,7 @@
 		global $app, $conf;
 		
 		//* Get the info of the package:
-        $software_update_id = intval($data["new"]["software_update_id"]);
+		$software_update_id = intval($data["new"]["software_update_id"]);
 		$software_update = $app->db->queryOneRecord("SELECT * FROM software_update WHERE software_update_id = '$software_update_id'");
 		$software_package = $app->db->queryOneRecord("SELECT * FROM software_package WHERE package_name = '".$app->db->quote($software_update['package_name'])."'");
 		
@@ -97,7 +97,7 @@
 		$temp_dir = '/tmp/'.md5 (uniqid (rand()));
 		$app->log("The temp dir is $temp_dir",LOGLEVEL_DEBUG);
 		mkdir($temp_dir);
-		if($installuser != '') exec('chown '.$installuser.' '.$temp_dir);
+		if($installuser != '') chown($temp_dir, $installuser);
 		
 		if(!is_dir($temp_dir)) {
 			$app->log("Unable to create temp directory.",LOGLEVEL_WARN);
@@ -135,7 +135,7 @@
 			$app->log("No package file found. Download failed? Installation aborted.",LOGLEVEL_WARN);
 			exec("rm -rf $temp_dir");
 			$app->log("Deleting the temp directory $temp_dir",LOGLEVEL_DEBUG);
-            $this->set_install_status($data["new"]["software_update_inst_id"], "failed");
+			$this->set_install_status($data["new"]["software_update_inst_id"], "failed");
 			return false;
 		}
 
@@ -148,10 +148,10 @@
 				$app->log("The md5 sum of the downloaded file is incorrect. Update aborted.",LOGLEVEL_WARN);
 				exec("rm -rf $temp_dir");
 				$app->log("Deleting the temp directory $temp_dir",LOGLEVEL_DEBUG);
-                $this->set_install_status($data["new"]["software_update_inst_id"], "failed");
+				$this->set_install_status($data["new"]["software_update_inst_id"], "failed");
 				return false;
 			} else {
-				$app->log("md5sum of the downloaded file is verified.",LOGLEVEL_DEBUG);
+				$app->log("MD5 checksum of the downloaded file verified.",LOGLEVEL_DEBUG);
 			}
 			
 			
@@ -274,4 +274,4 @@
 
 } // end class
 
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1