コード例 #1
0
function get_ip_reputation_summary()
{
    $data = POST('data');
    $type = intval($data['type']);
    //Initialization of Vars
    $ips = array();
    $top = array();
    $chart = array();
    $total = 0;
    $date = _('Unknown');
    $Reputation = new Reputation();
    if ($Reputation->existReputation()) {
        list($ips, $cou, $order, $total) = $Reputation->get_data($type, 'All');
        session_write_close();
        //Getting IPs by Country
        $cou = array_splice($cou, 0, 10);
        foreach ($cou as $c => $value) {
            $info = explode(";", $c);
            $flag = '';
            if ($info[1] != '') {
                $flag = "<img src='/ossim/pixmaps/" . ($info[1] == "1x1" ? "" : "flags/") . strtolower($info[1]) . ".png'>";
            }
            $top[] = array('flag' => $flag, 'name' => $info[0], 'occurrences' => Util::number_format_locale($value, 0));
        }
        //Getting IPs by Activity
        $order = array_splice($order, 0, 10);
        foreach ($order as $type => $ocurrences) {
            $chart[] = array($type . ' [' . Util::number_format_locale($ocurrences, 0) . ']', $ocurrences);
        }
        //Getting total of IPs
        $total = Util::number_format_locale($total, 0);
        //Getting Date of the last Update.
        $date = gmdate("Y-m-d H:i:s", filemtime($Reputation->rep_file) + 3600 * Util::get_timezone());
    }
    return array('ips' => $ips, 'top_countries' => $top, 'ip_by_activity' => $chart, 'total' => $total, 'last_updated' => $date);
}
コード例 #2
0
ファイル: real_time.php プロジェクト: jackpf/ossim-arc
    echo _("Protocol");
    ?>
:</td>
                        <td class='data'>
                            <input type='text' class='inp_filter' name='protocol' id='protocol'/>
                            <span style='margin-left: 3px;'><a class='clean' id='clean_protocol' title='<?php 
    echo _("Clean filter");
    ?>
'><img src='/ossim/pixmaps/delete.gif' align='absmiddle'/></a></span>
                        </td>
                        <td class='noborder' colspan='2'>
                            <table id='filter_chk'>
                                <tr>
                                    <?php 
    $Reputation = new Reputation();
    if ($Reputation->existReputation()) {
        ?>
                                        <td class='_label'><span><?php 
        echo _("Include OTX Info");
        ?>
:</span></td>
                                        <td class='data' style='width:62px !important;'><input type='checkbox' name='idm' id='idm' checked='checked' value="1"/></td>
                                        <?php 
    }
    ?>
                                    <td></td>
                                </tr>
                            </table>
                        </td>

                    </tr>