From 843dbe21a2bfe4c6a22d58ba6174b101fe0c7790 Mon Sep 17 00:00:00 2001
From: vogelor <vogelor@ispconfig3>
Date: Sat, 26 Mar 2011 15:57:25 -0400
Subject: [PATCH] monitor now uses the timestamp of the masterdb and no longer the timestamp of the individual client-server

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

diff --git a/server/mods-available/monitor_core_module.inc.php b/server/mods-available/monitor_core_module.inc.php
index 584d6d6..4df4256 100644
--- a/server/mods-available/monitor_core_module.inc.php
+++ b/server/mods-available/monitor_core_module.inc.php
@@ -129,7 +129,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -154,7 +154,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -179,7 +179,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -204,7 +204,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -229,7 +229,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -253,7 +253,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -277,7 +277,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -302,7 +302,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -327,7 +327,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -352,7 +352,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -387,7 +387,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -412,7 +412,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -437,7 +437,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -472,7 +472,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -497,7 +497,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -522,7 +522,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -547,7 +547,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -572,7 +572,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -597,7 +597,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -622,7 +622,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -647,7 +647,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -672,7 +672,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -697,7 +697,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';
@@ -722,7 +722,7 @@
 				'VALUES (' .
 				$res['server_id'] . ', ' .
 				"'" . $app->dbmaster->quote($res['type']) . "', " .
-				time() . ', ' .
+				'UNIX_TIMESTAMP(), ' .
 				"'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
 				"'" . $res['state'] . "'" .
 				')';

--
Gitblit v1.9.1