Beispiel #1
0
        <img src="../pixmaps/gauge-red.jpg" height="5" 
             width="<?php 
echo $BAR_LENGTH_RIGHT;
?>
">
      </td>
    </tr>
    <!-- end rule for threshold -->


<?php 
if ($net_stats) {
    foreach ($net_stats as $stat) {
        $net = $stat->get_net_name();
        if (!Net_group::isNetInGroup($conn, $expand, $net)) {
            if ($stat->get_compromise() < Net::netthresh_c($conn, $net) && $stat->get_attack() < Net::netthresh_a($conn, $net) && Net_group::isNetInAnyGroup($conn, $net)) {
                continue;
            }
        }
        /* get net threshold */
        if ($net_list = Net::get_list($conn, "name = '{$net}'")) {
            $threshold_c = $net_list[0]->get_threshold_c();
            $threshold_a = $net_list[0]->get_threshold_a();
        } else {
            $threshold_c = $threshold_a = $THRESHOLD_DEFAULT;
        }
        /* calculate proportional bar width */
        $width_c = ($compromise = $stat->get_compromise()) / $threshold_c * $BAR_LENGTH_LEFT;
        $width_a = ($attack = $stat->get_attack()) / $threshold_a * $BAR_LENGTH_LEFT;
        ?>
Beispiel #2
0
echo $BAR_LENGTH_RIGHT;
?>
">
        </td>
    </tr>
    <!-- end rule for threshold -->


    <?php 
if ($net_stats) {
    foreach ($net_stats as $stat) {
        $net_id = $stat->get_net_id();
        $net_name = $stat->get_net_name();
        $_net_aux = Asset_net::get_object($conn, $net_id);
        if (!Net_group::isNetInGroup($conn, $expand, $net_id)) {
            if ($stat->get_compromise() < $_net_aux->get_threshold_c() && $stat->get_attack() < $_net_aux->get_threshold_a() && Net_group::isNetInAnyGroup($conn, $net_id)) {
                continue;
            }
        }
        /* get net threshold */
        if (is_object($_net_aux)) {
            $threshold_c = $_net_aux->get_threshold_c();
            $threshold_a = $_net_aux->get_threshold_a();
        } else {
            $threshold_c = $threshold_a = $THRESHOLD_DEFAULT;
        }
        /* calculate proportional bar width */
        $width_c = ($compromise = $stat->get_compromise()) / $threshold_c * $BAR_LENGTH_LEFT;
        $width_a = ($attack = $stat->get_attack()) / $threshold_a * $BAR_LENGTH_LEFT;
        ?>