add news checkbox for vlan_enabled and snmp_enabled

This commit is contained in:
daniel 2017-03-22 16:30:15 +01:00
parent aeb8e74bdc
commit 81cf7aba11
4 changed files with 27 additions and 6 deletions

View File

@ -108,7 +108,8 @@ if ((isset ($_GET["update"])) OR ((isset ($_GET["create"])))) {
$parent_detection = (int) get_parameter ("parent_detection", 0);
$parent_recursion = (int) get_parameter ("parent_recursion", 1);
$alias_as_name = (int) get_parameter ("alias_as_name", 0);
$snmp_enabled = (int) get_parameter ('snmp_enabled', 0);
$vlan_enabled = (int) get_parameter ('vlan_enabled', 0);
// Get macros
$macros = (string) get_parameter ('macros');
@ -151,7 +152,9 @@ if (isset($_GET["update"])) {
'parent_detection' => $parent_detection,
'parent_recursion' => $parent_recursion,
'macros' => $macros,
'alias_as_name' => $alias_as_name
'alias_as_name' => $alias_as_name,
'snmp_enabled' => $snmp_enabled,
'vlan_enabled' => $vlan_enabled
);
$where = array('id_rt' => $id);
@ -212,7 +215,9 @@ if (isset($_GET["create"])) {
'parent_detection' => $parent_detection,
'parent_recursion' => $parent_recursion,
'macros' => $macros,
'alias_as_name' => $alias_as_name
'alias_as_name' => $alias_as_name,
'snmp_enabled' => $snmp_enabled,
'vlan_enabled' => $vlan_enabled
);
$name = io_safe_output($name);

View File

@ -124,6 +124,8 @@ if (isset($_GET["update"]) || (isset($_GET["upd"]))) {
$parent_recursion = $row["parent_recursion"];
$macros = $row["macros"];
$alias_as_name = $row["alias_as_name"];
$snmp_enabled = $row["snmp_enabled"];
$vlan_enabled = $row["vlan_enabled"];
$name_script = db_get_value('name',
'trecon_script', 'id_recon_script', $id_recon_script);
@ -169,6 +171,8 @@ elseif (isset($_GET["create"]) || isset($_GET["crt"])) {
$parent_recursion = 5;
$macros = '';
$alias_as_name = 0;
$snmp_enabled = 0;
$vlan_enabled = 0;
}
$modify = false;
@ -207,6 +211,8 @@ $table->rowclass[18] = "network_sweep";
$table->rowclass[19] = "network_sweep";
$table->rowclass[20] = "network_sweep";
$table->rowclass[21] = "network_sweep";
$table->rowclass[22] = "network_sweep";
$table->rowclass[23] = "network_sweep";
$table->rowclass[6] = "recon_script";
$table->rowclass[12] = "recon_script";
@ -375,6 +381,14 @@ $table->data[20][1] = html_print_checkbox ('parent_detection', 1, $parent_detec
$table->data[21][0] = "<b>".__('Parent recursion');
$table->data[21][1] = html_print_input_text ('parent_recursion', $parent_recursion, '', 5, 0, true) . ui_print_help_tip (__('Maximum number of parent hosts that will be created if parent detection is enabled.'), true);
//snmp_enabled
$table->data[22][0] = "<b>".__('SNMP enabled');
$table->data[22][1] = html_print_checkbox ('snmp_enabled', 1, $snmp_enabled, true);
//vlan_enabled
$table->data[23][0] = "<b>".__('Vlan enabled');
$table->data[23][1] = html_print_checkbox ('vlan_enabled', 1, $vlan_enabled, true);
// Alias as name
// NOTE: The 7.0NG Recon Server will not generate random names, since IP
// address collisions could have other consequences.

View File

@ -127,9 +127,9 @@ require_once ($ownDir. 'functions_config.php');
// Later will be replaced by the good one.
if (!defined('METACONSOLE')) {
if(!isset($config["homeurl"])){
$url = preg_match('/(\/.+)\/.*\/*/', $_SERVER['REQUEST_URI'], $match);
$config["homeurl"] = $match[1];
$config["homeurl_static"] = $match[1];
$url = explode('/', $_SERVER['REQUEST_URI']);
$config["homeurl"] = $url[1];
$config["homeurl_static"] = $url[1];
$config["error"] = "homeurl_bad_defined";
return;
}

View File

@ -728,6 +728,8 @@ CREATE TABLE IF NOT EXISTS `trecon_task` (
`disabled` tinyint(1) unsigned NOT NULL DEFAULT '0',
`macros` TEXT,
`alias_as_name` tinyint(2) NOT NULL default '0',
`snmp_enabled` tinyint(1) unsigned default '0',
`vlan_enabled` tinyint(1) unsigned default '0',
PRIMARY KEY (`id_rt`),
KEY `recon_task_daemon` (`id_recon_server`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;