From 994f32aaa99be234ba52ce2fb1bb808eee1e1c7d Mon Sep 17 00:00:00 2001
From: A. Täffner <darkalex@firesplash.de>
Date: Mon, 11 Apr 2016 14:58:54 -0400
Subject: [PATCH] db permissions refined
---
server/lib/classes/monitor_tools.inc.php | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/server/lib/classes/monitor_tools.inc.php b/server/lib/classes/monitor_tools.inc.php
index 4e25d38..9493dc6 100644
--- a/server/lib/classes/monitor_tools.inc.php
+++ b/server/lib/classes/monitor_tools.inc.php
@@ -62,6 +62,9 @@
$mainver = array_filter($mainver);
$mainver = current($mainver).'.'.next($mainver);
switch ($mainver){
+ case "15.10":
+ $relname = "(Wily Werewolf)";
+ break;
case "15.04":
$relname = "(Vivid Vervet)";
break;
@@ -666,7 +669,7 @@
// $now = time();
// $old = $now - (4 * 60); // 4 minutes
- $old = 'UNIX_TIMESTAMP() - 240';
+ $old = 240; //seconds
/*
* ATTENTION if i do NOT pay attention of the server id, i delete all data (of the type)
@@ -676,13 +679,7 @@
* even though it is the NEWEST data of this server. To avoid this i HAVE to include
* the server-id!
*/
- $sql = 'DELETE FROM monitor_data ' .
- 'WHERE ' .
- ' type = ?' .
- 'AND ' .
- ' created < ? ' .
- 'AND ' .
- ' server_id = ?';
+ $sql = 'DELETE FROM `monitor_data` WHERE `type` = ? AND `created` < UNIX_TIMESTAMP() - ? AND `server_id` = ?';
$app->dbmaster->query($sql, $type, $old, $serverId);
}
@@ -708,13 +705,16 @@
$mailSubject = '';
$inHeader = true;
for($l = 0; $l < count($lines); $l++) {
- if($lines[$l] == '') {
+ if(trim($lines[$l]) == '') {
$inHeader = false;
continue;
}
if($inHeader == true) {
$parts = explode(':', $lines[$l], 2);
- if(strtolower($parts[0]) == 'subject') $mailSubject = trim($parts[1]);
+ if(strtolower($parts[0]) == 'subject') {
+ $mailSubject = trim($parts[1]);
+ continue;
+ }
unset($parts);
$mailHeaders .= trim($lines[$l]) . "\n";
} else {
--
Gitblit v1.9.1