From ab7597c7ec2d62aadf82c4c647d3dc63dae8de90 Mon Sep 17 00:00:00 2001
From: mcramer <m.cramer@pixcept.de>
Date: Thu, 16 Aug 2012 14:53:05 -0400
Subject: [PATCH] Implemented  FS#2379 - Add perl option to web sites (apache2 mod_perl2) Fixed (partly) FS#2310 - Template switch not working in mailuser module, for dashlets and the login page

---
 server/mods-available/monitor_core_module.inc.php |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/server/mods-available/monitor_core_module.inc.php b/server/mods-available/monitor_core_module.inc.php
index ec85bed..099b89a 100644
--- a/server/mods-available/monitor_core_module.inc.php
+++ b/server/mods-available/monitor_core_module.inc.php
@@ -117,9 +117,20 @@
 	}
 
     private function _monitorEmailQuota() {
-        global $app;
+        global $app, $conf;
 
         /*
+		 *  This monitoring is expensive, so do it only every 15 minutes
+		 */
+		$min = @date('i');
+		if ($min % 15 != 0) return;
+		
+		$app->uses('getconf');
+		$mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail');
+		if($mail_config['mailbox_quota_stats'] == 'n') return;
+		
+		
+		/*
          * First we get the Monitoring-data from the tools
          */
         $res = $this->_tools->monitorEmailQuota();
@@ -406,6 +417,9 @@
 		 * First we get the Monitoring-data from the tools
 		 */
 		$res = $this->_tools->monitorSystemUpdate();
+		
+		//* Ensure that output is encoded so that it does not break the serialize
+		$res['data']['output'] = htmlentities($res['data']['output']);
 
 		/*
 		 * Insert the data into the database
@@ -692,6 +706,9 @@
 		 * First we get the Monitoring-data from the tools
 		 */
 		$res = $this->_tools->monitorISPCCronLog();
+		
+		//* Ensure that output is encoded so that it does not break the serialize
+		$res['data'] = htmlentities($res['data']);
 
 		/*
 		 * Insert the data into the database
@@ -794,8 +811,10 @@
 	private function _delOldRecords($type, $serverId) {
 		global $app;
 
-		$now = time();
-		$old = $now - (4 * 60); // 4 minutes
+		// $now = time();
+		// $old = $now - (4 * 60); // 4 minutes
+		$old = 'UNIX_TIMESTAMP() - 240';
+		
 		/*
 		 * ATTENTION if i do NOT pay attention of the server id, i delete all data (of the type)
 		 * of ALL servers. This means, if i have a multiserver-environment and a server has a 

--
Gitblit v1.9.1