From ec09b18c9c44f85ceb6d9e7588a03a221cd1193f Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Fri, 12 Dec 2008 05:47:05 -0500
Subject: [PATCH] Disallow server changes for existing records in mail_domain_edit.php

---
 server/mods-available/monitor_core_module.inc.php |   79 ++++++++++++++++++++++-----------------
 1 files changed, 44 insertions(+), 35 deletions(-)

diff --git a/server/mods-available/monitor_core_module.inc.php b/server/mods-available/monitor_core_module.inc.php
index 3222094..1ff82b1 100644
--- a/server/mods-available/monitor_core_module.inc.php
+++ b/server/mods-available/monitor_core_module.inc.php
@@ -36,7 +36,16 @@
     /* No actions at this time. maybe later... */
     var $actions_available = array();
 
-    /*
+    //* This function is called during ispconfig installation to determine
+	//  if a symlink shall be created for this plugin.
+	function onInstall() {
+		global $conf;
+		
+		return true;
+		
+	}
+	
+	/*
         This function is called when the module is loaded
     */
     function onLoad() {
@@ -156,9 +165,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -220,9 +229,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -271,9 +280,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -316,9 +325,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -440,9 +449,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -520,9 +529,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -566,9 +575,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -649,9 +658,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -682,7 +691,7 @@
             /*
              * Fetch the output
              */
-            $data['output'] = shell_exec('rkhunter --update --check --nocolors --skip-keypress');
+            $data['output'] = shell_exec('rkhunter --update --checkall --nocolors --skip-keypress');
 
             /*
              * At this moment, there is no state (maybe later)
@@ -709,9 +718,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -746,9 +755,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -783,9 +792,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -820,9 +829,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -858,9 +867,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -930,9 +939,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -964,9 +973,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -998,9 +1007,9 @@
         $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
             "VALUES (".
         $server_id . ", " .
-            "'" . $app->db->quote($type) . "', " .
+            "'" . $app->dbmaster->quote($type) . "', " .
         time() . ", " .
-            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $app->dbmaster->quote(serialize($data)) . "', " .
             "'" . $state . "'" .
             ")";
         $app->dbmaster->query($sql);
@@ -1111,7 +1120,7 @@
         $old = $now - ($min * 60) - ($hour * 60 * 60) - ($days * 24 * 60 * 60);
         $sql = "DELETE FROM monitor_data " .
             "WHERE " .
-            "type =" . "'" . $app->db->quote($type) . "' " .
+            "type =" . "'" . $app->dbmaster->quote($type) . "' " .
             "AND " .
             "created < " . $old;
         $app->dbmaster->query($sql);

--
Gitblit v1.9.1