Пример #1
0
    $flag = strtolower($location);
    $uuid = strtoupper(preg_replace('/^0x|NULL/i', '', $dip['uuid']));
    if (!isset($hosts_ids[$uuid])) {
        $_hname = Asset_host::get_name_by_id($conn, $uuid);
        $hosts_ids[$uuid] = $_hname == _('Unknown') ? '' : $_hname;
    }
    $hostname = $hosts_ids[$uuid];
    $hostname = $hostname == '' && $hostname != $ip ? $ip : $hostname . " ({$ip})";
    if (strlen($location) == 2 && $location != $geoloc->get_country_name($location)) {
        $location = $geoloc->get_country_name($location);
    }
    if (file_exists("/usr/share/ossim/www/pixmaps/flags/{$flag}.png")) {
        $flag = "/ossim/pixmaps/flags/{$flag}.png";
    } else {
        // Try to geoloc
        $record = $geoloc->get_location_from_file($ip);
        $flag = strtolower($record->country_code);
        if (!file_exists("/usr/share/ossim/www/pixmaps/flags/{$flag}.png")) {
            $flag = "/ossim/alarm/style/img/unknown.png";
            $location = _('Unknown');
        } else {
            $flag = "/ossim/pixmaps/flags/{$flag}.png";
            $location = $record->country_name;
        }
    }
    ?>
					<tr>
						<td style="font-size:10px">
							<?php 
    echo $dip['count'];
    ?>
Пример #2
0
    	$(document).ready(function() 
    	{
    		$("#tabs").tabs();
    		
    		var m_index = 0;
    		av_map = new Av_map('c_map');
    		
    		if(Av_map.is_map_available())
            {
                <?php 
if (is_array($data['ip']) && !empty($data['ip'])) {
    $ips = array_keys($data['ip']);
    $num_ips = count($ips);
    $first_ip = $ips[0];
    $record = $gloc->get_location_from_file($first_ip);
    $lat = $record->latitude;
    $lng = $record->longitude;
    if ($num_ips > 1) {
        ?>
                        av_map.set_location('', '');                                                               
                        <?php 
    } else {
        ?>
                        av_map.set_location('<?php 
        echo $lat;
        ?>
', '<?php 
        echo $lng;
        ?>
');                            
Пример #3
0
     foreach ($_networks as $n_id => $n) {
         $networks[$n_id] = array('name' => $n['name']);
     }
     $response['id'] = $asset_id;
     $response['ip'] = $asset_ip;
     $response['name'] = $asset->get_name();
     $response['groups'] = $groups;
     $response['nets'] = $networks;
 } else {
     $response['id'] = $asset_id;
     $response['ip'] = $asset_ip;
     $response['name'] = $asset_ip;
     $response['groups'] = array();
     $response['nets'] = array();
 }
 $record = $gloc->get_location_from_file($asset_ip);
 $flag_code = strtolower($record->country_code);
 if (file_exists("/usr/share/ossim/www/pixmaps/flags/{$flag_code}.png")) {
     $flag = "/ossim/pixmaps/flags/{$flag_code}.png";
 }
 if (is_object($gorg)) {
     $org = $gorg->get_organization_by_host($ip);
 }
 $response['location'] = array('flag' => strval($flag), 'country' => strval($record->country_name), 'organization' => strval($org));
 //Get the stats for check the reputation
 $stats = $_SESSION["_alarm_stats"];
 $c_rep_1 = $stats['src']['ip'][$asset_ip]['rep'] > 0;
 $c_rep_2 = $stats['dst']['ip'][$asset_ip]['rep'] > 0;
 $response['reputation'] = $c_rep_1 || $c_rep_2;
 $db->close();
 $gloc->close();