From 0dea7fb6907f2cb09da492940c40947ad5394bc5 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 29 Mar 2017 12:41:42 +0200 Subject: [PATCH 001/157] Text change warn by thresholds --- pandora_console/include/ajax/module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index df85ab81e8..4daaa7529f 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -745,7 +745,7 @@ if ($list_modules) { $table->head[5] = __('Status') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectStatusUp, "alt" => "up")) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectStatusDown, "alt" => "down")) . ''; - $table->head[6] = __('Warn'); + $table->head[6] = __('Thresholds'); $table->head[7] = __('Data'); $table->head[8] = __('Graph'); $table->head[9] = __('Last contact') . ' ' . From 976fea2613d74d4f83578ce6893467e29b458422 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Wed, 12 Apr 2017 13:44:25 +0200 Subject: [PATCH 002/157] If result param is null not show bad result message when delete,disable user - #122 --- pandora_console/godmode/users/user_list.php | 23 +++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index 5db36559e0..559278f421 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -127,7 +127,7 @@ else { $disable_user = get_parameter ("disable_user", false); -if (isset ($_GET["user_del"])) { //delete user +if (isset ($_GET["user_del"]) && isset ($_GET["delete_user"])) { //delete user $id_user = get_parameter ("delete_user", 0); // Only allow delete user if is not the actual user if ($id_user != $config['id_user']) { @@ -197,16 +197,17 @@ elseif ($disable_user !== false) { //disable_user else { $result = false; } - - if ($disable_user == 1) { - ui_print_result_message ($result, - __('Successfully disabled'), - __('There was a problem disabling user')); - } - else { - ui_print_result_message ($result, - __('Successfully enabled'), - __('There was a problem enabling user')); + if($result != null){ + if ($disable_user == 1) { + ui_print_result_message ($result, + __('Successfully disabled'), + __('There was a problem disabling user')); + } + else { + ui_print_result_message ($result, + __('Successfully enabled'), + __('There was a problem enabling user')); + } } } From 8eb837803e6021f26826ac7e17a10e2004423e1c Mon Sep 17 00:00:00 2001 From: enriquecd Date: Mon, 17 Apr 2017 10:57:43 +0200 Subject: [PATCH 003/157] Add link to remote config column icons y agent view list - #124 --- pandora_console/operation/agentes/estado_agente.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 1d711398d6..11fa2c26ba 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -587,11 +587,8 @@ foreach ($agents as $agent) { if (enterprise_installed()) { enterprise_include_once('include/functions_config_agents.php'); - if (enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]))) { - - $data[9] = html_print_image("images/application_edit.png", true, array("align" => 'middle', "title" => __('Remote config'))); - + $data[9] = ''.html_print_image("images/application_edit.png", true, array("align" => 'middle', "title" => __('Remote config'))).''; } } From 01a50a76af5a3f87e5a6deb181fa9a2b239ada96 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Thu, 20 Apr 2017 19:04:22 +0200 Subject: [PATCH 004/157] Change license activation popup color text - #133 --- pandora_console/include/styles/pandora_black.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index fea5aca60b..3ea4848003 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -2837,6 +2837,14 @@ div#agent_wizard_subtabs { text-decoration: underline; } +#code_license_dialog a:hover { + color:red; +} + +#code_license_dialog *{ + color: #222222; +} + /* GRAPHS CSS */ .parent_graph { From 29ac2191b798184ebbe2388f265747f1010fb4fc Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 25 Apr 2017 15:41:01 +0200 Subject: [PATCH 005/157] Disabled modules no longer appear in the search --- pandora_console/operation/search_modules.php | 282 ++++++++++--------- 1 file changed, 142 insertions(+), 140 deletions(-) diff --git a/pandora_console/operation/search_modules.php b/pandora_console/operation/search_modules.php index dd3785f8dd..0c1962b6d2 100644 --- a/pandora_console/operation/search_modules.php +++ b/pandora_console/operation/search_modules.php @@ -73,154 +73,156 @@ else { 'nombre', 'web_content_string'); foreach ($modules as $module) { - $module["datos"] = - modules_get_last_value($module['id_agente_modulo']); - $module["module_name"] = $module['nombre']; - - //To search the monitor status - $status_sql = sprintf('SELECT estado from tagente_estado where id_agente_modulo =' . $module['id_agente_modulo']); - $status_sql = db_process_sql($status_sql); - $status_sql = $status_sql[0]; - //To search the monitor utimestamp - $utimestamp_sql = sprintf('SELECT utimestamp from tagente_estado where id_agente_modulo =' . $module['id_agente_modulo']); - $utimestamp_sql = db_process_sql($utimestamp_sql); - $utimestamp_sql = $utimestamp_sql[0]; - - - $agent = db_get_row ('tagente', 'id_agente', $module['id_agente']); - $agentCell = '' . - $agent['alias'] . ''; - - $typeCell = ui_print_moduletype_icon($module["id_tipo_modulo"], true); - - $intervalCell = modules_get_interval ($module['id_agente_modulo']); - - if ($utimestamp_sql['utimestamp'] == 0 && - ( - ($module['id_tipo_modulo'] < 21 || $module['id_tipo_modulo'] > 23) && - $module['id_tipo_modulo'] != 100) - ) { - $statusCell = ui_print_status_image(STATUS_MODULE_NO_DATA, - __('NOT INIT'), true); - } - elseif ($status_sql['estado'] == 0) { - $statusCell = ui_print_status_image(STATUS_MODULE_OK, - __('NORMAL') . ": " . modules_get_last_value($module["id_agente_modulo"]), true); - } - elseif ($status_sql['estado'] == 1) { - $statusCell = ui_print_status_image(STATUS_MODULE_CRITICAL, - __('CRITICAL') . ": " . modules_get_last_value($module["id_agente_modulo"]), true); - } - elseif ($status_sql['estado'] == 2) { - $statusCell = ui_print_status_image(STATUS_MODULE_WARNING, - __('WARNING') . ": " . modules_get_last_value($module["id_agente_modulo"]), true); - } - else { - $last_status = modules_get_agentmodule_last_status($module['id_agente_modulo']); - switch($last_status) { - case 0: - $statusCell = ui_print_status_image( - STATUS_MODULE_OK, - __('UNKNOWN') . " - " . __('Last status') . - " " . __('NORMAL') .": " . modules_get_last_value($module["id_agente_modulo"]), - true); - break; - case 1: - $statusCell = ui_print_status_image( - STATUS_MODULE_CRITICAL, - __('UNKNOWN') . " - " . __('Last status') . - " " . __('CRITICAL') . ": " . modules_get_last_value($module["id_agente_modulo"]), - true); - break; - case 2: - $statusCell = ui_print_status_image( - STATUS_MODULE_WARNING, - __('UNKNOWN') . " - " . __('Last status') . - " " . __('WARNING') . ": " . modules_get_last_value($module["id_agente_modulo"]), - true); - break; + if(!$module['disabled']){ + $module["datos"] = + modules_get_last_value($module['id_agente_modulo']); + $module["module_name"] = $module['nombre']; + + //To search the monitor status + $status_sql = sprintf('SELECT estado from tagente_estado where id_agente_modulo =' . $module['id_agente_modulo']); + $status_sql = db_process_sql($status_sql); + $status_sql = $status_sql[0]; + //To search the monitor utimestamp + $utimestamp_sql = sprintf('SELECT utimestamp from tagente_estado where id_agente_modulo =' . $module['id_agente_modulo']); + $utimestamp_sql = db_process_sql($utimestamp_sql); + $utimestamp_sql = $utimestamp_sql[0]; + + + $agent = db_get_row ('tagente', 'id_agente', $module['id_agente']); + $agentCell = '' . + $agent['alias'] . ''; + + $typeCell = ui_print_moduletype_icon($module["id_tipo_modulo"], true); + + $intervalCell = modules_get_interval ($module['id_agente_modulo']); + + if ($utimestamp_sql['utimestamp'] == 0 && + ( + ($module['id_tipo_modulo'] < 21 || $module['id_tipo_modulo'] > 23) && + $module['id_tipo_modulo'] != 100) + ) { + $statusCell = ui_print_status_image(STATUS_MODULE_NO_DATA, + __('NOT INIT'), true); + } + elseif ($status_sql['estado'] == 0) { + $statusCell = ui_print_status_image(STATUS_MODULE_OK, + __('NORMAL') . ": " . modules_get_last_value($module["id_agente_modulo"]), true); + } + elseif ($status_sql['estado'] == 1) { + $statusCell = ui_print_status_image(STATUS_MODULE_CRITICAL, + __('CRITICAL') . ": " . modules_get_last_value($module["id_agente_modulo"]), true); + } + elseif ($status_sql['estado'] == 2) { + $statusCell = ui_print_status_image(STATUS_MODULE_WARNING, + __('WARNING') . ": " . modules_get_last_value($module["id_agente_modulo"]), true); + } + else { + $last_status = modules_get_agentmodule_last_status($module['id_agente_modulo']); + switch($last_status) { + case 0: + $statusCell = ui_print_status_image( + STATUS_MODULE_OK, + __('UNKNOWN') . " - " . __('Last status') . + " " . __('NORMAL') .": " . modules_get_last_value($module["id_agente_modulo"]), + true); + break; + case 1: + $statusCell = ui_print_status_image( + STATUS_MODULE_CRITICAL, + __('UNKNOWN') . " - " . __('Last status') . + " " . __('CRITICAL') . ": " . modules_get_last_value($module["id_agente_modulo"]), + true); + break; + case 2: + $statusCell = ui_print_status_image( + STATUS_MODULE_WARNING, + __('UNKNOWN') . " - " . __('Last status') . + " " . __('WARNING') . ": " . modules_get_last_value($module["id_agente_modulo"]), + true); + break; + } } - } - - $graphCell = ""; - if ($module['history_data'] == 1) { - $graph_type = return_graphtype ($module["id_tipo_modulo"]); + $graphCell = ""; + if ($module['history_data'] == 1) { + + $graph_type = return_graphtype ($module["id_tipo_modulo"]); + + $name_module_type = modules_get_moduletype_name ($module["id_tipo_modulo"]); + $handle = "stat" . $name_module_type . "_" . $module["id_agente_modulo"]; + $url = 'include/procesos.php?agente=' . $module["id_agente_modulo"]; + $win_handle = dechex(crc32($module["id_agente_modulo"] . $module["module_name"])); + + $link ="winopeng('" . + "operation/agentes/stat_win.php?" . + "type=$graph_type&" . + "period=" . SECONDS_1DAY . "&" . + "id=" . $module["id_agente_modulo"] . "&" . + "label=" . rawurlencode( + urlencode( + base64_encode($module["module_name"]))) . "&" . + "refresh=" . SECONDS_10MINUTES . "', " . + "'day_" . $win_handle . "')"; + + $graphCell = '' . html_print_image("images/chart_curve.png", true, array("border" => 0, "alt" => "")) . ''; + $graphCell .= " " . + "" . + html_print_image('images/binary.png', true, + array("border" => "0", "alt" => "")) . ""; + } - $name_module_type = modules_get_moduletype_name ($module["id_tipo_modulo"]); - $handle = "stat" . $name_module_type . "_" . $module["id_agente_modulo"]; - $url = 'include/procesos.php?agente=' . $module["id_agente_modulo"]; - $win_handle = dechex(crc32($module["id_agente_modulo"] . $module["module_name"])); + if (is_numeric(modules_get_last_value($module["id_agente_modulo"]))) { + $dataCell = format_numeric(modules_get_last_value($module["id_agente_modulo"])); + } + else { + $dataCell = ui_print_module_string_value( + $module["datos"], $module["id_agente_modulo"], + $module["current_interval"]); + } - $link ="winopeng('" . - "operation/agentes/stat_win.php?" . - "type=$graph_type&" . - "period=" . SECONDS_1DAY . "&" . - "id=" . $module["id_agente_modulo"] . "&" . - "label=" . rawurlencode( - urlencode( - base64_encode($module["module_name"]))) . "&" . - "refresh=" . SECONDS_10MINUTES . "', " . - "'day_" . $win_handle . "')"; + if ($module['estado'] == 3) { + $option = array ("html_attr" => 'class="redb"'); + } + else { + $option = array (); + } + $timestampCell = ui_print_timestamp ($utimestamp_sql["utimestamp"], true, $option); - $graphCell = '' . html_print_image("images/chart_curve.png", true, array("border" => 0, "alt" => "")) . ''; - $graphCell .= " " . - "" . - html_print_image('images/binary.png', true, - array("border" => "0", "alt" => "")) . ""; - } - - if (is_numeric(modules_get_last_value($module["id_agente_modulo"]))) { - $dataCell = format_numeric(modules_get_last_value($module["id_agente_modulo"])); - } - else { - $dataCell = ui_print_module_string_value( - $module["datos"], $module["id_agente_modulo"], - $module["current_interval"]); - } - - if ($module['estado'] == 3) { - $option = array ("html_attr" => 'class="redb"'); - } - else { - $option = array (); - } - $timestampCell = ui_print_timestamp ($utimestamp_sql["utimestamp"], true, $option); - - - $group_agent = agents_get_agent_group($module['id_agente']); - - if (check_acl ($config['id_user'], $group_agent, "AW")) { - $edit_module = 'aaa'; - $url_edit = "index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=" - . $module['id_agente'] . "&tab=module&id_agent_module=" . - $module["id_agente_modulo"] . "&edit_module=1"; + $group_agent = agents_get_agent_group($module['id_agente']); - $edit_module = '' . - html_print_image("images/config.png", true) . ''; + if (check_acl ($config['id_user'], $group_agent, "AW")) { + $edit_module = 'aaa'; + + $url_edit = "index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=" + . $module['id_agente'] . "&tab=module&id_agent_module=" . + $module["id_agente_modulo"] . "&edit_module=1"; + + $edit_module = '' . + html_print_image("images/config.png", true) . ''; + } + else { + $edit_module = ''; + } + + + array_push($table->data, array( + $module['module_name'], + $agentCell, + $typeCell, + $intervalCell, + $statusCell, + $graphCell, + $dataCell, + $timestampCell, + $edit_module)); } - else { - $edit_module = ''; - } - - - array_push($table->data, array( - $module['module_name'], - $agentCell, - $typeCell, - $intervalCell, - $statusCell, - $graphCell, - $dataCell, - $timestampCell, - $edit_module)); } echo "
"; From 1bef3ab0de333e8d4d7245e8b413906c7632f734 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Thu, 4 May 2017 15:47:17 +0200 Subject: [PATCH 006/157] Fixed problems with pass when this pass containt blank spaces. --- pandora_console/mobile/include/user.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_console/mobile/include/user.class.php b/pandora_console/mobile/include/user.class.php index fc72618056..b54059f04c 100644 --- a/pandora_console/mobile/include/user.class.php +++ b/pandora_console/mobile/include/user.class.php @@ -63,7 +63,9 @@ class User { $user = $system->getRequest('user', null); $password = $system->getRequest('password', null); - $this->login($user, $password); + $nick = $system->safeInput($user); + $pass = $system->safeInput($password); + $this->login($nick, $pass); } return $this->logged; @@ -76,6 +78,7 @@ class User { $user = $system->getRequest('user', null); $user = $system->safeInput($user); $password = $system->getRequest('password', null); + $password = $system->safeInput($password); } if (!empty($user) && !empty($password)) { From 09d6991c92090a31c2c8fbb17e8c94a93b4bcb2e Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 22 Jun 2017 17:00:30 +0200 Subject: [PATCH 007/157] Fixed agent lost in insert data --- pandora_console/extensions/insert_data.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/extensions/insert_data.php b/pandora_console/extensions/insert_data.php index 3e52a9138c..4466be067e 100644 --- a/pandora_console/extensions/insert_data.php +++ b/pandora_console/extensions/insert_data.php @@ -167,6 +167,7 @@ function mainInsertData() { $params['use_hidden_input_idagent'] = true; $params['print_hidden_input_idagent'] = true; $params['hidden_input_idagent_id'] = 'hidden-autocomplete_id_agent'; + $params['hidden_input_idagent_value'] = $id_agente; $table->data[0][1] = ui_print_agent_autocomplete_input($params); From b519cd46d34c4e1bd69a00fafce809db3d4fdaa6 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Thu, 29 Jun 2017 14:51:43 +0200 Subject: [PATCH 008/157] Added separation width to login fields --- pandora_console/general/login_page.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index da03d90f7d..1580ec4019 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -165,18 +165,22 @@ echo '