Example #1
0
 Creating the array with the refresh intervals
 Attention: the core-moule ist triggered every 5 minutes,
            so reload every 2 minutes is impossible!
*/
$refresh_values = array('0' => '- ' . $app->lng("No Refresh") . ' -', '5' => '5 ' . $app->lng("minutes"), '10' => '10 ' . $app->lng("minutes"), '15' => '15 ' . $app->lng("minutes"), '30' => '30 ' . $app->lng("minutes"), '60' => '60 ' . $app->lng("minutes"));
$tmp = '';
foreach ($refresh_values as $key => $val) {
    if ($key == $refresh) {
        $tmp .= "<option value='{$key}' SELECTED>{$val}</option>";
    } else {
        $tmp .= "<option value='{$key}'>{$val}</option>";
    }
}
$app->tpl->setVar("refresh", $tmp);
/* fetch the Data from the DB */
$record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = '" . $app->db->quote($logId) . "' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc");
if (isset($record['data'])) {
    $data = unserialize($record['data']);
    $logData = nl2br($data);
    $app->tpl->setVar("log_data", $logData);
} else {
    $app->tpl->setVar("log_data", $app->lng("no_logdata_txt"));
}
$app->tpl->setVar("list_head_txt", $title);
$app->tpl->setVar("log_id", $logId);
$app->tpl->setVar("list_desc_txt", $description);
$app->tpl->setVar("time", getDataTime($logId));
$app->tpl->setVar("monTransDate", $monTransDate);
$app->tpl->setVar("monTransRefreshsq", $monTransRefreshsq);
$app->tpl_defaults();
$app->tpl->pparse();
Example #2
0
        $output .= showRKHunter();
        $time = getDataTime('rkhunter');
        $title = $app->lng("monitor_title_rkhunterlog_txt") . ' (' . $monTransSrv . ' : ' . $_SESSION['monitor']['server_name'] . ')';
        $description = '';
        break;
    case 'fail2ban':
        $template = 'templates/show_data.htm';
        $output .= showFail2ban();
        $time = getDataTime('log_fail2ban');
        $title = $app->lng("monitor_title_fail2ban_txt") . ' (' . $monTransSrv . ' : ' . $_SESSION['monitor']['server_name'] . ')';
        $description = '';
        break;
    case 'iptables':
        $template = 'templates/show_data.htm';
        $output .= showIPTables();
        $time = getDataTime('iptables_rules');
        $title = $app->lng("monitor_title_iptables_txt") . ' (' . $monTransSrv . ' : ' . $_SESSION['monitor']['server_name'] . ')';
        $description = '';
        break;
    default:
        $template = '';
        break;
}
// Loading the template
$app->uses('tpl');
$app->tpl->newTemplate("form.tpl.htm");
$app->tpl->setInclude('content_tpl', $template);
$app->tpl->setVar("output", $output);
$app->tpl->setVar("list_head_txt", $title);
$app->tpl->setVar("list_desc_txt", $description);
$app->tpl->setVar("time", $time);