Пример #1
0
        if (is_array($nmap_options) && count($nmap_options) > 0) {
            $task_params = $task_params . '#' . implode(' ', $nmap_options);
        }
        // Clean $task_params for OCS tasks
        if ($task_type == 3) {
            $task_params = '';
        }
        if (!Inventory::modify($conn, $task_id, $sensor_id, $task_name, $task_type, $task_period, $task_params, $task_nets)) {
            $config_nt['options']['type'] = 'nf_error';
            $config_nt['content'] = _('Error! Inventory task could not be updated');
        } else {
            $config_nt['options']['type'] = 'nf_success';
            $config_nt['content'] = _('Inventory task updated successfully');
        }
    } elseif ($submit == _('Enable / Disable')) {
        if (!Inventory::toggle_scan($conn, $task_id)) {
            $config_nt['options']['type'] = 'nf_error';
            $config_nt['content'] = _('Error! Inventory task could not be updated');
        } else {
            $config_nt['options']['type'] = 'nf_success';
            $config_nt['content'] = _('Inventory task updated successfully');
        }
    }
}
if (!empty($update)) {
    $properties = $sensor_obj->get_properties();
    $properties['has_nagios'] = $has_nagios;
    $properties['has_ntop'] = $has_ntop;
    $properties['has_vuln_scanner'] = $has_vuln_scanner;
    $properties['has_kismet'] = $has_kismet;
    $sensor_obj->set_properties($properties);