Esempio n. 1
0
function event_max_risk($date_from, $date_to)
{
    global $NUM_HOSTS;
    global $security_report;
    global $report_type;
    require_once 'sec_util.php';
    ?>
        <table align="center" width="100%" cellpadding="0" cellspacing="0" class="noborder">
            <tr><td class="headerpr">
        <?php 
    if ($report_type == "alarm") {
        ?>
        <?php 
        echo _("Top");
        ?>
 <?php 
        echo "{$NUM_HOSTS} " . _("Alarms by Risk");
        ?>
        <?php 
    } else {
        ?>
        <?php 
        echo _("Top");
        ?>
 <?php 
        echo "{$NUM_HOSTS} " . _("Events by Risk");
        ?>
        <?php 
    }
    ?>
        </td></tr></table>
        <table align="center" width="100%">
          <tr>
            <?php 
    if ($report_type == "alarm") {
        ?>
            <th> <?php 
        echo gettext("Alarm");
        ?>
 </th>
            <?php 
    } else {
        ?>
            <th> <?php 
        echo gettext("Event");
        ?>
 </th>
            <?php 
    }
    ?>
            <th> <?php 
    echo gettext("Risk");
    ?>
 </th>
          </tr>
<?php 
    $list = $security_report->EventsByRisk($NUM_HOSTS, $report_type, $date_from, $date_to);
    foreach ($list as $l) {
        $event = $l[0];
        $risk = $l[1];
        ?>
          <tr>
            <td style="text-align:left;"><?php 
        echo Util::signaturefilter($event);
        ?>
</a></td>
            <td style="text-align:left;"><?php 
        echo_risk($risk);
        ?>
</td>
          </tr>
<?php 
    }
    ?>
        </table>
        <br/>
<?php 
}
    if (count($list) == 0) {
        $htmlPdfReport->set('
        <table class="w100" cellpadding="0" cellspacing="0">
            <tr>
                <td class="w100" align="center" valign="top">' . _("No data available") . '</td>
            </tr>
        </table><br/><br/>');
        return;
    }
    $htmlPdfReport->set('
        <table class="w100" cellpadding="0" cellspacing="0">
            <tr>
                <td style="padding:15px 0px 0px 0px;width:100%" valign="top">
                    <table class="w100">
                        <tr>');
    $htmlPdfReport->set('<th>' . _("Event") . '</th>');
    $htmlPdfReport->set('<th class="center">' . gettext("Risk") . '</th></tr>');
    $c = 0;
    foreach ($list as $l) {
        $event = $l[0];
        $risk = $l[1];
        $bc = $c++ % 2 != 0 ? "class='par'" : "";
        $htmlPdfReport->set('<tr ' . $bc . '>
                                    <td style="text-align:left;width:68%">' . Util::wordwrap(Util::htmlentities(Util::signaturefilter($event)), 70, " ", true) . '</td>
                                    <td nowrap="nowrap" class="left" style="width:32%">' . echo_risk($risk, 1) . '</td></tr>');
    }
    $htmlPdfReport->set('</table>
                </td>
            </tr>
        </table><br/>');
}
Esempio n. 3
0
function event_max_risk($date_from, $date_to)
{
    global $NUM_HOSTS;
    global $security_report;
    global $report_type;
    require_once 'sec_util.php';
    $list = $security_report->EventsByRisk($NUM_HOSTS, $report_type, $date_from, $date_to);
    if (!is_array($list) || empty($list)) {
        return 0;
    }
    ?>
    <table class='t_alarms'>
        <thead>
            <tr>
                <td class="headerpr">
                <?php 
    if ($report_type == "alarm") {
        echo _("Top") . " " . $NUM_HOSTS . " " . _("Alarms by Risk");
    } else {
        echo _("Top") . " " . $NUM_HOSTS . " " . _("Events by Risk");
    }
    ?>
                </td>
            </tr>
        </thead>
        
        <tbody>     
            <tr>
                <td class='td_container'>
                    <table class='table_data'>
                        <thead>
                            <tr>
                                <?php 
    if ($report_type == "alarm") {
        ?>
                                    <th> <?php 
        echo gettext("Alarm");
        ?>
 </th>
                                    <?php 
    } else {
        ?>
                                    <th> <?php 
        echo gettext("Event");
        ?>
 </th>
                                    <?php 
    }
    ?>
                                <th><?php 
    echo gettext("Risk");
    ?>
</th>
                            </tr>
                        </thead>
                        
                        <tbody>
                            <?php 
    foreach ($list as $l) {
        $event = $l[0];
        $risk = $l[1];
        ?>
                                <tr>
                                    <td class='left td_data' valign='middle'><?php 
        echo Util::signaturefilter($event);
        ?>
</td>
                                    <td class='left td_data' valign='middle'><?php 
        echo_risk($risk);
        ?>
</td>
                                </tr>
                                <?php 
    }
    ?>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
    <br/>
    <?php 
    return 1;
}