Esempio n. 1
0
        if (count($active_plugins[$asset_id_canonical]) < 1) {
            $plugin_list[$asset_id][] = array('vendor' => '', 'model' => '', 'version' => '', 'model_list' => array(), 'version_list' => array());
        } else {
            foreach ($active_plugins[$asset_id_canonical] as $pdata) {
                $models = array();
                $versions = array();
                if ($pdata['vendor'] != '') {
                    try {
                        $models = Software::get_models_by_vendor($pdata['vendor']);
                    } catch (Exception $e) {
                        Av_exception::write_log(Av_exception::USER_ERROR, $e->getMessage());
                    }
                }
                if ($pdata['model'] != '') {
                    try {
                        $versions = Software::get_versions_by_model($pdata['vendor'] . ':' . $pdata['model']);
                    } catch (Exception $e) {
                        Av_exception::write_log(Av_exception::USER_ERROR, $e->getMessage());
                    }
                }
                $plugin_list[$asset_id][] = array('vendor' => $pdata['vendor'], 'model' => $pdata['vendor'] . ':' . $pdata['model'], 'version' => $pdata['vendor'] . ':' . $pdata['model'] . ':' . $pdata['version'], 'model_list' => $models, 'version_list' => $versions);
            }
        }
        $device_list[$asset_id] = array("name" => $host['name'], "ips" => Asset::format_to_print($host['ips']), "plugins" => $plugin_list[$asset_id]);
    }
} else {
    $empty_msg = _('There are no network devices found. Return to the asset discovery step by clicking back to either discover or add network devices.');
}
/*  Subtitle Texts */
$subtitle_1 = '';
$subtitle_2 = '';
Esempio n. 2
0
function get_version_list($data)
{
    $response = array();
    $model = $data['model'];
    $sensor = $data['sensor'];
    ossim_valid($model, OSS_NULLABLE, OSS_ALPHA, OSS_PUNC_EXT, 'illegal:' . _("Model"));
    ossim_valid($sensor, OSS_ALPHA, OSS_HEX, 'illegal:' . _("Sensor"));
    check_ossim_error();
    if (empty($model)) {
        $items = array();
    } else {
        $items = Software::get_versions_by_model($model, $sensor);
    }
    $response['error'] = FALSE;
    $response['data']['items'] = $items;
    return $response;
}
Esempio n. 3
0
     /**
      * EDIT MODE: No order, no search filter, and looping $plugin_data array is a based asset_id Hash
      */
     $total_filtered = $total;
     foreach ($plugin_data as $asset_id => $asset_plugins) {
         // Apply pagination
         if ($i >= $from && $i < $from + $maxrows) {
             $_row_data = array();
             foreach ($asset_plugins as $_pdata) {
                 $model_list = array();
                 $version_list = array();
                 if ($_pdata['vendor'] != '') {
                     $model_list = Software::get_models_by_vendor($_pdata['vendor'], $sensor_id);
                 }
                 if ($_pdata['model'] != '') {
                     $version_list = Software::get_versions_by_model($_pdata['vendor'] . ':' . $_pdata['model'], $sensor_id);
                 }
                 $_row_data[$asset_id][] = array('asset_id' => $asset_id, 'vendor' => $_pdata['vendor'], 'model' => $_pdata['vendor'] . ':' . $_pdata['model'], 'version' => $_pdata['vendor'] . ':' . $_pdata['model'] . ':' . $_pdata['version'], 'model_list' => json_encode($model_list), 'version_list' => json_encode($version_list));
             }
             $aux_data = array();
             $aux_data[] = $_pdata['asset'];
             $aux_data[] = '';
             // Empty. Here will be located the vendor/model/version select boxes
             $aux_data['DT_RowData'] = $_row_data;
             //Row ID
             $aux_data['DT_RowId'] = $asset_id;
             $data[] = $aux_data;
         }
         $i++;
     }
 } else {