Пример #1
0
<table class='t_sc'>
    <tr>
        <th class='_label'><?php 
display_label($cnf_data['sensor_interfaces']);
?>
</th>
        <td class='_data'>
            <div id='c_ifaces'>
                <?php 
$id = $cnf_data['sensor_interfaces']['id'];
$s_ifaces = $cnf_data['sensor_interfaces']['value'];
$s_ifaces = array_flip($s_ifaces);
//Interfaces
$interfaces = array();
try {
    $interfaces = Av_sensor::get_interfaces($system_id);
} catch (Exception $e) {
}
?>

                <select class='vfield multiselect' id='<?php 
echo $id;
?>
' name='<?php 
echo $id . "[]";
?>
' multiple='multiple'>
                    <?php 
foreach ($interfaces as $iface) {
    $i_name = $iface['name'];
    $id_iface = md5($i_name);
Пример #2
0
$interface = GET('interface');
$proto = GET('proto');
ossim_valid($interface, OSS_ALPHA, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _('Interface'));
ossim_valid($proto, OSS_ALPHA, OSS_NULLABLE, 'illegal:' . _('Protocol'));
if (ossim_error()) {
    die(ossim_error());
}
$db = new ossim_db();
$conn = $db->connect();
$filters = array('where' => 'sensor_properties.has_ntop = 1', 'order_by' => 'priority DESC');
$ntop_list = array();
list($aux_ntop_list, $_total) = Av_sensor::get_list($conn, $filters);
if ($_total > 0) {
    foreach ($aux_ntop_list as $s_id => $s) {
        try {
            $i_faces = Av_sensor::get_interfaces($s['ip']);
            if (is_array($i_faces) && !empty($i_faces)) {
                $ntop_list[$s_id] = $s;
                $ntop_list[$s_id]['i_faces'] = $i_faces;
            }
        } catch (Exception $e) {
        }
    }
    //Sensor by default
    if ($sensor == '') {
        $s_id = key($ntop_list);
        $sensor = $ntop_list[$s_id]['ip'];
    }
}
if (!$_total) {
    echo ossim_error(_('There are not sensors with NTOP enabled'), AV_WARNING);