function get_vendor_list($conn)
{
    $response = array();
    $items = Software::get_hardware_vendors($conn, TRUE);
    $response['error'] = FALSE;
    $response['data']['items'] = $items;
    return $response;
}
Exemple #2
0
function get_vendor_list($data)
{
    $response = array();
    $sensor = $data['sensor'];
    ossim_valid($sensor, OSS_ALPHA, OSS_HEX, 'illegal:' . _("Sensor"));
    check_ossim_error();
    $items = Software::get_hardware_vendors($sensor);
    $response['error'] = FALSE;
    $response['data']['items'] = $items;
    return $response;
}
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
$init_error = FALSE;
$sensor = GET('sensor') != '' ? GET('sensor') : 'local';
ossim_valid($sensor, OSS_ALPHA, OSS_HEX, OSS_NULLABLE, 'illegal:' . _('Sensor'));
if (ossim_error()) {
    die(ossim_error());
}
/*
 * For performance and synchronicity, the Vendors list must be static.
 * Note that it must be reloaded when the sensor is manually changed.
 */
try {
    $_vendor_list = Software::get_hardware_vendors($sensor);
} catch (Exception $e) {
    $_vendor_list = array();
    $init_error = $e->getMessage();
}
?>

// Global variables
/* Note: presaved_data is used by asset_plugin_list.js.php dataTable object
 *       Must be global to store the changes in all dataTable pages
 *       And be able to use externally from edit_plugins.php
 */
var presaved_data = {};

function AVplugin_select()
{
Exemple #4
0
}
$system_list = Av_center::get_avc_list($conn);
$admin_ip = @$system_list['data'][strtolower(Util::get_system_uuid())]['admin_ip'];
$table = ', host_types ht, host_ip hip';
$f = array();
$f['where'] = " host.id=ht.host_id AND ht.type=4 AND hip.host_id=host.id AND hip.ip!=inet6_aton('{$admin_ip}')";
try {
    list($hosts, $total) = Asset_host::get_list($conn, $table, $f, FALSE);
    $active_plugins = Plugin::get_plugins_by_assets();
} catch (Exception $e) {
    $total = 0;
    Av_exception::write_log(Av_exception::USER_ERROR, $e->getMessage());
}
if ($total > 0) {
    try {
        $vendors = Software::get_hardware_vendors();
    } catch (Exception $e) {
        $vendors = array();
        Av_exception::write_log(Av_exception::USER_ERROR, $e->getMessage());
    }
    $device_list = array();
    foreach ($hosts as $asset_id => $host) {
        $plugin_list = array();
        $asset_id_canonical = Util::uuid_format($asset_id);
        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'] != '') {
    $nt->show();
    die;
}
$asset_id = GET('asset_id');
$sensor_id = GET('sensor_id');
ossim_valid($asset_id, OSS_HEX, 'illegal:' . _('Asset ID'));
ossim_valid($sensor_id, OSS_HEX, OSS_NULLABLE, 'illegal:' . _('Sensor ID'));
if (ossim_error()) {
    die(ossim_error());
}
// Database Object
$db = new ossim_db();
$conn = $db->connect();
//Getting the vendors
try {
    $vendors = Software::get_hardware_vendors($conn, TRUE);
} catch (Exception $e) {
    $vendors = array();
    Av_exception::write_log(Av_exception::USER_ERROR, $e->getMessage());
}
$plugin_list = array();
try {
    $related_sensors = Asset_host_sensors::get_sensors_by_id($conn, $asset_id);
    $selected_sensor = $sensor_id != '' ? $sensor_id : key($related_sensors);
    $active_plugins = Plugin::get_plugins_by_device(Util::uuid_format($selected_sensor));
    $asset_plugins = is_array($active_plugins[$asset_id]) ? $active_plugins[$asset_id] : array();
    foreach ($asset_plugins as $pdata) {
        $model_list = array();
        $version_list = array();
        list($vendor, $model, $version) = Plugin::translate_cpe_to_software($pdata['cpe']);
        if ($vendor != '') {