From 01c6f9032792898c22b718f100ec88e4d8155ecf Mon Sep 17 00:00:00 2001 From: Marius Burkard <m.burkard@pixcept.de> Date: Wed, 02 Mar 2016 05:19:14 -0500 Subject: [PATCH] - added line to guidelines --- server/lib/classes/monitor_tools.inc.php | 25 +++++++++++++++---------- 1 files changed, 15 insertions(+), 10 deletions(-) diff --git a/server/lib/classes/monitor_tools.inc.php b/server/lib/classes/monitor_tools.inc.php index 3b451cd..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; @@ -150,6 +153,11 @@ } elseif (strstr(trim(file_get_contents('/etc/debian_version')), '7.0') || substr(trim(file_get_contents('/etc/debian_version')),0,2) == '7.' || trim(file_get_contents('/etc/debian_version')) == 'wheezy/sid') { $distname = 'Debian'; $distver = 'Wheezy/Sid'; + $distid = 'debian60'; + $distbaseid = 'debian'; + } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '8') || substr(trim(file_get_contents('/etc/debian_version')),0,1) == '8') { + $distname = 'Debian'; + $distver = 'Jessie'; $distid = 'debian60'; $distbaseid = 'debian'; } else { @@ -661,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) @@ -671,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); } @@ -703,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