From d6cd11df635941a4e7d35e6e45b4e59cb8bd4469 Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Fri, 04 Sep 2015 07:57:19 -0400
Subject: [PATCH] default for mount backup_dir set to no
---
server/lib/classes/cron.d/100-monitor_mail_queue.inc.php | 92 ++++++++++++++++++++++------------------------
1 files changed, 44 insertions(+), 48 deletions(-)
diff --git a/server/lib/classes/cron.d/100-monitor_mail_queue.inc.php b/server/lib/classes/cron.d/100-monitor_mail_queue.inc.php
index bda9031..b259904 100644
--- a/server/lib/classes/cron.d/100-monitor_mail_queue.inc.php
+++ b/server/lib/classes/cron.d/100-monitor_mail_queue.inc.php
@@ -29,15 +29,17 @@
*/
class cronjob_monitor_mail_queue extends cronjob {
-
- // job schedule
- protected $_schedule = '*/5 * * * *';
- protected $_run_at_new = true;
-
- private $_tools = null;
-
+
+ // job schedule
+ protected $_schedule = '*/5 * * * *';
+ protected $_run_at_new = true;
+
+ private $_tools = null;
+
private function _getIntArray($line) {
/** The array of float found */
+
+
$res = array();
/* First build a array from the line */
$data = explode(' ', $line);
@@ -49,29 +51,29 @@
}
return $res;
}
-
- /* this function is optional if it contains no custom code */
- public function onPrepare() {
- global $app;
-
- parent::onPrepare();
- }
-
- /* this function is optional if it contains no custom code */
- public function onBeforeRun() {
- global $app;
-
- return parent::onBeforeRun();
- }
-
- public function onRunJob() {
- global $app, $conf;
-
- /* used for all monitor cronjobs */
- $app->load('monitor_tools');
- $this->_tools = new monitor_tools();
- /* end global section for monitor cronjobs */
-
+
+ /* this function is optional if it contains no custom code */
+ public function onPrepare() {
+ global $app;
+
+ parent::onPrepare();
+ }
+
+ /* this function is optional if it contains no custom code */
+ public function onBeforeRun() {
+ global $app;
+
+ return parent::onBeforeRun();
+ }
+
+ public function onRunJob() {
+ global $app, $conf;
+
+ /* used for all monitor cronjobs */
+ $app->load('monitor_tools');
+ $this->_tools = new monitor_tools();
+ /* end global section for monitor cronjobs */
+
/* the id of the server as int */
$server_id = intval($conf['server_id']);
@@ -111,27 +113,21 @@
* Insert the data into the database
*/
$sql = 'REPLACE INTO monitor_data (server_id, type, created, data, state) ' .
- 'VALUES (' .
- $res['server_id'] . ', ' .
- "'" . $app->dbmaster->quote($res['type']) . "', " .
- 'UNIX_TIMESTAMP(), ' .
- "'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
- "'" . $res['state'] . "'" .
- ')';
- $app->dbmaster->query($sql);
+ 'VALUES (?, ?, UNIX_TIMESTAMP(), ?, ?)';
+ $app->dbmaster->query($sql, $res['server_id'], $res['type'], serialize($res['data']), $res['state']);
/* The new data is written, now we can delete the old one */
$this->_tools->delOldRecords($res['type'], $res['server_id']);
-
- parent::onRunJob();
- }
-
- /* this function is optional if it contains no custom code */
- public function onAfterRun() {
- global $app;
-
- parent::onAfterRun();
- }
+
+ parent::onRunJob();
+ }
+
+ /* this function is optional if it contains no custom code */
+ public function onAfterRun() {
+ global $app;
+
+ parent::onAfterRun();
+ }
}
--
Gitblit v1.9.1