From eb49bde71f3b10efd1df21a47c7ecc3164b1832c Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Tue, 19 Feb 2019 15:50:14 +0100 Subject: [PATCH 01/50] Ticekt resolved Former-commit-id: b93b1c5cb39239f3b038d55b39e8102de1628742 --- pandora_console/extensions/dbmanager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/extensions/dbmanager.php b/pandora_console/extensions/dbmanager.php index 2aface6996..c924bd3ea9 100644 --- a/pandora_console/extensions/dbmanager.php +++ b/pandora_console/extensions/dbmanager.php @@ -106,7 +106,7 @@ function dbmgr_extension_main() echo '

'; echo "
"; - html_print_textarea('sql', 5, 50, html_entity_decode($sql, ENT_QUOTES)); + html_print_textarea('sql', 5, 50, $sql); echo '
'; echo '
'; echo '
'; From 6ef1c3951af5cc8e82279531fc7b19b23b580f6f Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Thu, 21 Feb 2019 14:04:00 +0100 Subject: [PATCH 02/50] Ticket Changed Former-commit-id: e258f0932398d9fc58a8d097098c83b7bed084c5 --- pandora_console/operation/agentes/status_monitor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index ada6cd6ec6..953996678a 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -945,7 +945,7 @@ $sql = 'SELECT LIMIT '.$offset.','.$limit_sql; // When you enter for the first time you have less than 4 query params in the url -$first_interaction = count($_GET) > 4; +$first_interaction = count($_GET); // We do not show the modules until the user searches with the filter if ($first_interaction) { if (! defined('METACONSOLE')) { @@ -1032,6 +1032,7 @@ if (($config['dbtype'] == 'oracle') && ($result !== false)) { } } + // Start Build List Result // if (!empty($result)) { From 35ad2f4bb5d7d537bc69804643feedc4f0644ff2 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Fri, 22 Feb 2019 11:21:38 +0100 Subject: [PATCH 03/50] Validations for default values Former-commit-id: a33139b817ece206a611d5f2678b62c876a8e41f --- .../operation/agentes/status_monitor.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 953996678a..6e3c26b470 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -63,6 +63,17 @@ $sort = get_parameter('sort', 'none'); $id_module = (int) get_parameter('id_module', 0); $ag_custom_fields = (array) get_parameter('ag_custom_fields', []); $module_option = (int) get_parameter('module_option', 1); +$autosearch = false; + +// It is validated if it receives parameters different from those it has by default +if ($ag_freestring != '' || $moduletype != '' || $datatype != '' + || $ag_modulename != '' || $refr != 0 || $offset != 0 || $status != 4 + || $modulegroup != -1 || $tag_filter != 0 || $sortField != '' + || $sort != '' || $id_module != 0 || $ag_custom_fields != null + || $module_option != 1 +) { + $autosearch = true; +} if (!is_metaconsole()) { $ag_group = (int) get_parameter('ag_group', 0); @@ -947,7 +958,7 @@ $sql = 'SELECT // When you enter for the first time you have less than 4 query params in the url $first_interaction = count($_GET); // We do not show the modules until the user searches with the filter -if ($first_interaction) { +if ($first_interaction || $autosearch) { if (! defined('METACONSOLE')) { $result = db_get_all_rows_sql($sql); From 504a8e9d1a3c0ccb92090d4131b7f39acfa839d1 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 25 Feb 2019 13:02:39 +0100 Subject: [PATCH 04/50] fixed warnings php Former-commit-id: d21cb02113c65a7f50a5e29f7f536e85ba5cb945 --- pandora_console/extras/pandora_diag.php | 4 +- .../godmode/groups/modu_group_list.php | 179 ++++--- .../godmode/massive/massive_add_alerts.php | 88 ++-- .../godmode/servers/manage_recontask.php | 109 ++-- .../godmode/servers/manage_recontask_form.php | 479 ++++++++++++++---- pandora_console/include/functions_events.php | 46 +- .../include/functions_pandora_networkmap.php | 293 ++++++----- .../agentes/pandora_networkmap.editor.php | 46 +- .../agentes/pandora_networkmap.view.php | 157 +++--- 9 files changed, 913 insertions(+), 488 deletions(-) diff --git a/pandora_console/extras/pandora_diag.php b/pandora_console/extras/pandora_diag.php index 519b4b32a5..d6cd017087 100644 --- a/pandora_console/extras/pandora_diag.php +++ b/pandora_console/extras/pandora_diag.php @@ -106,7 +106,9 @@ function get_value_sum($arr) { foreach ($arr as $clave) { foreach ($clave as $valor) { - $result += $valor; + if (is_numeric($valor) === true) { + $result += $valor; + } } } diff --git a/pandora_console/godmode/groups/modu_group_list.php b/pandora_console/godmode/groups/modu_group_list.php index f75d46cfd8..9dbc9311a6 100644 --- a/pandora_console/godmode/groups/modu_group_list.php +++ b/pandora_console/godmode/groups/modu_group_list.php @@ -1,17 +1,32 @@ $name]); + $result = db_process_sql_insert( + 'tmodule_group', + ['name' => $name] + ); if ($result) { ui_print_success_message(__('Group successfully created')); } else { - ui_print_error_message(__('There was a problem creating group')); + ui_print_error_message( + __('There was a problem creating group') + ); } } else { - ui_print_error_message(__('Each module group must have a different name')); + ui_print_error_message( + __('Each module group must have a different name') + ); } } else { ui_print_error_message(__('Module group must have a name')); } } -// Update group +// Update group. if ($update_group) { $id_group = (int) get_parameter('id_group'); $name = (string) get_parameter('name'); @@ -98,38 +127,79 @@ if ($update_group) { if ($name) { if (!$check || $subcheck == $name) { - $result = db_process_sql_update('tmodule_group', ['name' => $name], ['id_mg' => $id_group]); + $result = db_process_sql_update( + 'tmodule_group', + ['name' => $name], + ['id_mg' => $id_group] + ); if ($result !== false) { ui_print_success_message(__('Group successfully updated')); } else { - ui_print_error_message(__('There was a problem modifying group')); + ui_print_error_message( + __('There was a problem modifying group') + ); } } else { - ui_print_error_message(__('Each module group must have a different name')); + ui_print_error_message( + __('Each module group must have a different name') + ); } } else { ui_print_error_message(__('Module group must have a name')); } } -// Delete group +// Delete group. if ($delete_group) { $id_group = (int) get_parameter('id_group'); $result = db_process_sql_delete('tmodule_group', ['id_mg' => $id_group]); if ($result) { - $result = db_process_sql_update('tagente_modulo', ['id_module_group' => 0], ['id_module_group' => $id_group]); - db_process_sql_update('tpolicy_modules', ['id_module_group' => 0], ['id_module_group' => $id_group]); - db_process_sql_update('tcontainer_item', ['id_module_group' => 0], ['id_module_group' => $id_group]); - db_process_sql_update('tnetwork_component', ['id_module_group' => 0], ['id_module_group' => $id_group]); - db_process_sql_update('treport_content', ['id_module_group' => 0], ['id_module_group' => $id_group]); - db_process_sql_update('tnetwork_map', ['id_module_group' => 0], ['id_module_group' => $id_group]); - db_process_sql_update('tlocal_component', ['id_module_group' => 0], ['id_module_group' => $id_group]); - db_process_sql_update('treport_content_template', ['id_module_group' => 0], ['id_module_group' => $id_group]); + $result = db_process_sql_update( + 'tagente_modulo', + ['id_module_group' => 0], + ['id_module_group' => $id_group] + ); + db_process_sql_update( + 'tpolicy_modules', + ['id_module_group' => 0], + ['id_module_group' => $id_group] + ); + db_process_sql_update( + 'tcontainer_item', + ['id_module_group' => 0], + ['id_module_group' => $id_group] + ); + db_process_sql_update( + 'tnetwork_component', + ['id_module_group' => 0], + ['id_module_group' => $id_group] + ); + db_process_sql_update( + 'treport_content', + ['id_module_group' => 0], + ['id_module_group' => $id_group] + ); + db_process_sql_update( + 'tnetwork_map', + ['id_module_group' => 0], + ['id_module_group' => $id_group] + ); + db_process_sql_update( + 'tlocal_component', + ['id_module_group' => 0], + ['id_module_group' => $id_group] + ); + db_process_sql_update( + 'treport_content_template', + ['id_module_group' => 0], + ['id_module_group' => $id_group] + ); - // A group with no modules can be deleted, to avoid a message error then do the follwing + // A group with no modules can be deleted, + // to avoid a message error then do the follwing. if ($result !== false) { $result = true; } @@ -150,36 +220,15 @@ $offset = (int) get_parameter('offset', 0); ui_pagination($total_groups, $url, $offset); -switch ($config['dbtype']) { - case 'mysql': - $sql = 'SELECT * - FROM tmodule_group - ORDER BY name ASC - LIMIT '.$offset.', '.$config['block_size']; - break; - case 'postgresql': - $sql = 'SELECT * - FROM tmodule_group - ORDER BY name ASC - LIMIT '.$config['block_size'].' OFFSET '.$offset; - break; - - case 'oracle': - $set = []; - $set['limit'] = $config['block_size']; - $set['offset'] = $offset; - - $sql = 'SELECT * - FROM tmodule_group - ORDER BY name ASC'; - - $sql = oracle_recode_query($sql, $set); - break; -} +$sql = 'SELECT * + FROM tmodule_group + ORDER BY name ASC + LIMIT '.$offset.', '.$config['block_size']; $groups = db_get_all_rows_sql($sql); +$table = new stdClass(); $table->width = '100%'; $table->class = 'databox data'; @@ -210,11 +259,21 @@ if (!empty($groups)) { html_print_table($table); } else { - ui_print_info_message(['no_close' => true, 'message' => __('There are no defined module groups') ]); + ui_print_info_message( + [ + 'no_close' => true, + 'message' => __('There are no defined module groups'), + ] + ); } echo ''; echo '
'; -html_print_submit_button(__('Create module group'), 'crt', false, 'class="sub next"'); +html_print_submit_button( + __('Create module group'), + 'crt', + false, + 'class="sub next"' +); echo '
'; echo ''; diff --git a/pandora_console/godmode/massive/massive_add_alerts.php b/pandora_console/godmode/massive/massive_add_alerts.php index 989a8cd3a8..bf52fd0459 100755 --- a/pandora_console/godmode/massive/massive_add_alerts.php +++ b/pandora_console/godmode/massive/massive_add_alerts.php @@ -1,17 +1,32 @@ $v) { $agents[$keys_prefix.$k] = $v; @@ -92,8 +108,8 @@ function process_manage_add($id_alert_template, $id_agents, $module_names) foreach ($module_names as $module) { foreach ($id_agents as $id_agent) { - $module_id = modules_get_agentmodule_id($module, $id_agent); - $modules_id[] = $module_id['id_agente_modulo']; + $module_id = modules_get_agentmodule_id($module, $id_agent); + $modules_id[] = $module_id['id_agente_modulo']; } } @@ -148,6 +164,7 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AW')) { $return_all_group = true; } +$table = new stdClass(); $table->id = 'add_table'; $table->class = 'databox filters'; $table->width = '100%'; @@ -251,10 +268,10 @@ html_print_submit_button(__('Add'), 'go', false, 'class="sub add"'); echo '
'; echo ''; -// TODO: Change to iu_print_error system +// TODO: Change to iu_print_error system. echo ''; -// Hack to translate text "none" in PHP to javascript +// Hack to translate text "none" in PHP to javascript. echo ''; ui_require_jquery_file('form'); @@ -270,42 +287,40 @@ $(document).ready (function () { var get_parameters_count = window.location.href.slice( window.location.href.indexOf('?') + 1).split('&').length; var post_parameters_count = $("#form_alerts").serializeArray().length; - + var count_parameters = get_parameters_count + post_parameters_count; - + if (count_parameters > limit_parameters_massive) { alert(""); return false; } }); - - + $("#checkbox-recursion").click(function () { $("#id_group").trigger("change"); }); - + $("#id_agents").change(agent_changed_by_multiple_agents); - + $("#id_group").change (function () { var $select = $("#id_agents").enable (); $("#agent_loading").show (); $("option", $select).remove (); - + jQuery.post ("ajax.php", {"page" : "godmode/massive/massive_add_alerts", "get_agents" : 1, "id_group" : this.value, "recursion" : $("#checkbox-recursion").is(":checked") ? 1 : 0, - // Add a key prefix to avoid auto sorting in js object conversion + // Add a key prefix to avoid auto sorting in js object conversion. "keys_prefix" : "_" }, function (data, status) { options = ""; jQuery.each (data, function (id, value) { - // Remove keys_prefix from the index + // Remove keys_prefix from the index. id = id.substring(1); - options += ""; }); $("#id_agents").append (options); @@ -315,40 +330,39 @@ $(document).ready (function () { "json" ); }); - + $("#id_group").value = "0"; - + $("#id_group").click ( function () { $(this).css ("width", "auto"); }); - + $("#id_group").blur (function () { $(this).css ("width", "180px"); }); - + $("#id_agents").click ( function () { $(this).css ("width", "auto"); }); - + $("#id_agents").blur (function () { $(this).css ("width", "180px"); }); - + $("#module").click ( function () { $(this).css ("width", "auto"); }); - + $("#module").blur (function () { $(this).css ("width", "180px"); }); - + $("#modules_selection_mode").change (function() { $("#id_agents").trigger('change'); }); - }); /* ]]> */ diff --git a/pandora_console/godmode/servers/manage_recontask.php b/pandora_console/godmode/servers/manage_recontask.php index a76571d54a..00ac75d1da 100644 --- a/pandora_console/godmode/servers/manage_recontask.php +++ b/pandora_console/godmode/servers/manage_recontask.php @@ -1,17 +1,32 @@ $disabled], ['id_rt' => $id]); + $result = db_process_sql_update( + 'trecon_task', + ['disabled' => $disabled], + ['id_rt' => $id] + ); if ($result !== false) { ui_print_success_message(__('Successfully updated recon task')); - // If the action is enabled, we force recon_task to be queued asap + // If the action is enabled, we force recon_task to be queued asap. if ($disabled == 0) { servers_force_recon_task($id); } @@ -73,9 +98,9 @@ if (isset($_GET['delete'])) { } // -------------------------------- -// GET PARAMETERS IF UPDATE OR CREATE +// GET PARAMETERS IF UPDATE OR CREATE. // -------------------------------- -if ((isset($_GET['update'])) or ((isset($_GET['create'])))) { +if ((isset($_GET['update'])) || ((isset($_GET['create'])))) { $name = get_parameter_post('name'); $network = get_parameter_post('network'); $description = get_parameter_post('description'); @@ -115,14 +140,16 @@ if ((isset($_GET['update'])) or ((isset($_GET['create'])))) { $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 + // Get macros. $macros = (string) get_parameter('macros'); if (!empty($macros)) { $macros = json_decode(base64_decode($macros), true); - foreach ($macros as $k => $m) { - $macros[$k]['value'] = get_parameter($m['macro'], ''); + if (isset($macros) === true && is_array($macros) === true) { + foreach ($macros as $k => $m) { + $macros[$k]['value'] = get_parameter($m['macro'], ''); + } } } @@ -130,7 +157,7 @@ if ((isset($_GET['update'])) or ((isset($_GET['create'])))) { } // -------------------------------- -// UPDATE A RECON TASK +// UPDATE A RECON TASK. // -------------------------------- if (isset($_GET['update'])) { $id = get_parameter_get('update'); @@ -193,10 +220,18 @@ if (isset($_GET['update'])) { $reason = __('Wrong format in Subnet field'); $result = false; } else { - $result = db_process_sql_update('trecon_task', $values, $where); + $result = db_process_sql_update( + 'trecon_task', + $values, + $where + ); } } else { - $result = db_process_sql_update('trecon_task', $values, $where); + $result = db_process_sql_update( + 'trecon_task', + $values, + $where + ); } } else { $result = false; @@ -314,9 +349,9 @@ if (isset($_GET['create'])) { } // -------------------------------- -// SHOW TABLE WITH ALL RECON TASKs +// SHOW TABLE WITH ALL RECON TASKs. // -------------------------------- -// Pandora Admin must see all columns +// Pandora Admin must see all columns. if (! check_acl($config['id_user'], 0, 'PM')) { $sql = sprintf( 'SELECT * @@ -377,26 +412,26 @@ if ($result !== false) { if ($row['id_recon_script'] == 0) { - // Network recon task + // Network recon task. $data[2] = html_print_image('images/network.png', true, ['title' => __('Network recon task')]).'  '; $data[2] .= network_profiles_get_name($row['id_network_profile']); $mode_name = ''; } else { - // APP recon task + // APP recon task. $data[2] = html_print_image('images/plugin.png', true).'  '; $mode_name = db_get_sql(sprintf('SELECT name FROM trecon_script WHERE id_recon_script = %d', $row['id_recon_script'])); $data[2] .= $mode_name; } - // GROUP + // GROUP. if ($row['id_recon_script'] == 0) { $data[3] = ui_print_group_icon($row['id_group'], true); } else { $data[3] = '-'; } - // SNMP VERSION + // SNMP VERSION. if ($row['snmp_version'] == '1') { $data[4] = 'v. 1'; } else if ($row['snmp_version'] == '2') { @@ -409,31 +444,31 @@ if ($result !== false) { - // INCIDENT + // INCIDENT. $data[5] = (($row['create_incident'] == 1) ? __('Yes') : __('No')); - // OS + // OS. if ($row['id_recon_script'] == 0) { $data[6] = (($row['id_os'] > 0) ? ui_print_os_icon($row['id_os'], false, true) : __('Any')); } else { $data[6] = '-'; } - // INTERVAL + // INTERVAL. if ($row['interval_sweep'] == 0) { $data[7] = __('Manual'); } else { $data[7] = human_time_description_raw($row['interval_sweep']); } - // PORTS + // PORTS. if ($row['id_recon_script'] == 0) { $data[8] = substr($row['recon_ports'], 0, 15); } else { $data[8] = '-'; } - // ACTION + // ACTION. $task_group = $row['id_group']; if (in_array($task_group, $user_groups_w)) { diff --git a/pandora_console/godmode/servers/manage_recontask_form.php b/pandora_console/godmode/servers/manage_recontask_form.php index c47416afd7..37947900b4 100644 --- a/pandora_console/godmode/servers/manage_recontask_form.php +++ b/pandora_console/godmode/servers/manage_recontask_form.php @@ -1,17 +1,32 @@ rowclass[14] = 'recon_script'; $table->rowclass[15] = 'recon_script'; $table->rowclass[16] = 'recon_script'; $table->rowclass[17] = 'recon_script'; -// Name +// Name. $table->data[0][0] = ''.__('Task name').''; $table->data[0][1] = html_print_input_text('name', $name, '', 25, 0, true); -// Recon server +// Recon server. $table->data[1][0] = ''.__('Recon server').ui_print_help_tip( __('You must select a Recon Server for the Task, otherwise the Recon Task will never run'), true @@ -258,7 +301,15 @@ $sql = 'SELECT id_server, name FROM tserver WHERE server_type = 3 ORDER BY name'; -$table->data[1][1] = html_print_select_from_sql($sql, 'id_recon_server', $id_recon_server, '', '', '', true); +$table->data[1][1] = html_print_select_from_sql( + $sql, + 'id_recon_server', + $id_recon_server, + '', + '', + '', + true +); $fields['network_sweep'] = __('Network sweep'); if (!$is_windows) { @@ -267,44 +318,94 @@ if (!$is_windows) { $table->data[2][0] = ''.__('Mode').''; -$table->data[2][1] = html_print_select($fields, 'mode', $mode, '', '', 0, true); +$table->data[2][1] = html_print_select( + $fields, + 'mode', + $mode, + '', + '', + 0, + true +); -// Network +// Network. $table->data[3][0] = ''.__('Network').''; -$table->data[3][0] .= ui_print_help_tip(__('You can specify several networks, separated by commas, for example: 192.168.50.0/24,192.168.60.0/24'), true); -$table->data[3][1] = html_print_input_text('network', $network, '', 25, 0, true); +$table->data[3][0] .= ui_print_help_tip( + __('You can specify several networks, separated by commas, for example: 192.168.50.0/24,192.168.60.0/24'), + true +); +$table->data[3][1] = html_print_input_text( + 'network', + $network, + '', + 25, + 0, + true +); -// Interval +// Interval. $interv_manual = 0; if ((int) $interval == 0) { $interv_manual = 1; } $table->data[4][0] = ''.__('Interval'); -$table->data[4][0] .= ui_print_help_tip(__('Manual interval means that it will be executed only On-demand'), true); +$table->data[4][0] .= ui_print_help_tip( + __('Manual interval means that it will be executed only On-demand'), + true +); $values = [ 0 => __('Defined'), 1 => __('Manual'), ]; -$table->data[4][1] = html_print_select($values, 'interval_manual_defined', $interv_manual, '', '', '', true); +$table->data[4][1] = html_print_select( + $values, + 'interval_manual_defined', + $interv_manual, + '', + '', + '', + true +); $table->data[4][1] .= ''; -$table->data[4][1] .= html_print_extended_select_for_time('interval', $interval, '', '', '0', false, true, false, false); -$table->data[4][1] .= ui_print_help_tip(__('The minimum recomended interval for Recon Task is 5 minutes'), true); +$table->data[4][1] .= html_print_extended_select_for_time( + 'interval', + $interval, + '', + '', + '0', + false, + true, + false, + false +); +$table->data[4][1] .= ui_print_help_tip( + __('The minimum recomended interval for Recon Task is 5 minutes'), + true +); $table->data[4][1] .= ''; -// Module template +// Module template. $table->data[5][0] = ''.__('Module template').''; $sql = 'SELECT id_np, name FROM tnetwork_profile ORDER BY name'; -$table->data[5][1] = html_print_select_from_sql($sql, 'id_network_profile', $id_network_profile, '', __('None'), 0, true); +$table->data[5][1] = html_print_select_from_sql( + $sql, + 'id_network_profile', + $id_network_profile, + '', + __('None'), + 0, + true +); -// Recon script +// Recon script. $data[1] = ''; $table->data[6][0] = ''.__('Recon script').''; @@ -314,35 +415,72 @@ $sql = "SELECT id_recon_script, name WHERE name <> 'IPAM Recon' ORDER BY name"; if ($name_script != 'IPAM Recon') { - $table->data[6][1] = html_print_select_from_sql($sql, 'id_recon_script', $id_recon_script, '', '', '', true); + $table->data[6][1] = html_print_select_from_sql( + $sql, + 'id_recon_script', + $id_recon_script, + '', + '', + '', + true + ); $table->data[6][1] .= "'; - $table->data[6][1] .= $data[1] .= html_print_input_hidden('macros', base64_encode($macros), true); + $table->data[6][1] .= $data[1] .= html_print_input_hidden( + 'macros', + base64_encode($macros), + true + ); } else { $table->data[6][1] = 'IPAM Recon'; } -// OS +// OS. $table->data[7][0] = ''.__('OS').''; $sql = 'SELECT id_os, name FROM tconfig_os ORDER BY name'; -$table->data[7][1] = html_print_select_from_sql($sql, 'id_os', $id_os, '', __('Any'), -1, true); +$table->data[7][1] = html_print_select_from_sql( + $sql, + 'id_os', + $id_os, + '', + __('Any'), + -1, + true +); -// Recon ports +// Recon ports. $table->data[8][0] = ''.__('Ports').''; -$table->data[8][1] = html_print_input_text('recon_ports', $recon_ports, '', 25, 0, true); +$table->data[8][1] = html_print_input_text( + 'recon_ports', + $recon_ports, + '', + 25, + 0, + true +); $table->data[8][1] .= ui_print_help_tip( __('Ports defined like: 80 or 80,443,512 or even 0-1024 (Like Nmap command line format). If dont want to do a sweep using portscan, left it in blank'), true ); -// Group +// Group. $table->data[9][0] = ''.__('Group'); $groups = users_get_groups(false, 'PM', false); -$table->data[9][1] = html_print_select_groups(false, 'PM', false, 'id_group', $id_group, '', '', 0, true); +$table->data[9][1] = html_print_select_groups( + false, + 'PM', + false, + 'id_group', + $id_group, + '', + '', + 0, + true +); -// Incident +// Incident. $values = [ 0 => __('No'), 1 => __('Yes'), @@ -356,24 +494,50 @@ $table->data[10][1] = html_print_select( '', '', true -).' '.ui_print_help_tip(__('Choose if the discovery of a new system creates an incident or not.'), true); +).' '.ui_print_help_tip( + __('Choose if the discovery of a new system creates an incident or not.'), + true +); -// snmp_enabled +// Snmp_enabled. $table->data[11][0] = ''.__('SNMP enabled'); -$table->data[11][1] = html_print_checkbox('snmp_enabled', 1, $snmp_enabled, true); +$table->data[11][1] = html_print_checkbox( + 'snmp_enabled', + 1, + $snmp_enabled, + true +); -// SNMP default community +// SNMP default community. $table->data[12][0] = ''.__('SNMP Default community'); -$table->data[12][0] .= ui_print_help_tip(__('You can specify several values, separated by commas, for example: public,mysecret,1234'), true); -$table->data[12][1] = html_print_input_text('snmp_community', $snmp_community, '', 35, 0, true); +$table->data[12][0] .= ui_print_help_tip( + __('You can specify several values, separated by commas, for example: public,mysecret,1234'), + true +); +$table->data[12][1] = html_print_input_text( + 'snmp_community', + $snmp_community, + '', + 35, + 0, + true +); -// SNMP version +// SNMP version. $snmp_versions['1'] = 'v. 1'; $snmp_versions['2'] = 'v. 2'; $snmp_versions['2c'] = 'v. 2c'; $snmp_versions['3'] = 'v. 3'; $table->data[24][0] = ''._('SNMP version'); -$table->data[24][1] = html_print_select($snmp_versions, 'snmp_version', $snmp_version, '', '', 0, true); +$table->data[24][1] = html_print_select( + $snmp_versions, + 'snmp_version', + $snmp_version, + '', + '', + 0, + true +); $table->data[25][0] = ''.__('Auth user'); $table->data[25][1] = html_print_input_text( @@ -400,10 +564,30 @@ $table->data[26][1] = html_print_input_password( false, '' ); -$table->data[26][1] .= html_print_input_hidden_extended('active_snmp_v3', 0, 'active_snmp_v3_mmen', true); +$table->data[26][1] .= html_print_input_hidden_extended( + 'active_snmp_v3', + 0, + 'active_snmp_v3_mmen', + true +); $table->data[27][0] = ''.__('Privacy method'); -$table->data[27][1] = html_print_select(['DES' => __('DES'), 'AES' => __('AES')], 'snmp_privacy_method', $snmp3_privacy_method, '', '', '', true, false, false, '', ''); +$table->data[27][1] = html_print_select( + [ + 'DES' => __('DES'), + 'AES' => __('AES'), + ], + 'snmp_privacy_method', + $snmp3_privacy_method, + '', + '', + '', + true, + false, + false, + '', + '' +); $table->data[28][0] = ''.__('Privacy pass').ui_print_help_tip(__('The pass length must be eight character minimum.'), true); $table->data[28][1] = html_print_input_password( 'snmp_privacy_pass', @@ -417,7 +601,22 @@ $table->data[28][1] = html_print_input_password( '' ); $table->data[29][0] = ''.__('Auth method'); -$table->data[29][1] = html_print_select(['MD5' => __('MD5'), 'SHA' => __('SHA')], 'snmp_auth_method', $snmp3_auth_method, '', '', '', true, false, false, '', ''); +$table->data[29][1] = html_print_select( + [ + 'MD5' => __('MD5'), + 'SHA' => __('SHA'), + ], + 'snmp_auth_method', + $snmp3_auth_method, + '', + '', + '', + true, + false, + false, + '', + '' +); $table->data[30][0] = ''.__('Security level'); $table->data[30][1] = html_print_select( [ @@ -437,75 +636,139 @@ $table->data[30][1] = html_print_select( '' ); -// Explanation -$explanation = db_get_value('description', 'trecon_script', 'id_recon_script', $id_recon_script); +// Explanation. +$explanation = db_get_value( + 'description', + 'trecon_script', + 'id_recon_script', + $id_recon_script +); $table->data[13][0] = ''.__('Explanation').''; $table->data[13][1] = "'.html_print_textarea('explanation', 4, 60, $explanation, 'style="width: 388px;"', true); -// A hidden "model row" to clone it from javascript to add fields dynamicaly +// A hidden "model row" to clone it from javascript to add fields dynamicaly. $data = []; $data[0] = 'macro_desc'; $data[0] .= ui_print_help_tip('macro_help', true); -$data[1] = html_print_input_text('macro_name', 'macro_value', '', 100, 255, true); +$data[1] = html_print_input_text( + 'macro_name', + 'macro_value', + '', + 100, + 255, + true +); $table->colspan['macro_field'][1] = 3; $table->rowstyle['macro_field'] = 'display:none'; $table->data['macro_field'] = $data; -// If there are $macros, we create the form fields +// If there are $macros, we create the form fields. if (!empty($macros)) { $macros = json_decode($macros, true); - foreach ($macros as $k => $m) { - $data = []; - $data[0] = ''.$m['desc'].''; - if (!empty($m['help'])) { - $data[0] .= ui_print_help_tip($m['help'], true); + if (isset($macros) === true + && is_array($macros) === true + ) { + foreach ($macros as $k => $m) { + $data = []; + $data[0] = ''.$m['desc'].''; + if (!empty($m['help'])) { + $data[0] .= ui_print_help_tip($m['help'], true); + } + + if ($m['hide']) { + $data[1] = html_print_input_password( + $m['macro'], + $m['value'], + '', + 100, + 255, + true + ); + } else { + $data[1] = html_print_input_text( + $m['macro'], + $m['value'], + '', + 100, + 255, + true + ); + } + + $table->colspan['macro'.$m['macro']][1] = 3; + $table->rowclass['macro'.$m['macro']] = 'macro_field'; + + $table->data['macro'.$m['macro']] = $data; } - - if ($m['hide']) { - $data[1] = html_print_input_password($m['macro'], $m['value'], '', 100, 255, true); - } else { - $data[1] = html_print_input_text($m['macro'], $m['value'], '', 100, 255, true); - } - - $table->colspan['macro'.$m['macro']][1] = 3; - $table->rowclass['macro'.$m['macro']] = 'macro_field'; - - $table->data['macro'.$m['macro']] = $data; } } -// Comments +// Comments. $table->data[18][0] = ''.__('Comments'); -$table->data[18][1] = html_print_input_text('description', $description, '', 45, 0, true); +$table->data[18][1] = html_print_input_text( + 'description', + $description, + '', + 45, + 0, + true +); -// OS detection +// OS detection. $table->data[19][0] = ''.__('OS detection'); -$table->data[19][1] = html_print_checkbox('os_detect', 1, $os_detect, true); +$table->data[19][1] = html_print_checkbox( + 'os_detect', + 1, + $os_detect, + true +); -// Name resolution +// Name resolution. $table->data[20][0] = ''.__('Name resolution'); -$table->data[20][1] = html_print_checkbox('resolve_names', 1, $resolve_names, true); +$table->data[20][1] = html_print_checkbox( + 'resolve_names', + 1, + $resolve_names, + true +); -// Parent detection +// Parent detection. $table->data[21][0] = ''.__('Parent detection'); -$table->data[21][1] = html_print_checkbox('parent_detection', 1, $parent_detection, true); +$table->data[21][1] = html_print_checkbox( + 'parent_detection', + 1, + $parent_detection, + true +); -// Parent recursion +// Parent recursion. $table->data[22][0] = ''.__('Parent recursion'); -$table->data[22][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); +$table->data[22][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 +); -// vlan_enabled +// Vlan_enabled. $table->data[23][0] = ''.__('Vlan enabled'); -$table->data[23][1] = html_print_checkbox('vlan_enabled', 1, $vlan_enabled, true); +$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. -// $table->data[22][0] = "".__('Alias as Name'); -// $table->data[22][1] = html_print_checkbox ('alias_as_name', 1, $alias_as_name, true); -// Different Form url if it's a create or if it's a update form +// Different Form url if it's a create or if it's a update form. echo '
'; html_print_table($table); echo '
'; @@ -529,23 +792,23 @@ ui_require_javascript_file('pandora_modules'); \ No newline at end of file + From de7c1ce978f508e071aad2923b6dbe7358dfd98b Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Tue, 26 Feb 2019 09:40:04 +0100 Subject: [PATCH 05/50] Fixed ACL selection menu wrong sec for visual console Former-commit-id: dd9f4a212f43774c2602932baa0c1a83e3ba6e56 --- pandora_console/include/functions_menu.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 39e5adf455..7012094570 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -510,8 +510,6 @@ function menu_add_extras(&$menu) $menu_extra['workspace']['sub']['operation/incidents/incident_detail']['text'] = __('Manage incident'); - $menu_extra['reporting']['sub']['godmode/reporting/visual_console_builder']['text'] = __('Manage visual console'); - // Duplicate extensions as sec=extension to check it from url foreach ($menu as $k => $m) { if (!isset($m['sub'])) { @@ -649,6 +647,7 @@ function menu_get_sec_pages($sec, $menu_hash=false) /** * Get the pages in a section2 + * $menu * * @param string sec code * @param string menu hash. All the menu structure (For example From 95b5c4ad0172e75dd9376a71b9e0e37a80b8b66c Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 28 Feb 2019 12:30:01 +0100 Subject: [PATCH 06/50] add new macro for alert events Former-commit-id: 08c5bf0168bcd5d9c23a23443187870269d61a40 --- pandora_console/include/help/en/help_alert_config.php | 1 + pandora_console/include/help/en/help_alert_macros.php | 1 + pandora_console/include/help/es/help_alert_config.php | 1 + pandora_console/include/help/es/help_alert_macros.php | 1 + pandora_console/include/help/ja/help_alert_config.php | 1 + pandora_console/include/help/ja/help_alert_macros.php | 1 + 6 files changed, 6 insertions(+) diff --git a/pandora_console/include/help/en/help_alert_config.php b/pandora_console/include/help/en/help_alert_config.php index c210a3164e..a78e468107 100644 --- a/pandora_console/include/help/en/help_alert_config.php +++ b/pandora_console/include/help/en/help_alert_config.php @@ -52,6 +52,7 @@ Apart from the defined module macros, the following macros are also available:
  • _event_extra_id_ : (Only event alerts) Extra id.
  • _event_id_: (Only event alerts) ID of the event that triggered the alert.
  • _event_text_severity_: (Only event alerts) Event text severity (Maintenance, Informational, Normal Minor, Warning, Major, Critical).
  • +
  • _eventTimestamp_: Timestamp in which the event was created.
  • _field1_: User defined field 1.
  • _field2_: User defined field 2.
  • _field3_: User defined field 3.
  • diff --git a/pandora_console/include/help/en/help_alert_macros.php b/pandora_console/include/help/en/help_alert_macros.php index 16ee3a91dd..9d730cfcc9 100644 --- a/pandora_console/include/help/en/help_alert_macros.php +++ b/pandora_console/include/help/en/help_alert_macros.php @@ -37,6 +37,7 @@ Besides the defined module macros, the following macros are available:
  • _event_extra_id_: (Only event alerts) Extra id.
  • _event_id_: (Only event alerts) ID of the event that triggered the alert.
  • _event_text_severity_: (Only event alerts) Event text severity (Maintenance, Informational, Normal Minor, Warning, Major, Critical).
  • +
  • _eventTimestamp_: Timestamp in which the event was created.
  • _field1_: User defined field 1.
  • _field2_: User defined field 2.
  • _field3_: User defined field 3.
  • diff --git a/pandora_console/include/help/es/help_alert_config.php b/pandora_console/include/help/es/help_alert_config.php index 3c6d0b8e53..ec219d87ca 100644 --- a/pandora_console/include/help/es/help_alert_config.php +++ b/pandora_console/include/help/es/help_alert_config.php @@ -54,6 +54,7 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
  • _event_extra_id_ : (Solo alertas de evento) Id extra.
  • _event_id_: (Solo alertas de evento) Id del evento que disparó la alerta.
  • _event_text_severity_: (Solo alertas de evento) Prioridad en texto de el evento que dispara la alerta (Maintenance, Informational, Normal Minor, Warning, Major, Critical).
  • +
  • _eventTimestamp_: Timestamp en el que se creo el evento.
  • _field1_: Campo 1 definido por el usuario.
  • _field2_: Campo 2 definido por el usuario.
  • _field3_: Campo 3 definido por el usuario.
  • diff --git a/pandora_console/include/help/es/help_alert_macros.php b/pandora_console/include/help/es/help_alert_macros.php index de420b31c7..75e627f19a 100644 --- a/pandora_console/include/help/es/help_alert_macros.php +++ b/pandora_console/include/help/es/help_alert_macros.php @@ -37,6 +37,7 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
  • _event_extra_id_ : (Solo alertas de evento) Id extra.
  • _event_id_: (Solo alertas de evento) Id del evento que disparó la alerta.
  • _event_text_severity_:(Solo alertas de evento) Prioridad en texto de el evento que dispara la alerta (Maintenance, Informational, Normal Minor, Warning, Major, Critical).
  • +
  • _eventTimestamp_: Timestamp en el que se creo el evento.
  • _field1_: Campo 1 definido por el usuario.
  • _field2_: Campo 2 definido por el usuario.
  • _field3_: Campo 3 definido por el usuario.
  • diff --git a/pandora_console/include/help/ja/help_alert_config.php b/pandora_console/include/help/ja/help_alert_config.php index 21e12b1baf..b606b1571f 100644 --- a/pandora_console/include/help/ja/help_alert_config.php +++ b/pandora_console/include/help/ja/help_alert_config.php @@ -53,6 +53,7 @@ email アクションを設定するには、_field1_ (送信先アドレス)、
  • _event_extra_id_: (イベントアラートのみ) 拡張 ID
  • _event_id_ : (イベントアラートのみ) アラート発生元のイベントID
  • _event_text_severity_ : (イベントアラートのみ) イベント(アラートの発生元)のテキストでの重要度 (Maintenance, Informational, Normal Minor, Warning, Major, Critical)
  • +
  • _eventTimestamp_: Timestamp in which the event was created.
  • _field1_ : ユーザ定義フィールド1
  • _field2_ : ユーザ定義フィールド2
  • _field3_ : ユーザ定義フィールド3
  • diff --git a/pandora_console/include/help/ja/help_alert_macros.php b/pandora_console/include/help/ja/help_alert_macros.php index 73ca00126e..36ff609741 100644 --- a/pandora_console/include/help/ja/help_alert_macros.php +++ b/pandora_console/include/help/ja/help_alert_macros.php @@ -37,6 +37,7 @@
  • _event_extra_id_: (Only event alerts) Extra id.
  • _event_id_ : (イベントアラートのみ) アラート発生元のイベントID
  • _event_text_severity_ : (イベントアラートのみ) イベント(アラートの発生元)のテキストでの重要度 (Maintenance, Informational, Normal Minor, Warning, Major, Critical)
  • +
  • _eventTimestamp_: Timestamp in which the event was created.
  • _field1_ : ユーザ定義フィールド1
  • _field2_ : ユーザ定義フィールド2
  • _field3_ : ユーザ定義フィールド3
  • From fb40ef7ce4190814f473222cd39d17e6445d675a Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 28 Feb 2019 17:12:31 +0100 Subject: [PATCH 07/50] Changed Maintainer in pandorafms-agent-unix Former-commit-id: c0bff759d2926ec1459e66205b3918ec3d02d3f4 --- pandora_agents/pc/DEBIAN/control | 6 +++--- pandora_agents/shellscript/linux/DEBIAN/control | 4 ++-- pandora_agents/unix/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_server/DEBIAN/control | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pandora_agents/pc/DEBIAN/control b/pandora_agents/pc/DEBIAN/control index af1e09fc24..cdbcc99cfe 100644 --- a/pandora_agents/pc/DEBIAN/control +++ b/pandora_agents/pc/DEBIAN/control @@ -1,10 +1,10 @@ package: pandorafms-agent-unix -Version: 4.0.1 +Version: 7.0 Architecture: all Priority: optional Section: admin Installed-Size: 260 -Maintainer: Miguel de Dios -Homepage: http://pandorafms.org/ +Maintainer: ÁRTICA ST +Homepage: https://pandorafms.org/ Depends: coreutils, perl, unzip Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. It’s possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file. diff --git a/pandora_agents/shellscript/linux/DEBIAN/control b/pandora_agents/shellscript/linux/DEBIAN/control index d17817f5b8..55a5168f93 100755 --- a/pandora_agents/shellscript/linux/DEBIAN/control +++ b/pandora_agents/shellscript/linux/DEBIAN/control @@ -1,10 +1,10 @@ package: pandorafms-agent -Version: 4.0 +Version: 7.0 Architecture: all Priority: optional Section: admin Installed-Size: 260 -Maintainer: Miguel de Dios +Maintainer: ÁRTICA ST Homepage: http://pandorafms.org/ Depends: coreutils, perl Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. It’s possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file. diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 13323ebd9e..7f6ab99071 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -4,7 +4,7 @@ Architecture: all Priority: optional Section: admin Installed-Size: 260 -Maintainer: Miguel de Dios +Maintainer: ÁRTICA ST Homepage: http://pandorafms.org/ Depends: coreutils, perl, unzip Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. It’s possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file. diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 9902501164..c62e0945f2 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -149,7 +149,7 @@ if [ $package_pear -eq 1 ] then echo "Make the package \"php-xml-rpc\"." cd temp_package - dh-make-pear --maintainer "Miguel de Dios " XML_RPC + dh-make-pear --maintainer "ÁRTICA ST " XML_RPC cd php-xml-rpc-* dpkg-buildpackage -rfakeroot cd .. diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 4f78a1c055..c8259b54b9 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -4,7 +4,7 @@ Architecture: all Priority: optional Section: admin Installed-Size: 640 -Maintainer: Miguel de Dios +Maintainer: ÁRTICA ST Homepage: http://pandorafms.org/ Depends: perl (>= 5.8), libdbi-perl, libdbd-mysql-perl, libtime-format-perl, libnetaddr-ip-perl, libtime-format-perl, libxml-simple-perl, libxml-twig-perl, libhtml-parser-perl, snmp, snmpd, traceroute, xprobe2, nmap, sudo, libwww-perl, libsocket6-perl, libio-socket-inet6-perl, snmp-mibs-downloader, libjson-perl, libnet-telnet-perl, libencode-locale-perl, libgeo-ip-perl Description: Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments. This is the server package. Server makes the remote checks and process information transfer by Pandora FMS agents to the server. From 488be0d602a858eff96dbe6382fcbe7510fd12af Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 4 Mar 2019 13:12:01 +0100 Subject: [PATCH 08/50] Changed radio buttons by checkbox switch Former-commit-id: f0c64cecbf9e1197be08a9a95248d3b4ea8bd949 --- pandora_console/godmode/setup/setup_auth.php | 1 - .../godmode/setup/setup_ehorus.php | 36 ++++++++++-------- .../godmode/setup/setup_general.php | 36 ++++++++++-------- .../godmode/setup/setup_netflow.php | 37 +++++++++++-------- .../godmode/setup/setup_visuals.php | 8 ++-- 5 files changed, 65 insertions(+), 53 deletions(-) diff --git a/pandora_console/godmode/setup/setup_auth.php b/pandora_console/godmode/setup/setup_auth.php index cdb75816cc..ac9f706e41 100644 --- a/pandora_console/godmode/setup/setup_auth.php +++ b/pandora_console/godmode/setup/setup_auth.php @@ -134,7 +134,6 @@ if (is_ajax()) { set_unless_defined($config['double_auth_enabled'], false); $row = []; $row['name'] = __('Double authentication').ui_print_help_tip(__('If this option is enabled, the users can use double authentication with their accounts'), true); - $row['control'] = html_print_input_hidden('double_auth_enabled', 0); $row['control'] .= html_print_checkbox_switch('double_auth_enabled', 1, $config['double_auth_enabled'], true); $table->data['double_auth_enabled'] = $row; diff --git a/pandora_console/godmode/setup/setup_ehorus.php b/pandora_console/godmode/setup/setup_ehorus.php index f51854a63c..0274767cff 100644 --- a/pandora_console/godmode/setup/setup_ehorus.php +++ b/pandora_console/godmode/setup/setup_ehorus.php @@ -1,18 +1,23 @@ style['name'] = 'font-weight: bold'; // Enable eHorus $row = []; $row['name'] = __('Enable eHorus'); -$row['control'] = __('Enabled').' '.html_print_radio_button('ehorus_enabled', 1, '', $config['ehorus_enabled'], true).'  '; -$row['control'] .= __('Disabled').' '.html_print_radio_button('ehorus_enabled', 0, '', $config['ehorus_enabled'], true); +$row['control'] = html_print_checkbox_switch('ehorus_enabled', false, $config['ehorus_enabled'], true); $row['button'] = html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"', true); $table_enable->data['ehorus_enabled'] = $row; @@ -169,7 +173,7 @@ if ($config['ehorus_enabled']) { if (event.target.value == '1') showFields(); else hideFields(); } - $('input:radio[name="ehorus_enabled"]').change(handleEnable); + $('input:checkbox[name="ehorus_enabled"]').change(handleEnable); var handleTest = function (event) { var user = $('input#text-ehorus_user').val(); diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 8f07d3d88d..370df5d808 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -1,17 +1,23 @@ data[37][0] = __('Audit log directory').ui_print_help_tip(__('Directory $table->data[37][1] = html_print_input_text('auditdir', io_safe_output($config['auditdir']), '', 30, 100, true); $table->data[38][0] = __('Set alias as name by default in agent creation'); -$table->data[38][1] = __('Yes').'   '.html_print_radio_button('alias_as_name', 1, '', $config['alias_as_name'], true).'  '; -$table->data[38][1] .= __('No').'   '.html_print_radio_button('alias_as_name', 0, '', $config['alias_as_name'], true); +$table->data[38][1] = html_print_checkbox_switch('alias_as_name', 1, $config['alias_as_name'], true); $table->data[39][0] = __('Unique IP').ui_print_help_tip(__('Set the primary IP address as the unique IP, preventing the same primary IP address from being used in more than one agent'), true); -$table->data[39][1] = __('Yes').'   '.html_print_radio_button('unique_ip', 1, '', $config['unique_ip'], true).'  '; -$table->data[39][1] .= __('No').'   '.html_print_radio_button('unique_ip', 0, '', $config['unique_ip'], true); +$table->data[39][1] = html_print_checkbox_switch('unique_ip', 1, $config['unique_ip'], true); echo ''; diff --git a/pandora_console/godmode/setup/setup_netflow.php b/pandora_console/godmode/setup/setup_netflow.php index 1b62a23810..0b2cddbc25 100644 --- a/pandora_console/godmode/setup/setup_netflow.php +++ b/pandora_console/godmode/setup/setup_netflow.php @@ -1,16 +1,23 @@ data[5][0] = ''.__('Maximum chart resolution').''.ui_print_help_t $table->data[5][1] = html_print_input_text('netflow_max_resolution', $config['netflow_max_resolution'], false, 50, 200, true); $table->data[6][0] = ''.__('Disable custom live view filters').''.ui_print_help_tip(__('Disable the definition of custom filters in the live view. Only existing filters can be used.'), true); -$table->data[6][1] = __('Yes').'  '.html_print_radio_button('netflow_disable_custom_lvfilters', 1, '', $config['netflow_disable_custom_lvfilters'], true).'   '; -$table->data[6][1] .= __('No').'  '.html_print_radio_button('netflow_disable_custom_lvfilters', 0, '', $config['netflow_disable_custom_lvfilters'], true); +$table->data[6][1] = html_print_checkbox_switch('netflow_disable_custom_lvfilters', 1, $config['netflow_disable_custom_lvfilters'], true); $table->data[7][0] = ''.__('Netflow max lifetime').''.ui_print_help_tip(__('Sets the maximum lifetime for netflow data in days.'), true); $table->data[7][1] = html_print_input_text('netflow_max_lifetime', $config['netflow_max_lifetime'], false, 50, 200, true); $table->data[8][0] = ''.__('Name resolution for IP address').''.ui_print_help_tip(__('Resolve the IP addresses to get their hostnames.'), true); $onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;"; -$table->data[8][1] = __('Yes').'  '.html_print_radio_button_extended('netflow_get_ip_hostname', 1, '', $config['netflow_get_ip_hostname'], false, $onclick, '', true).'   '; -$table->data[8][1] .= __('No').'  '.html_print_radio_button('netflow_get_ip_hostname', 0, '', $config['netflow_get_ip_hostname'], true); +$table->data[8][1] = html_print_checkbox_switch_extended('netflow_get_ip_hostname', 1, $config['netflow_get_ip_hostname'], false, $onclick, '', true); echo ''; html_print_table($table); -// Update button +// Update button. echo '
    '; html_print_input_hidden('update_config', 1); html_print_submit_button(__('Update'), 'upd_button', false, 'class="sub upd"'); diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 85047cd488..2a8cf22d8d 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -961,7 +961,7 @@ $table_other->data[$row][0] = __('Custom report front page').ui_print_help_tip( __('Custom report front page. It will be applied to all reports and templates by default.'), true ); -$table_other->data[$row][1] = html_print_checkbox( +$table_other->data[$row][1] = html_print_checkbox_switch( 'custom_report_front', 1, $config['custom_report_front'], @@ -1435,12 +1435,12 @@ $(document).ready (function () { // Juanma (06/05/2014) New feature: Custom front page for reports var custom_report = $('#checkbox-custom_report_front') .prop('checked'); - display_custom_report_front(custom_report,$('#checkbox-custom_report_front').parent().parent().parent().parent().attr('id')); + display_custom_report_front(custom_report,$('#checkbox-custom_report_front').parent().parent().parent().parent().parent().attr('id')); - $("#checkbox-custom_report_front").click( function() { + $("#checkbox-custom_report_front").change( function() { var custom_report = $('#checkbox-custom_report_front') .prop('checked'); - display_custom_report_front(custom_report,$(this).parent().parent().parent().parent().attr('id')); + display_custom_report_front(custom_report,$(this).parent().parent().parent().parent().parent().attr('id')); }); $(".databox.filters").css('margin-bottom','-10px'); }); From 9d7c6854a8ab4bf04842c9a5837ba7b3546bfd1c Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 4 Mar 2019 15:33:36 +0100 Subject: [PATCH 09/50] fixed error in snmp browser change server Former-commit-id: 0545012dd8526bdf4cc836af2d263af7b5ca5328 --- .../include/functions_snmp_browser.php | 167 ++++++++++++++---- .../javascript/pandora_snmp_browser.js | 2 + .../operation/snmpconsole/snmp_browser.php | 93 +++++++--- 3 files changed, 198 insertions(+), 64 deletions(-) diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index 4920816c89..fd68b77e54 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -1,21 +1,41 @@ '.$error_redir_dir, $output, $rc); + if ($server_to_exec != 0) { + $sql = sprintf( + 'SELECT ip_address FROM tserver WHERE id_server = %d', + $server_to_exec + ); + $server_data = db_get_row_sql($sql); + + if ($version == '3') { + $command = $snmpget_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir; + } else { + $command = $snmpget_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -On -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir; + } + + exec( + 'ssh pandora_exec_proxy@'.$server_data['ip_address'].' "'.$command.'"', + $output, + $rc + ); } else { - exec($snmpget_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -On -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir, $output, $rc); + if ($version == '3') { + exec( + $snmpget_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir, + $output, + $rc + ); + } else { + exec( + $snmpget_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -On -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir, + $output, + $rc + ); + } } if ($rc != 0) { @@ -359,7 +444,7 @@ function snmp_browser_get_oid($target_ip, $community, $target_oid, $version='2c' } foreach ($output as $line) { - // Separate the OID from the value + // Separate the OID from the value. $full_oid = explode('=', $line); if (! isset($full_oid[1])) { break; @@ -368,7 +453,7 @@ function snmp_browser_get_oid($target_ip, $community, $target_oid, $version='2c' $oid = trim($full_oid[0]); $oid_data['numeric_oid'] = $oid; - // Translate the OID + // Translate the OID. if (empty($config['snmptranslate'])) { switch (PHP_OS) { case 'FreeBSD': @@ -387,10 +472,20 @@ function snmp_browser_get_oid($target_ip, $community, $target_oid, $version='2c' $snmptranslate_bin = $config['snmptranslate']; } - exec( - $snmptranslate_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Td '.escapeshellarg($oid), - $translate_output - ); + if ($server_to_exec != 0) { + $command_output = $snmptranslate_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Td '.escapeshellarg($oid); + exec( + 'ssh pandora_exec_proxy@'.$server_data['ip_address'].' "'.$command_output.'"', + $translate_output, + $rc + ); + } else { + exec( + $snmptranslate_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Td '.escapeshellarg($oid), + $translate_output + ); + } + foreach ($translate_output as $line) { if (preg_match('/SYNTAX\s+(.*)/', $line, $matches) == 1) { $oid_data['syntax'] = $matches[1]; @@ -403,7 +498,7 @@ function snmp_browser_get_oid($target_ip, $community, $target_oid, $version='2c' } } - // Parse the description. First search for it in custom values + // Parse the description. First search for it in custom values. $custom_data = db_get_row('ttrap_custom_values', 'oid', $oid); if ($custom_data === false) { $translate_output = implode('', $translate_output); diff --git a/pandora_console/include/javascript/pandora_snmp_browser.js b/pandora_console/include/javascript/pandora_snmp_browser.js index eb4cc80f2e..ee75eac71f 100644 --- a/pandora_console/include/javascript/pandora_snmp_browser.js +++ b/pandora_console/include/javascript/pandora_snmp_browser.js @@ -164,6 +164,7 @@ function snmpGet(oid) { var snmp3_privacy_method = $("#snmp3_browser_privacy_method").val(); var snmp3_privacy_pass = $("#password-snmp3_browser_privacy_pass").val(); var ajax_url = $("#hidden-ajax_url").val(); + var server_to_exec = $("#server_to_exec").val(); // Check for a custom action var custom_action = $("#hidden-custom_action").val(); @@ -183,6 +184,7 @@ function snmpGet(oid) { "snmp3_browser_auth_pass=" + snmp3_auth_pass, "snmp3_browser_privacy_method=" + snmp3_privacy_method, "snmp3_browser_privacy_pass=" + snmp3_privacy_pass, + "server_to_exec=" + server_to_exec, "action=" + "snmpget", "custom_action=" + custom_action, "page=operation/snmpconsole/snmp_browser" diff --git a/pandora_console/operation/snmpconsole/snmp_browser.php b/pandora_console/operation/snmpconsole/snmp_browser.php index 9cc50e1fc3..bae4f9e06f 100644 --- a/pandora_console/operation/snmpconsole/snmp_browser.php +++ b/pandora_console/operation/snmpconsole/snmp_browser.php @@ -1,24 +1,39 @@ '.html_print_image('images/normal_screen.png', true, ['title' => __('Normal screen')]).''; + // Windowed. + $link['text'] = ''; + $link['text'] .= html_print_image( + 'images/normal_screen.png', + true, + ['title' => __('Normal screen')] + ); + $link['text'] .= ''; } else { - // Fullscreen - $link['text'] = ''.html_print_image('images/full_screen.png', true, ['title' => __('Full screen')]).''; + // Fullscreen. + $link['text'] = ''; + $link['text'] .= html_print_image( + 'images/full_screen.png', + true, + ['title' => __('Full screen')] + ); + $link['text'] .= ''; } -ui_print_page_header(__('SNMP Browser'), 'images/op_snmp.png', false, '', false, [$link]); +ui_print_page_header( + __('SNMP Browser'), + 'images/op_snmp.png', + false, + '', + false, + [$link] +); -// SNMP tree container +// SNMP tree container. snmp_browser_print_container(); From 18ca3a191bce2ae991dd9018ff4a8a007505c6b7 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Wed, 6 Mar 2019 16:47:56 +0100 Subject: [PATCH 10/50] ticket changed Former-commit-id: 532d461aa9ff0c956dbbe0dd931dc6f03d56498b --- .../operation/agentes/status_monitor.php | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 6e3c26b470..f32c10d890 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -63,17 +63,6 @@ $sort = get_parameter('sort', 'none'); $id_module = (int) get_parameter('id_module', 0); $ag_custom_fields = (array) get_parameter('ag_custom_fields', []); $module_option = (int) get_parameter('module_option', 1); -$autosearch = false; - -// It is validated if it receives parameters different from those it has by default -if ($ag_freestring != '' || $moduletype != '' || $datatype != '' - || $ag_modulename != '' || $refr != 0 || $offset != 0 || $status != 4 - || $modulegroup != -1 || $tag_filter != 0 || $sortField != '' - || $sort != '' || $id_module != 0 || $ag_custom_fields != null - || $module_option != 1 -) { - $autosearch = true; -} if (!is_metaconsole()) { $ag_group = (int) get_parameter('ag_group', 0); @@ -955,10 +944,23 @@ $sql = 'SELECT ORDER BY '.$order['field'].' '.$order['order'].' LIMIT '.$offset.','.$limit_sql; -// When you enter for the first time you have less than 4 query params in the url -$first_interaction = count($_GET); -// We do not show the modules until the user searches with the filter -if ($first_interaction || $autosearch) { + $automonitordetail = false; + $autovisualconsole = false; + + // It is validated if it receives parameters different from those it has by default + $defaulturl = ui_get_full_url(); +if ($defaulturl !== 'http://localhost/pandora_console/index.php?sec=view&sec2=operation/agentes/status_monitor') { + $automonitordetail = true; +} + + $urlvisual = 'http://localhost/pandora_console/index.php?sec=view&sec2=operation/agentes/status_monitor&id_module='.$id_module; + +if ($urlvisual !== $defaulturl) { + $autovisualconsole = true; +} + + // We do not show the modules until the user searches with the filter +if ($automonitordetail && $autovisualconsole) { if (! defined('METACONSOLE')) { $result = db_get_all_rows_sql($sql); From d760c7d7017e2bb6a879fd769e06d44d7a3b4ea3 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Wed, 6 Mar 2019 17:07:37 +0100 Subject: [PATCH 11/50] fix bug in functions_filemanager Former-commit-id: 93507790a70eb673a5660357acfcdf9c68279047 --- pandora_console/include/functions_filemanager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_filemanager.php b/pandora_console/include/functions_filemanager.php index fa51e3ad12..0f7e125852 100644 --- a/pandora_console/include/functions_filemanager.php +++ b/pandora_console/include/functions_filemanager.php @@ -121,9 +121,9 @@ if (!function_exists('mime_content_type')) { global $config; if (isset($config['homedir_filemanager'])) { - $homedir_filemanager = io_safe_output($config['homedir_filemanager']); + $homedir_filemanager = trim(io_safe_output($config['homedir_filemanager'])); } else { - $homedir_filemanager = $config['homedir']; + $homedir_filemanager = trim($config['homedir']); } $sec2 = get_parameter('sec2'); From e79e2a4fbc6cfca0dfdd79c060c52c10c15efb6e Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Wed, 6 Mar 2019 17:25:36 +0100 Subject: [PATCH 12/50] Finished Former-commit-id: 529f6297404b74dc41af77ae672a034530f18727 --- .../operation/agentes/status_monitor.php | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index f32c10d890..4a4114b6f8 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -63,6 +63,16 @@ $sort = get_parameter('sort', 'none'); $id_module = (int) get_parameter('id_module', 0); $ag_custom_fields = (array) get_parameter('ag_custom_fields', []); $module_option = (int) get_parameter('module_option', 1); +$autosearch = false; + +// It is validated if it receives parameters different from those it has by default +if ($ag_freestring !== '' || $moduletype !== '' || $datatype !== '' + || $ag_modulename !== '' || $refr !== 0 || $offset !== 0 || $status !== 4 + || $modulegroup !== -1 || $tag_filter !== 0 || $sortField !== '' + || $sort !== 'none' || $id_module !== 0 || $module_option !== 1 +) { + $autosearch = true; +} if (!is_metaconsole()) { $ag_group = (int) get_parameter('ag_group', 0); @@ -84,6 +94,7 @@ if ($id_module) { $status = -1; $ag_modulename = modules_get_agentmodule_name($id_module); $ag_freestring = modules_get_agentmodule_agent_alias($id_module); + $autosearch = false; } enterprise_hook('open_meta_frame'); @@ -944,23 +955,8 @@ $sql = 'SELECT ORDER BY '.$order['field'].' '.$order['order'].' LIMIT '.$offset.','.$limit_sql; - $automonitordetail = false; - $autovisualconsole = false; - - // It is validated if it receives parameters different from those it has by default - $defaulturl = ui_get_full_url(); -if ($defaulturl !== 'http://localhost/pandora_console/index.php?sec=view&sec2=operation/agentes/status_monitor') { - $automonitordetail = true; -} - - $urlvisual = 'http://localhost/pandora_console/index.php?sec=view&sec2=operation/agentes/status_monitor&id_module='.$id_module; - -if ($urlvisual !== $defaulturl) { - $autovisualconsole = true; -} - - // We do not show the modules until the user searches with the filter -if ($automonitordetail && $autovisualconsole) { +// We do not show the modules until the user searches with the filter +if ($autosearch) { if (! defined('METACONSOLE')) { $result = db_get_all_rows_sql($sql); From 2d6636bb51f7d2004c4f3f53aa486b81637eabeb Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Thu, 7 Mar 2019 10:36:06 +0100 Subject: [PATCH 13/50] Revert changes on dbmanager.php Former-commit-id: 3c9eaec695b923ea81f60d8dcfb5716af6515e37 --- pandora_console/extensions/dbmanager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/extensions/dbmanager.php b/pandora_console/extensions/dbmanager.php index c924bd3ea9..2aface6996 100644 --- a/pandora_console/extensions/dbmanager.php +++ b/pandora_console/extensions/dbmanager.php @@ -106,7 +106,7 @@ function dbmgr_extension_main() echo '

    '; echo ""; - html_print_textarea('sql', 5, 50, $sql); + html_print_textarea('sql', 5, 50, html_entity_decode($sql, ENT_QUOTES)); echo '
    '; echo '
    '; echo '
    '; From ccb669a204967d6cd72607c998eaebfe4d609bc5 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 11 Mar 2019 09:37:08 +0100 Subject: [PATCH 14/50] Fixed minor errors in setup_ehorus Former-commit-id: ed0ba17641714a87446b4db88d933d7b176e531e --- .../godmode/setup/setup_ehorus.php | 43 +++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/pandora_console/godmode/setup/setup_ehorus.php b/pandora_console/godmode/setup/setup_ehorus.php index 0274767cff..fc2ebd3d3a 100644 --- a/pandora_console/godmode/setup/setup_ehorus.php +++ b/pandora_console/godmode/setup/setup_ehorus.php @@ -28,7 +28,7 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user return; } -// Check custom field +// Check custom field. $custom_field = db_get_value('name', 'tagent_custom_fields', 'name', $config['ehorus_custom_field']); $custom_field_exists = !empty($custom_field); $custom_field_created = null; @@ -41,7 +41,7 @@ if ($config['ehorus_enabled'] && !$custom_field_exists) { $custom_field_exists = $custom_field_created = $result; } -// Enable table +// Enable table. $table_enable = new StdClass(); $table_enable->data = []; $table_enable->width = '100%'; @@ -50,14 +50,13 @@ $table_enable->class = 'databox filters'; $table_enable->size['name'] = '30%'; $table_enable->style['name'] = 'font-weight: bold'; -// Enable eHorus +// Enable eHorus. $row = []; $row['name'] = __('Enable eHorus'); -$row['control'] = html_print_checkbox_switch('ehorus_enabled', false, $config['ehorus_enabled'], true); -$row['button'] = html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"', true); +$row['control'] = html_print_checkbox_switch('ehorus_enabled', 1, $config['ehorus_enabled'], true); $table_enable->data['ehorus_enabled'] = $row; -// Remote config table +// Remote config table. $table_remote = new StdClass(); $table_remote->data = []; $table_remote->width = '100%'; @@ -67,40 +66,40 @@ $table_remote->class = 'databox filters'; $table_remote->size['name'] = '30%'; $table_remote->style['name'] = 'font-weight: bold'; -// User +// User. $row = []; $row['name'] = __('User'); $row['control'] = html_print_input_text('ehorus_user', $config['ehorus_user'], '', 30, 100, true); $table_remote->data['ehorus_user'] = $row; -// Pass +// Pass. $row = []; $row['name'] = __('Password'); $row['control'] = html_print_input_password('ehorus_pass', io_output_password($config['ehorus_pass']), '', 30, 100, true); $table_remote->data['ehorus_pass'] = $row; -// Directory hostname +// Directory hostname. $row = []; $row['name'] = __('API Hostname'); $row['control'] = html_print_input_text('ehorus_hostname', $config['ehorus_hostname'], '', 30, 100, true); $row['control'] .= ui_print_help_tip(__('Hostname of the eHorus API').'. '.__('Without protocol and port').'. '.__('e.g., portal.ehorus.com'), true); $table_remote->data['ehorus_hostname'] = $row; -// Directory port +// Directory port. $row = []; $row['name'] = __('API Port'); $row['control'] = html_print_input_text('ehorus_port', $config['ehorus_port'], '', 6, 100, true); $row['control'] .= ui_print_help_tip(__('e.g., 18080'), true); $table_remote->data['ehorus_port'] = $row; -// Request timeout +// Request timeout. $row = []; $row['name'] = __('Request timeout'); $row['control'] = html_print_input_text('ehorus_req_timeout', $config['ehorus_req_timeout'], '', 3, 10, true); $row['control'] .= ui_print_help_tip(__('Time in seconds to set the maximum time of the requests to the eHorus API').'. '.__('0 to disable'), true); $table_remote->data['ehorus_req_timeout'] = $row; -// Test +// Test. $row = []; $row['name'] = __('Test'); $row['control'] = html_print_button(__('Start'), 'test-ehorus', false, '', 'class="sub next"', true); @@ -110,7 +109,7 @@ $row['control'] .= '