From cdda6b98d785f103d9be6643a99a882c0d65b64c Mon Sep 17 00:00:00 2001 From: fantu <fantu@ispconfig3> Date: Sun, 21 Dec 2008 04:51:07 -0500 Subject: [PATCH] fix parse error --- interface/web/monitor/tools.inc.php | 74 ++++++++++++++++++++++++++++++------- 1 files changed, 60 insertions(+), 14 deletions(-) diff --git a/interface/web/monitor/tools.inc.php b/interface/web/monitor/tools.inc.php index 1def6aa..0348461 100644 --- a/interface/web/monitor/tools.inc.php +++ b/interface/web/monitor/tools.inc.php @@ -39,8 +39,8 @@ Format the data */ $html = - '<div class="systemmonitor-state systemmonitor-state-' . $record['state'] . '"> - <div class="systemmonitor-state-' . $record['state'] . '-icon"> + '<div class="systemmonitor-state state-'.$record['state'].'"> + <div class="systemmonitor-content icons32 ico-'.$record['state'].'"> <table> <tr> <td>' . $app->lng("Server online since").':</td> @@ -85,8 +85,8 @@ Format the data */ $html = - '<div class="systemmonitor-state systemmonitor-state-' . $record['state'] . '"> - <div class="systemmonitor-state-' . $record['state'] . '-icon"> + '<div class="systemmonitor-state state-'.$record['state'].'"> + <div class="systemmonitor-content icons32 ico-'.$record['state'].'"> <table> <tr> <td>Filesystem</td> @@ -128,8 +128,8 @@ Format the data */ $html = - '<div class="systemmonitor-state systemmonitor-state-' . $record['state'] . '"> - <div class="systemmonitor-state-' . $record['state'] . '-icon"> + '<div class="systemmonitor-state state-'.$record['state'].'"> + <div class="systemmonitor-content icons32 ico-'.$record['state'].'"> <table>'; foreach($data as $key => $value){ @@ -164,8 +164,8 @@ Format the data */ $html = - '<div class="systemmonitor-state systemmonitor-state-' . $record['state'] . '"> - <div class="systemmonitor-state-' . $record['state'] . '-icon"> + '<div class="systemmonitor-state state-'.$record['state'].'"> + <div class="systemmonitor-content icons32 ico-'.$record['state'].'"> <table>'; foreach($data as $key => $value){ if ($key != '') { @@ -198,8 +198,8 @@ Format the data */ $html = - '<div class="systemmonitor-state systemmonitor-state-' . $record['state'] . '"> - <div class="systemmonitor-state-' . $record['state'] . '-icon"> + '<div class="systemmonitor-state state-'.$record['state'].'"> + <div class="systemmonitor-content icons32 ico-'.$record['state'].'"> <table>'; if($data['webserver'] != -1) { @@ -306,8 +306,8 @@ if(isset($record['data'])) { $html = - '<div class="systemmonitor-state systemmonitor-state-' . $record['state'] . '"> - <div class="systemmonitor-state-' . $record['state'] . '-icon">'; + '<div class="systemmonitor-state state-'.$record['state'].'"> + <div class="systemmonitor-content icons32 ico-'.$record['state'].'">'; /* * First, we have to detect, if there is any monitoring-data. * If not (because the destribution is not supported) show this. @@ -336,8 +336,8 @@ if(isset($record['data'])) { $html = - '<div class="systemmonitor-state systemmonitor-state-' . $record['state'] . '"> - <div class="systemmonitor-state-' . $record['state'] . '-icon">'; + '<div class="systemmonitor-state state-'.$record['state'].'"> + <div class="systemmonitor-content icons32 ico-'.$record['state'].'">'; /* * First, we have to detect, if there is any monitoring-data. @@ -359,6 +359,38 @@ return $html; } +function showRKHunter() +{ + global $app; + + /* fetch the Data from the DB */ + $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'rkhunter' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); + + if(isset($record['data'])) { + $html = + '<div class="systemmonitor-state state-'.$record['state'].'"> + <div class="systemmonitor-content icons32 ico-'.$record['state'].'">'; + + /* + * First, we have to detect, if there is any monitoring-data. + * If not (because the destribution is not supported) show this. + */ + $data = unserialize($record['data']); + if ($data['output'] == ''){ + $html .= '<p>' . "rkhunter ist not installed, so there is no log data" . '</p>'; + } + else { + $html .= nl2br($data['output']); + } + $html .= '</div></div>'; + + } else { + $html = '<p>' . "No RKHunter-Data available" . '</p>'; + } + + return $html; +} + function showMailq() { global $app; @@ -375,4 +407,18 @@ return $html; } + +function getDataTime($type) { + global $app; + + /* fetch the Data from the DB */ + $record = $app->db->queryOneRecord("SELECT created FROM monitor_data WHERE type = '" . $type . "' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); + + if(isset($record['created'])) { + $res = date('Y-m-d H:i', $record['created']); + } else { + $res = '????-??-?? ??:??'; + } + return $res; +} ?> -- Gitblit v1.9.1