From 8748b35d2cfcea7d37baeb8a8d893e974bc3ba6f Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Sat, 15 Feb 2014 13:05:45 -0500
Subject: [PATCH] Fixed: FS#2669 - ISPConig template generator creates date columns with wrong format

---
 server/lib/classes/monitor_tools.inc.php |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/server/lib/classes/monitor_tools.inc.php b/server/lib/classes/monitor_tools.inc.php
index 8f00088..45a5678 100644
--- a/server/lib/classes/monitor_tools.inc.php
+++ b/server/lib/classes/monitor_tools.inc.php
@@ -250,7 +250,9 @@
 				$filename = $mb['maildir'].'/.quotausage';
 				if(file_exists($filename) && !is_link($filename)) {
 					$quotafile = file($filename);
-					$data[$email]['used'] = trim($quotafile['1']);
+					preg_match('/storage.*?([0-9]+)/s', implode('',$quotafile), $storage_value);
+					$data[$email]['used'] = $storage_value[1];
+					$app->log("Mail storage $email: " . $storage_value[1], LOGLEVEL_DEBUG);
 					unset($quotafile);
 				} else {
 					exec('du -s '.escapeshellcmd($mb['maildir']), $out);
@@ -1571,15 +1573,20 @@
 		 * Now we have the last log in the array.
 		 * Check if the outdated-string is found...
 		 */
+		$clamav_outdated_warning = false;
+		$clamav_bytecode_updated = false;
 		foreach ($lastLog as $line) {
-			if (strpos(strtolower($line), 'outdated') !== false) {
-				/*
-				 * Outdatet is only info, because if we set this to warning, the server is
-				 * as long in state warning, as there is a new version of ClamAv which takes
-				 * sometimes weeks!
-				 */
-				$state = $this->_setState($state, 'info');
+			if (stristr($line,'outdated')) {
+				$clamav_outdated_warning = true;
 			}
+			if(stristr($line,'main.cld is up to date')) {
+				$clamav_bytecode_updated = true;
+			}
+		}
+		
+		//* Warn when clamav is outdated and main.cld update failed.
+		if($clamav_outdated_warning == true && $clamav_bytecode_updated == false) {
+			$state = $this->_setState($state, 'info');
 		}
 
 		/*

--
Gitblit v1.9.1