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);
}
Beispiel #2
0
    			font-size: 12px;
    		}
    		
    		.jqplot-legend-title  
    		{
    			text-align: left !important;
    		}
    		
    		.jqplot-title 
    		{
    			background-color: rgba(200,200,200,0.1);
    		}
    		
    	</style>
        <?php 
    list($ips, $cou, $order, $total) = $reputation->get_data($type);
    $data = array();
    $order = array_splice($order, 0, 10);
    foreach ($order as $type => $ocurrences) {
        $data[] = "['{$type} [" . Util::number_format_locale($ocurrences, 0) . "]',{$ocurrences}]";
    }
    $data = implode(",", $data);
    ?>
	
    	<script type='text/javascript'>
    	            		
    		function myClickHandler(ev, gridpos, datapos, neighbor, plot) 
    		{
                //mouseX = ev.pageX; mouseY = ev.pageY;
                if (neighbor) 
                {
	<script type="text/javascript" src="../js/messages.php"></script>
	
	<script type="text/javascript">
    
		var script = '<script type="text/javascript" src="../js/markerclusterer.js"><' + '/script>';
		document.write(script);
		
		if ( typeof(google) != 'undefined' && google != null )
		{
			<?php 
$Reputation = new Reputation();
if (!$Reputation->existReputation()) {
    exit;
}
$nodes = array();
list($ips, $cou, $order, $total) = $Reputation->get_data($type, $act);
session_write_close();
foreach ($ips as $activity => $ip_data) {
    if ($activity == $act || $act == "All") {
        foreach ($ip_data as $ip => $latlng) {
            if (preg_match("/-?\\d+(\\.\\d+)?,-?\\d+(\\.\\d+)?/", $latlng)) {
                $tmp = explode(",", $latlng);
                $node = "{ ip: '{$ip} [{$activity}]', lat: '" . $tmp[0] . "', lng: '" . $tmp[1] . "'}";
                $nodes[$ip] = $node;
            }
        }
    }
}
?>
			
			var points = [ <?php