Example #1
0
$is_ext_ctx = FALSE;
$context_type = 'local';
$ext_ctxs = Session::get_external_ctxs($conn);
if (!empty($ext_ctxs[$ctx])) {
    $is_ext_ctx = TRUE;
    $context_type = 'remote';
}
$descr = $net->get_descr();
$icon = $net->get_html_icon();
$external = $net->get_external();
$asset_value = $net->get_asset_value();
$threshold_a = $net->get_threshold_a();
$threshold_c = $net->get_threshold_c();
$owner = $net->get_owner();
//Net Ips
$ips = $net->get_ips();
$net_sensors = $net->get_sensors();
$sensors = $net_sensors->get_sensors();
//Net Scan
$is_nagios_enabled = Asset_net_scan::is_plugin_in_net($conn, $id, 2007);
//Closing database connection
$db->close();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><?php 
echo _('OSSIM Framework');
?>
</title>
Example #2
0
function insert_net($conn, $data)
{
    $cidrs = preg_replace('/\\s*/', '', $data['cidr']);
    $name = utf8_decode($data['name']);
    $descr = $data['descr'];
    ossim_valid($cidrs, OSS_IP_CIDR, 'illegal:' . _("CIDR"));
    ossim_valid($name, OSS_NOECHARS, OSS_NET_NAME, 'illegal:' . _("Name"));
    ossim_valid($descr, OSS_NULLABLE, OSS_ALL, 'illegal:' . _("Description"));
    check_ossim_error();
    $uuid = Util::uuid();
    $net = new Asset_net($uuid);
    $sensor_ip = Util::get_default_admin_ip();
    $sensor = Av_sensor::get_id_by_ip($conn, $sensor_ip);
    $net->set_ips($cidrs);
    $net->set_name($name);
    $net->set_descr($descr);
    $net->set_sensors(array($sensor));
    //Insert the New Net
    $net->save_in_db($conn);
    $data = array();
    $data['cidr'] = $net->get_ips();
    $response['error'] = FALSE;
    $response['data'] = $data;
    return $response;
}
Example #3
0
$owner = $asset->get_owner() != '' ? $asset->get_owner() : '<i>' . _('unknown') . '</i>';
echo Util::utf8_encode2($owner);
?>
            </div>
        </div>
        
        <div>
            <div class='tray_title'>
                <?php 
echo _('CIDR');
?>
            </div>
            
            <div class='tray_content'>
                <?php 
echo $asset->get_ips('string');
?>
            </div>
        </div>
        
        <div>
            <div class='tray_title'>
                <?php 
echo _('Sensors');
?>
            </div>
            
            <div class='tray_content'>
                <?php 
$asset_sensors_obj = $asset->get_sensors();
$asset_sensors = $asset_sensors_obj->get_sensors();