From e0db878eb71dd40d6c000f1debedad3f16f15ba6 Mon Sep 17 00:00:00 2001
From: chjacobsen <chjacobsen@ispconfig3>
Date: Fri, 01 Apr 2011 15:59:23 -0400
Subject: [PATCH] Adding a new client remotelly, it was not been associated to the proper reseller.

---
 server/mods-available/monitor_core_module.inc.php |   96 ++++++++++++++++++++++++------------------------
 1 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/server/mods-available/monitor_core_module.inc.php b/server/mods-available/monitor_core_module.inc.php
index 9244b05..4df4256 100644
--- a/server/mods-available/monitor_core_module.inc.php
+++ b/server/mods-available/monitor_core_module.inc.php
@@ -129,14 +129,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorServer() {
@@ -154,14 +154,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorOsVer() {
@@ -179,14 +179,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorIspcVer() {
@@ -204,14 +204,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorDiskUsage() {
@@ -229,14 +229,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorMemUsage() {
@@ -253,14 +253,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorCpu() {
@@ -277,14 +277,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorServices() {
@@ -302,14 +302,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorOpenVzHost() {
@@ -327,14 +327,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorOpenVzUserBeancounter() {
@@ -352,14 +352,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorSystemUpdate() {
@@ -387,14 +387,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorMailQueue() {
@@ -412,14 +412,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorRaid() {
@@ -437,14 +437,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorRkHunter() {
@@ -472,14 +472,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorFail2ban() {
@@ -497,14 +497,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorSysLog() {
@@ -522,14 +522,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorMailLog() {
@@ -547,14 +547,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorMailWarnLog() {
@@ -572,14 +572,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorMailErrLog() {
@@ -597,14 +597,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorMessagesLog() {
@@ -622,14 +622,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorISPCCronLog() {
@@ -647,14 +647,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorFreshClamLog() {
@@ -672,14 +672,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorClamAvLog() {
@@ -697,14 +697,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	private function _monitorIspConfigLog() {
@@ -722,14 +722,14 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
 		$app->dbmaster->query($sql);
 
 		/* The new data is written, now we can delete the old one */
-		$this->_delOldRecords($type, $res['server_id']);
+		$this->_delOldRecords($res['type'], $res['server_id']);
 	}
 
 	/**

--
Gitblit v1.9.1