From 94768935eea75a6694175a5935f13b04aae0a583 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Tue, 26 Mar 2019 15:42:56 +0100 Subject: [PATCH 01/18] Pending to review Former-commit-id: c874be78a33585942c825f23b48010b2d604cd7c --- pandora_console/operation/events/events.build_table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index d38bd1918e..0d214a36d1 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -896,7 +896,7 @@ if ($group_rep == 2) { // Checkbox $data[$i] = html_print_checkbox_extended('validate_ids[]', $event['id_evento'], false, false, false, 'class="chk_val"', true); } else if (isset($table->header[$i]) || true) { - $data[$i] = ''; + $data[$i] = html_print_checkbox_extended('validate_ids[]', $event['id_evento'], false, false, false, 'class="chk_val"', true); } } From 58d2abbdae1e15066ee3f96caa43c536ccf844b1 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Tue, 23 Apr 2019 15:37:54 +0200 Subject: [PATCH 02/18] restauro api Former-commit-id: de9d1588e0e8ef53b48b72d52597963b59aee11f --- pandora_console/include/api.php | 95 ++------------------------------- 1 file changed, 4 insertions(+), 91 deletions(-) diff --git a/pandora_console/include/api.php b/pandora_console/include/api.php index 8e8f40339d..3b04cedd24 100644 --- a/pandora_console/include/api.php +++ b/pandora_console/include/api.php @@ -37,12 +37,9 @@ $api_password = get_parameter('apipass', ''); $password = get_parameter('pass', ''); $user = get_parameter('user', ''); $info = get_parameter('info', ''); -$user_db = get_parameter('user_db', ''); + $other = parseOtherParameter($otherSerialize, $otherMode); -$group_db = get_parameter('group_db', ''); -$disable = get_parameter('disable', ''); -$id_up = get_parameter('id_up', ''); -$id_profile = get_parameter('id_profile', ''); + $apiPassword = io_output_password(db_get_value_filter('value', 'tconfig', ['token' => 'api_password'])); $correctLogin = false; @@ -110,6 +107,7 @@ if ($correctLogin) { if ($op == 'set' && $id) { switch ($op2) { case 'update_agent': + case 'add_module_in_conf': case 'update_module_in_conf': case 'delete_module_in_conf': @@ -151,93 +149,8 @@ if ($correctLogin) { } break; - case 'info_user_name': - - if ($user_db === '') { - returnError(__('User not specified'), __('User not specified')); - return; - } - - $id_os = api_set_info_user_name($returnType, $user_db); - - if ($id_os != 100) { - return; - } - - if ($id_os == 100) { - returnError('not_allowed_operation_cluster', $returnType); - return false; - } - break; - - case 'filter_user_group': - - if ($user_db === '' && ( $group_db === '' || $disable === '')) { - returnError(__('User, group or disabled status not specified'), __('User, group or disabled status not specified')); - return; - } - - $id_os = api_set_filter_user_group($returnType, $user_db, $group_db, $disable); - - if ($id_os != 100) { - return; - } - - if ($id_os == false) { - returnError('not_allowed_operation_cluster', $returnType); - return false; - } - break; - - case 'delete_user_profiles': - - if ($user_db === '') { - returnError(__('User or group not specified'), __('User, group not specified')); - return; - } - - $id_os = api_set_delete_user_profiles($user_db, $id_up); - - if ($id_os != 100) { - return; - } - - if ($id_os == false) { - returnError('not_allowed_operation_cluster', $returnType); - return false; - } - break; - - case 'list_all_user': - - $id_os = api_set_list_all_user($returnType); - - if ($id_os === false) { - returnError('not_allowed_operation_cluster', $returnType); - return false; - } - break; - - case 'add_permission_user_to_group': - - if ($user_db == null || $group_db == null || $id_up == null) { - returnError(__('User, group or profile not specified'), __('User, group or profile status not specified')); - return; - } - - $id_os = api_set_add_permission_user_to_group($returnType, $user_db, $group_db, $id_up, $id_profile); - - if ($id_os != 100) { - return; - } - - if ($id_os == false) { - returnError('not_allowed_operation_cluster', $returnType); - return false; - } - break; - default: + // break; } } From 8987a607559cd3e4735c5d9b30aa858073a71003 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Tue, 23 Apr 2019 15:39:49 +0200 Subject: [PATCH 03/18] restauro functions api Former-commit-id: e22da32fb91e8f7b06d7fe627a9a3f2eca877390 --- pandora_console/include/functions_api.php | 442 +++------------------- 1 file changed, 47 insertions(+), 395 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index b3d76be3eb..e3aedd122a 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -1,36 +1,19 @@ 'critical_inverse as module_critical_inverse', 'module_warning_inverse' => 'warning_inverse as module_warning_inverse', ]; + // module related field mappings 2/2 (output field => column for 'tagente_estado') // module_id_agent_modulo is not in this list $estado_fields_to_columns_mapping = [ @@ -3030,20 +3014,21 @@ function api_get_policy_modules($thrash1, $thrash2, $other, $thrash3) /** - * Create a network module in agent. - * And return the id_agent_module of new module. + * Create a network module in agent. And return the id_agent_module of new module. * - * @param string $id Name of agent to add the module. - * @param string $thrash1 Don't use. - * @param array $other It's array, $other as param is ;;; - * ;;;;;;;; - * ;;;;;;; - * ;;;;;; - * ;;;; in this order - * and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_). - * @param string $thrash3 Don't use. - * @example: api.php?op=set&op2=create_network_module&id=pepito&other=prueba|0|7|1|10|15|0|16|18|0|15|0|www.google.es|0||0|180|0|0|0|0|latency%20ping&other_mode=url_encode_separator_|* - * @return mixed Return. + * @param string $id Name of agent to add the module. + * @param $thrash1 Don't use. + * @param array $other it's array, $other as param is ;;; + * ;;;;;;;; + * ;;;;;;; + * ;;;;;; + * ;;;; in this order + * and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_) + * example: + * + * api.php?op=set&op2=create_network_module&id=pepito&other=prueba|0|7|1|10|15|0|16|18|0|15|0|www.google.es|0||0|180|0|0|0|0|latency%20ping&other_mode=url_encode_separator_| + * + * @param $thrash3 Don't use */ function api_set_create_network_module($id, $thrash1, $other, $thrash3) { @@ -3105,23 +3090,22 @@ function api_set_create_network_module($id, $thrash1, $other, $thrash3) 'min_ff_event_critical' => $other['data'][27], 'critical_inverse' => $other['data'][28], 'warning_inverse' => $other['data'][29], - 'ff_type' => $other['data'][30], ]; if (! $values['descripcion']) { $values['descripcion'] = ''; - // Column 'descripcion' cannot be null. + // Column 'descripcion' cannot be null } if (! $values['module_macros']) { $values['module_macros'] = ''; - // Column 'module_macros' cannot be null. + // Column 'module_macros' cannot be null } $idModule = modules_create_agent_module($idAgent, $name, $values, true); if (is_error($idModule)) { - // TODO: Improve the error returning more info. + // TODO: Improve the error returning more info returnError('error_create_network_module', __('Error in creation network module.')); } else { returnData('string', ['type' => 'string', 'data' => $idModule]); @@ -3238,7 +3222,6 @@ function api_set_update_network_module($id_module, $thrash1, $other, $thrash3) 'critical_inverse', 'warning_inverse', 'policy_linked', - 'ff_type', ]; $values = []; @@ -3343,23 +3326,22 @@ function api_set_create_plugin_module($id, $thrash1, $other, $thrash3) 'min_ff_event_critical' => $other['data'][32], 'critical_inverse' => $other['data'][33], 'warning_inverse' => $other['data'][34], - 'ff_type' => $other['data'][35], ]; if (! $values['descripcion']) { $values['descripcion'] = ''; - // Column 'descripcion' cannot be null. + // Column 'descripcion' cannot be null } if (! $values['module_macros']) { $values['module_macros'] = ''; - // Column 'module_macros' cannot be null. + // Column 'module_macros' cannot be null } $idModule = modules_create_agent_module($idAgent, $name, $values, true); if (is_error($idModule)) { - // TODO: Improve the error returning more info. + // TODO: Improve the error returning more info returnError('error_create_plugin_module', __('Error in creation plugin module.')); } else { returnData('string', ['type' => 'string', 'data' => $idModule]); @@ -3405,7 +3387,7 @@ function api_set_update_plugin_module($id_module, $thrash1, $other, $thrash3) return; } - // If we want to change the module to a new agent. + // If we want to change the module to a new agent if ($other['data'][0] != '') { if (!util_api_check_agent_and_print_error($other['data'][0], 'string', 'AW')) { return; @@ -3422,7 +3404,7 @@ function api_set_update_plugin_module($id_module, $thrash1, $other, $thrash3) } } - // Check if agent exists. + // Check if agent exists $check_id_agent = db_get_value('id_agente', 'tagente', 'id_agente', $other['data'][0]); if (!$check_id_agent) { returnError('error_update_data_module', __('Error updating plugin module. Id_agent doesn\'t exist.')); @@ -3466,7 +3448,6 @@ function api_set_update_plugin_module($id_module, $thrash1, $other, $thrash3) 'critical_inverse', 'warning_inverse', 'policy_linked', - 'ff_type', ]; $values = []; @@ -3565,23 +3546,22 @@ function api_set_create_data_module($id, $thrash1, $other, $thrash3) 'ff_timeout' => $other['data'][23], 'critical_inverse' => $other['data'][24], 'warning_inverse' => $other['data'][25], - 'ff_type' => $other['data'][26], ]; if (! $values['descripcion']) { $values['descripcion'] = ''; - // Column 'descripcion' cannot be null. + // Column 'descripcion' cannot be null } if (! $values['module_macros']) { $values['module_macros'] = ''; - // Column 'module_macros' cannot be null. + // Column 'module_macros' cannot be null } $idModule = modules_create_agent_module($idAgent, $name, $values, true); if (is_error($idModule)) { - // TODO: Improve the error returning more info. + // TODO: Improve the error returning more info returnError('error_create_data_module', __('Error in creation data module.')); } else { returnData('string', ['type' => 'string', 'data' => $idModule]); @@ -3838,7 +3818,7 @@ function api_set_update_data_module($id_module, $thrash1, $other, $thrash3) return; } - // If we want to change the module to a new agent. + // If we want to change the module to a new agent if ($other['data'][0] != '') { if (!util_api_check_agent_and_print_error($other['data'][0], 'string', 'AW')) { return; @@ -3855,7 +3835,7 @@ function api_set_update_data_module($id_module, $thrash1, $other, $thrash3) } } - // Check if agent exists. + // Check if agent exists $check_id_agent = db_get_value('id_agente', 'tagente', 'id_agente', $other['data'][0]); if (!$check_id_agent) { returnError('error_update_data_module', __('Error updating data module. Id_agent doesn\'t exist.')); @@ -3890,7 +3870,6 @@ function api_set_update_data_module($id_module, $thrash1, $other, $thrash3) 'critical_inverse', 'warning_inverse', 'policy_linked', - 'ff_type', ]; $values = []; @@ -3968,7 +3947,7 @@ function api_set_create_snmp_module($id, $thrash1, $other, $thrash3) $disabled_types_event[EVENTS_GOING_UNKNOWN] = (int) !$other['data'][27]; $disabled_types_event = json_encode($disabled_types_event); - // SNMP version 3. + // SNMP version 3 if ($other['data'][14] == '3') { if ($other['data'][23] != 'AES' and $other['data'][23] != 'DES') { returnError('error_create_snmp_module', __('Error in creation SNMP module. snmp3_priv_method doesn\'t exist. Set it to \'AES\' or \'DES\'. ')); @@ -4021,7 +4000,6 @@ function api_set_create_snmp_module($id, $thrash1, $other, $thrash3) 'min_ff_event_normal' => $other['data'][31], 'min_ff_event_warning' => $other['data'][32], 'min_ff_event_critical' => $other['data'][33], - 'ff_type' => $other['data'][34], ]; } else { $values = [ @@ -4054,19 +4032,18 @@ function api_set_create_snmp_module($id, $thrash1, $other, $thrash3) 'min_ff_event_normal' => $other['data'][25], 'min_ff_event_warning' => $other['data'][26], 'min_ff_event_critical' => $other['data'][27], - 'ff_type' => $other['data'][28], ]; } if (! $values['descripcion']) { $values['descripcion'] = ''; - // Column 'descripcion' cannot be null. + // Column 'descripcion' cannot be null } $idModule = modules_create_agent_module($idAgent, $name, $values, true); if (is_error($idModule)) { - // TODO: Improve the error returning more info. + // TODO: Improve the error returning more info returnError('error_create_snmp_module', __('Error in creation SNMP module.')); } else { returnData('string', ['type' => 'string', 'data' => $idModule]); @@ -4114,7 +4091,7 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3) return; } - // If we want to change the module to a new agent. + // If we want to change the module to a new agent if ($other['data'][0] != '') { if (!util_api_check_agent_and_print_error($other['data'][0], 'string', 'AW')) { return; @@ -4131,7 +4108,7 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3) } } - // Check if agent exists. + // Check if agent exists $check_id_agent = db_get_value('id_agente', 'tagente', 'id_agente', $other['data'][0]); if (!$check_id_agent) { returnError('error_update_data_module', __('Error updating snmp module. Id_agent doesn\'t exist.')); @@ -4139,7 +4116,7 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3) } } - // SNMP version 3. + // SNMP version 3 if ($other['data'][13] == '3') { if ($other['data'][22] != 'AES' and $other['data'][22] != 'DES') { returnError( @@ -4203,7 +4180,6 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3) 'min_ff_event_warning', 'min_ff_event_critical', 'policy_linked', - 'ff_type', ]; } else { $snmp_module_fields = [ @@ -4235,7 +4211,6 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3) 'min_ff_event_warning', 'min_ff_event_critical', 'policy_linked', - 'ff_type', ]; } @@ -4333,7 +4308,6 @@ function api_set_new_network_component($id, $thrash1, $other, $thrash2) 'min_ff_event_normal' => $other['data'][20], 'min_ff_event_warning' => $other['data'][21], 'min_ff_event_critical' => $other['data'][22], - 'ff_type' => $other['data'][23], ]; $name_check = db_get_value('name', 'tnetwork_component', 'name', $id); @@ -4434,7 +4408,6 @@ function api_set_new_plugin_component($id, $thrash1, $other, $thrash2) 'min_ff_event_normal' => $other['data'][24], 'min_ff_event_warning' => $other['data'][25], 'min_ff_event_critical' => $other['data'][26], - 'ff_type' => $other['data'][27], ]; $name_check = db_get_value('name', 'tnetwork_component', 'name', $id); @@ -4570,7 +4543,6 @@ function api_set_new_snmp_component($id, $thrash1, $other, $thrash2) 'min_ff_event_normal' => $other['data'][29], 'min_ff_event_warning' => $other['data'][30], 'min_ff_event_critical' => $other['data'][31], - 'ff_type' => $other['data'][32], ]; } else { $values = [ @@ -4602,7 +4574,6 @@ function api_set_new_snmp_component($id, $thrash1, $other, $thrash2) 'min_ff_event_normal' => $other['data'][25], 'min_ff_event_warning' => $other['data'][26], 'min_ff_event_critical' => $other['data'][27], - 'ff_type' => $other['data'][28], ]; } @@ -4683,7 +4654,6 @@ function api_set_new_local_component($id, $thrash1, $other, $thrash2) 'min_ff_event_warning' => $other['data'][8], 'min_ff_event_critical' => $other['data'][9], 'ff_timeout' => $other['data'][10], - 'ff_type' => $other['data'][11], ]; $name_check = enterprise_hook( @@ -6439,7 +6409,6 @@ function api_set_add_data_module_policy($id, $thrash1, $other, $thrash3) $values['min_ff_event_warning'] = $other['data'][21]; $values['min_ff_event_critical'] = $other['data'][22]; $values['ff_timeout'] = $other['data'][23]; - $values['ff_type'] = $other['data'][24]; if ($name_module_policy !== false) { if ($name_module_policy[0]['name'] == $other['data'][0]) { @@ -6681,7 +6650,6 @@ function api_set_add_network_module_policy($id, $thrash1, $other, $thrash3) $values['min_ff_event_normal'] = $other['data'][24]; $values['min_ff_event_warning'] = $other['data'][25]; $values['min_ff_event_critical'] = $other['data'][26]; - $values['ff_type'] = $other['data'][27]; if ($name_module_policy !== false) { if ($name_module_policy[0]['name'] == $other['data'][0]) { @@ -6891,7 +6859,6 @@ function api_set_add_plugin_module_policy($id, $thrash1, $other, $thrash3) $values['min_ff_event_normal'] = $other['data'][29]; $values['min_ff_event_warning'] = $other['data'][30]; $values['min_ff_event_critical'] = $other['data'][31]; - $values['ff_type'] = $other['data'][32]; if ($name_module_policy !== false) { if ($name_module_policy[0]['name'] == $other['data'][0]) { @@ -7309,7 +7276,6 @@ function api_set_add_snmp_module_policy($id, $thrash1, $other, $thrash3) 'min_ff_event_normal' => $other['data'][30], 'min_ff_event_warning' => $other['data'][31], 'min_ff_event_critical' => $other['data'][32], - 'ff_type' => $other['data'][33], ]; } else { $values = [ @@ -7339,7 +7305,6 @@ function api_set_add_snmp_module_policy($id, $thrash1, $other, $thrash3) 'min_ff_event_normal' => $other['data'][24], 'min_ff_event_warning' => $other['data'][25], 'min_ff_event_critical' => $other['data'][26], - 'ff_type' => $other['data'][27], ]; } @@ -8829,14 +8794,7 @@ function api_set_alert_actions($id, $id2, $other, $trash1) } $firesMin = $other['data'][2]; - if (!$firesMin) { - $firesMin = 0; - } - $firesMax = $other['data'][3]; - if (!$firesMax) { - $firesMax = 0; - } $values = [ 'id_alert_template_module' => $idAlertTemplateModule, @@ -13311,7 +13269,6 @@ function api_set_apply_module_template($id_template, $id_agent, $thrash3, $thras 'min_ff_event_normal' => $row2['min_ff_event_normal'], 'min_ff_event_warning' => $row2['min_ff_event_warning'], 'min_ff_event_critical' => $row2['min_ff_event_critical'], - 'ff_type' => $row2['ff_type'], ]; $name = $row2['name']; @@ -14728,308 +14685,3 @@ function api_set_reset_agent_counts($id, $thrash1, $thrash2, $thrash3) } } - - -/** - * Functions por get all user to new feature for Carrefour - * It depends of type the method will return csv or json data - * - * @param string $returnType - * @return - */ - - -function api_set_list_all_user($returnType) -{ - global $config; - - if (!check_acl($config['id_user'], 0, 'AR')) { - returnError('forbidden', 'string'); - return; - } - - $sql = 'SELECT - tup.id_usuario AS user_id, - tp.id_perfil AS profile_id, - tp.name AS profile_name, - tup.id_grupo AS group_id, - tgp.nombre AS group_name - FROM tperfil tp - INNER JOIN tusuario_perfil tup - ON tp.id_perfil = tup.id_perfil - LEFT OUTER JOIN tgrupo tgp - ON tup.id_grupo = tgp.id_grupo;'; - - $users = db_get_all_rows_sql($sql); - - $i = 0; - - foreach ($users as $up) { - $group_name = $up['group_name']; - if ($up['group_name'] === null) { - $group_name = 'All'; - } - - $values[$i] = [ - 'id_usuario' => $up['user_id'], - 'id_perfil' => $up['profile_id'], - 'perfil_name' => $up['profile_name'], - 'id_grupo' => $up['group_id'], - 'group_name' => $group_name, - ]; - $i += 1; - } - - if ($values === false) { - returnError('Error_user', __('Users could not be found.')); - return; - } - - $data = [ - 'type' => 'array', - 'data' => $values, - ]; - - returnData($returnType, $data, ';'); -} - - -/** - * Funtion for get all info user to new feature for Carrefour - * It depends of type the method will return csv or json data - * - * @param string $returnType - * @param string $user_db - * @return - */ - - -function api_set_info_user_name($returnType, $user_db) -{ - global $config; - - if (!check_acl($config['id_user'], 0, 'AR')) { - returnError('forbidden', 'string'); - return; - } - - $sql = sprintf( - 'SELECT - tup.id_usuario AS user_id, tp.id_perfil AS profile_id, - tp.name AS profile_name, tup.id_grupo AS group_id, - tg.nombre AS group_name - FROM tperfil tp - INNER JOIN tusuario_perfil tup - ON tp.id_perfil = tup.id_perfil - LEFT OUTER JOIN tgrupo tg - ON tup.id_grupo = tg.id_grupo - WHERE tup.id_usuario = %s', - io_safe_output($user_db) - ); - - $user_profile = db_get_all_rows_sql($sql); - - $i = 0; - - foreach ($user_profile as $up) { - $group_name = $up['group_name']; - if ($up['group_name'] === null) { - $group_name = 'All'; - } - - $values[$i] = [ - 'id_usuario' => $up['user_id'], - 'id_perfil' => $up['profile_id'], - 'perfil_name' => $up['profile_name'], - 'id_grupo' => $up['group_id'], - 'group_name' => $group_name, - ]; - $i += 1; - } - - $data = [ - 'type' => 'array', - 'data' => $values, - ]; - - returnData($returnType, $data, ';'); -} - - -/** - * Function for get user from a group to new feature for Carrefour. - * It depends of type the method will return csv or json data. - * - * @param string $returnType - * @param string $user_db - * @param string $group_db - * @param integer $disable - * @return - */ - - -function api_set_filter_user_group($returnType, $user_db, $group_db, $disable) -{ - global $config; - - if (!check_acl($config['id_user'], 0, 'AR')) { - returnError('forbidden', 'string'); - return; - } - - $filter_group = ''; - if ($group_db !== null) { - $filter_group = 'AND tup.id_grupo = '.io_safe_output($group_db).''; - } - - $sql_disable = ''; - if ($disable !== null) { - $sql_disable = 'INNER JOIN tusuario tu - ON tu.disabled = '.io_safe_output($disable).''; - } - - $sql = sprintf( - 'SELECT DISTINCT - tup.id_usuario AS user_id, - tp.id_perfil AS profile_id, - tp.name AS profile_name, - tup.id_grupo AS group_id, - tg.nombre AS group_name - FROM tperfil tp - INNER JOIN tusuario_perfil tup - ON tp.id_perfil = tup.id_perfil - LEFT OUTER JOIN tgrupo tg - ON tup.id_grupo = tg.id_grupo - '.$sql_disable.' - WHERE tup.id_usuario = %s '.$filter_group.'', - io_safe_output($user_db) - ); - - $filter_user = db_get_all_rows_sql($sql); - - $i = 0; - - foreach ($filter_user as $up) { - $group_name = $up['group_name']; - if ($up['group_name'] === null) { - $group_name = 'All'; - } - - $values[$i] = [ - 'id_usuario' => $up['user_id'], - 'id_perfil' => $up['profile_id'], - 'perfil_name' => $up['profile_name'], - 'id_grupo' => $up['group_id'], - 'group_name' => $group_name, - ]; - $i += 1; - } - - $data = [ - 'type' => 'array', - 'data' => $values, - ]; - - returnData($returnType, $data, ';'); - -} - - -/** - * Function for delete an user profile for Carrefour new feature - * The return of this function its only a message - * - * @param string $user_db - * @param integer $id_up - * @return void - */ - - -function api_set_delete_user_profiles($user_db, $id_up) -{ - global $config; - - if (!check_acl($config['id_user'], 0, 'AW')) { - returnError('forbidden', 'string'); - return; - } - - $values = [ - 'id_usuario' => io_safe_output($user_db), - 'id_up' => io_safe_output($id_up), - ]; - $deleted_permission = db_process_sql_delete('tusuario_perfil', $values); - - if ($deleted_permission == false) { - returnError('Error_delete', __('User profile could not be deleted.')); - return; - } - - $data = [ - 'type' => 'string', - 'data' => $deleted_permission, - ]; - - returnData('string', ['type' => 'string', 'data' => $data]); -} - - -/** - * Function for add permission a user to a group for Carrefour new feature - * It depends of type the method will return csv or json data - * - * @param string $returnType - * @param string $user_db - * @param integer $group_db - * @param integer $id_up - * - * @return void - */ - - -function api_set_add_permission_user_to_group($returnType, $user_db, $group_db, $id_up, $id_profile) -{ - global $config; - - if (!check_acl($config['id_user'], 0, 'AW')) { - returnError('forbidden', 'string'); - return; - } - - $sql = 'SELECT id_up - FROM tusuario_perfil - WHERE id_up = '.$id_profile.''; - - $exist_profile = db_get_value_sql($sql); - - $values = [ - 'id_usuario' => $user_db, - 'id_perfil' => $id_up, - 'id_grupo' => $group_db, - 'no_hierarchy' => 0, - 'assigned_by' => 0, - 'id_policy' => 0, - 'tags' => '', - - ]; - - $where_id_up = ['id_up' => $id_profile]; - if ($exist_profile == $id_profile) { - $sucessfull_insert = db_process_sql_update('tusuario_perfil', $values, $where_id_up); - } else { - $sucessfull_insert = db_process_sql_insert('tusuario_perfil', $values); - } - - if ($sucessfull_insert == false) { - returnError('Error_insert', __('User profile could not be available.')); - return; - } - - $data = [ - 'type' => 'array', - 'data' => $values, - ]; - - returnData($returnType, $data, ';'); - -} From c5c84d74216dd537c272b9c52a6ef26e88489e95 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Mon, 29 Apr 2019 12:32:06 +0200 Subject: [PATCH 04/18] Deleted row Integria IMS incident from event on tevent_responoses Former-commit-id: 76e41297003d537f8b0ea74394dd433e71ca2976 --- pandora_console/extras/mr/27.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/extras/mr/27.sql b/pandora_console/extras/mr/27.sql index 697be21a93..38d0d0d7bb 100644 --- a/pandora_console/extras/mr/27.sql +++ b/pandora_console/extras/mr/27.sql @@ -50,5 +50,6 @@ UPDATE `trecon_script` SET `type` = 4 WHERE `name` LIKE "IPMI%Recon"; UPDATE `trecon_task` SET `type`=3 WHERE `description`="Discovery.Application.VMware"; UPDATE `trecon_task` SET `type`=2 WHERE `description`="Discovery.Cloud"; UPDATE `trecon_task` SET `type`=7 WHERE `description`="Discovery.Cloud.RDS"; +DELETE FROM 'tevent_response' WHERE 'name' LIKE 'Create Integria IMS incident from event'; COMMIT; From 8dc2644368c0e613f581a1dece97a1f2c97bbd74 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Mon, 29 Apr 2019 12:36:37 +0200 Subject: [PATCH 05/18] Deleted default insert on tevent_response Former-commit-id: 33fb686679fa89afbf0834e1e434739d11bfc4dd --- pandora_console/pandoradb_data.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 7b9517f661..f30798352e 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -1158,7 +1158,7 @@ INSERT INTO `tagent_custom_fields` VALUES (1,'Serial Number',0,0,''),(2,'De INSERT INTO `ttag` VALUES (1,'network','Network equipment','http://artica.es','',''),(2,'critical','Critical modules','','',''),(3,'dmz','DMZ Network Zone','','',''),(4,'performance','Performance anda capacity modules','','',''),(5,'configuration','','','',''); -INSERT INTO `tevent_response` VALUES (1,'Ping to host','Ping to the agent host','ping -c 5 _agent_address_','command',0,620,500,0,'',0),(3,'Create incident from event','Create a incident from the event with the standard incidents system of Pandora FMS','index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form&from_event=_event_id_','url',0,0,0,1,'',0),(4,'Create Integria IMS incident from event','Create a incident from the event with integria incidents system of Pandora FMS. Is necessary to enable and configure the Integria incidents in Pandora FMS setup.','index.php?sec=workspace&sec2=operation/integria_incidents/incident&tab=editor&from_event=_event_id_','url',0,0,0,1,'',0),(5,'Restart agent','Restart the agent with using UDP protocol. To use this response is necessary to have installed Pandora FMS server and console in the same machine.','/usr/share/pandora_server/util/udp_client.pl _agent_address_ 41122 "REFRESH AGENT"','command',0,620,500,0,'',0),(6,'Ping to module agent host','Ping to the module agent host','ping -c 5 _module_address_','command',0,620,500,0,'',0); +INSERT INTO `tevent_response` VALUES (1,'Ping to host','Ping to the agent host','ping -c 5 _agent_address_','command',0,620,500,0,'',0),(3,'Create incident from event','Create a incident from the event with the standard incidents system of Pandora FMS','index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form&from_event=_event_id_','url',0,0,0,1,'',0),(5,'Restart agent','Restart the agent with using UDP protocol. To use this response is necessary to have installed Pandora FMS server and console in the same machine.','/usr/share/pandora_server/util/udp_client.pl _agent_address_ 41122 "REFRESH AGENT"','command',0,620,500,0,'',0),(6,'Ping to module agent host','Ping to the module agent host','ping -c 5 _module_address_','command',0,620,500,0,'',0); INSERT INTO `tupdate_settings` VALUES ('current_update', '412'), ('customer_key', 'PANDORA-FREE'), ('updating_binary_path', 'Path where the updated binary files will be stored'), ('updating_code_path', 'Path where the updated code is stored'), ('dbname', ''), ('dbhost', ''), ('dbpass', ''), ('dbuser', ''), ('dbport', ''), ('proxy', ''), ('proxy_port', ''), ('proxy_user', ''), ('proxy_pass', ''); @@ -1315,4 +1315,4 @@ INSERT INTO `tnotification_source_user`(`id_source`,`id_user`,`enabled`,`also_ma INSERT INTO `tnotification_source_group` SELECT `id`,0 FROM `tnotification_source` WHERE `description`="Message"; - \ No newline at end of file + From 1d4e8c9bedfdfcd0ed1f692671ec41aca361a27f Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Mon, 29 Apr 2019 15:17:59 +0200 Subject: [PATCH 06/18] Changed translations strings Former-commit-id: b802cc7a3650a1697ec0f192cbb374fce3ffea56 --- pandora_console/extras/pandora_diag.php | 42 ++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/pandora_console/extras/pandora_diag.php b/pandora_console/extras/pandora_diag.php index 10e9fbfd42..34cfac8ea4 100644 --- a/pandora_console/extras/pandora_diag.php +++ b/pandora_console/extras/pandora_diag.php @@ -122,7 +122,7 @@ function execution_time() if ($times[0]['datos'] > ($times[1]['datos'] * 1.2)) { return "Warning Status   The execution time could be degrading. For a more extensive information of this data consult the Execution Time graph"; } else { - return "Normal Status   The execution time is correct. For a more extensive information of this data consult the Execution Time graph"; + return "Normal Status   The execution time is correct. For more information about this data, check the Execution Time graph"; } } @@ -173,9 +173,9 @@ function license_capacity() $status_license_capacity = ''; $current_count = db_get_value_sql('SELECT count(*) FROM tagente'); if ($current_count > ($license_limit * 90 / 100)) { - $status_license_capacity = "Warning Status   The license capacity is more than 90 percent"; + $status_license_capacity = "Warning Status   License capacity exceeds 90 percent"; } else { - $status_license_capacity = "Normal Status   The license capacity is less than 90 percent"; + $status_license_capacity = "Normal Status   License capacity is less than 90 percent"; } return $status_license_capacity; @@ -202,9 +202,9 @@ function interval_average_of_network_modules() $average_time = ((int) $total_module_interval_time / $total_network_modules); if ($average_time < 180) { - $status_average_modules = "Warning Status   The system has a lot of load (average time $average_time) and a very fine configuration is required"; + $status_average_modules = "Warning Status   The system is overloaded (average time $average_time) and a very fine configuration is required"; } else { - $status_average_modules = "Normal Status   The system has an acceptable charge (average time $average_time) "; + $status_average_modules = "Normal Status   The system is not overloaded (average time $average_time) "; } if ($average_time == 0) { @@ -221,9 +221,9 @@ $attachment_total_files = count(glob($config['homedir'].'/attachment/{*.*}', GLO function files_attachment_folder($total_files) { if ($total_files <= 700) { - $status_total_files = "Normal Status   The attachment folder has less than 700 files."; + $status_total_files = "Normal Status   The attached folder contains less than 700 files."; } else { - $status_total_files = "Warning Status   The attachment folder has more than 700 files."; + $status_total_files = "Warning Status   The attached folder contains more than 700 files."; } return $status_total_files; @@ -236,9 +236,9 @@ $tagente_datos_size = db_get_value_sql('SELECT COUNT(*) FROM tagente_datos'); function status_tagente_datos($tagente_datos_size) { if ($tagente_datos_size <= 3000000) { - $tagente_datos_size = "Normal Status   The tagente_datos table has an acceptable amount of data."; + $tagente_datos_size = "Normal Status   The tagente_datos table contains an acceptable amount of data."; } else { - $tagente_datos_size = "Warning Status   The tagente_datos table has too much data. A historical database is recommended."; + $tagente_datos_size = "Warning Status   The tagente_datos table contains too much data. A historical database is recommended."; } return $tagente_datos_size; @@ -302,9 +302,9 @@ function status_fragmentation_tables($tables_fragmentation_max_rec_value, $table { $status_tables_frag = ''; if ($tables_fragmentation > $tables_fragmentation_max_rec_value) { - $status_tables_frag = "Warning Status   The fragmentation tables is higher than recommended. You should defragment them."; + $status_tables_frag = "Warning Status   Table fragmentation is higher than recommended. They should be defragmented."; } else { - $status_tables_frag = "Normal Status   The fragmentation tables is correct."; + $status_tables_frag = "Normal Status   Table fragmentation is correct."; } return $status_tables_frag; @@ -320,9 +320,9 @@ if ($console_mode == 1) { echo "\nPandora FMS PHP diagnostic tool v3.2 (c) Artica ST 2009-2010 \n"; if ($argc == 1 || in_array($argv[1], ['--help', '-help', '-h', '-?'])) { - echo "\nThis command line script gives information about Pandora FMS database. -This program only can be executed from console, and need a parameter, the -full path to Pandora FMS 'config.php' file. + echo "\nThis command line script contains information about Pandora FMS database. + This program can only be executed from the console, and it needs a parameter, the + full path to Pandora FMS 'config.php' file. Usage: php pandora_diag.php path_to_pandora_console @@ -705,7 +705,7 @@ render_info_data( render_row($tables_fragmentation_max_rec_value.'%', 'Tables fragmentation (maximum recommended value)'); render_row(number_format($tables_fragmentation, 2).'%', 'Tables fragmentation (current value)'); - render_row(status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation), 'Status fragmentation tables'); + render_row(status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation), 'Table fragmentation status'); echo "".__(' Pandora FMS logs dates').''; @@ -734,14 +734,14 @@ render_info_data( echo "".__(' Status of the attachment folder').''; - render_row($attachment_total_files, 'Total files in the attachment folder'); + render_row($attachment_total_files, 'Total files in the attached folder'); render_row(files_attachment_folder($attachment_total_files), 'Status of the attachment folder'); echo "".__(' Information from the tagente_datos table').''; - render_row($tagente_datos_size, 'Total data in the tagente_datos table'); - render_row(status_tagente_datos($tagente_datos_size), 'Status of the tagente_datos table'); - render_row(execution_time(), 'Degradation of the execution time when executing a count'); + render_row($tagente_datos_size, 'Total data in tagente_datos table'); + render_row(status_tagente_datos($tagente_datos_size), 'Tangente_datos table status'); + render_row(execution_time(), 'Execution time degradation when executing a count'); echo "".__(' Pandora FMS server threads').''; @@ -784,6 +784,6 @@ render_info_data( echo "
"; echo ''.__( - '(*) Please check your Pandora Server setup and be sure that database maintenance daemon is running. It\' very important to -keep up-to-date database to get the best performance and results in Pandora' + '(*) Please check your Pandora Server setup and make sure that the database maintenance daemon is running. It\' is very important to + keep the database up-to-date to get the best performance and results in Pandora' ).'


'; From e1951c45a4914bed7f464a4ab64592027006928b Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Mon, 6 May 2019 18:06:59 +0200 Subject: [PATCH 07/18] =?UTF-8?q?Se=20a=C3=B1ade=20al=2028?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 1607d9cbc88fe0e029df46ada20046899558829e --- pandora_console/extras/mr/28.sql | 5 +++++ .../godmode/agentes/module_manager_editor_common.php | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 pandora_console/extras/mr/28.sql diff --git a/pandora_console/extras/mr/28.sql b/pandora_console/extras/mr/28.sql new file mode 100644 index 0000000000..5d61a98318 --- /dev/null +++ b/pandora_console/extras/mr/28.sql @@ -0,0 +1,5 @@ +START TRANSACTION; + +DELETE FROM 'tevent_response' WHERE 'name' LIKE 'Create Integria IMS incident from event'; + +COMMIT; diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 1724ee6622..3f7b3350f9 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -1167,8 +1167,13 @@ foreach ($module_relations as $key => $module_relation) { } html_print_input_hidden('module_relations_count', $relations_count); - +ui_require_jquery_file('ui'); +ui_require_jquery_file('form'); +ui_require_jquery_file('pandora'); +ui_require_jquery_file('pandora.controls'); ui_require_jquery_file('json'); +ui_require_javascript_file('pandora_modules'); + ?> @@ -1362,7 +1367,7 @@ function disabled_two_tailed (disabledBecauseInPolicy) { //Dynamic_options_advance; function advanced_option_dynamic() { if($('.hide_dinamic').is(":visible")){ - $('.hide_dinamic').hide(); + } else { $('.hide_dinamic').show(); From fff3a783a1f045ddeba4718798dc74226645367c Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Mon, 6 May 2019 18:09:30 +0200 Subject: [PATCH 08/18] Se restablece archivo modificado Former-commit-id: 1dca6ef8291dbd98951da31fc765130c9c450316 --- .../godmode/agentes/module_manager_editor_common.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 3f7b3350f9..85114161b6 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -1167,12 +1167,8 @@ foreach ($module_relations as $key => $module_relation) { } html_print_input_hidden('module_relations_count', $relations_count); -ui_require_jquery_file('ui'); -ui_require_jquery_file('form'); -ui_require_jquery_file('pandora'); -ui_require_jquery_file('pandora.controls'); + ui_require_jquery_file('json'); -ui_require_javascript_file('pandora_modules'); ?> @@ -1367,8 +1363,8 @@ function disabled_two_tailed (disabledBecauseInPolicy) { //Dynamic_options_advance; function advanced_option_dynamic() { if($('.hide_dinamic').is(":visible")){ - - + $('.hide_dinamic').hide(); + } else { $('.hide_dinamic').show(); From ad00492ad63d67a41b855c349bf65475fceb4a4e Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Mon, 6 May 2019 18:23:12 +0200 Subject: [PATCH 09/18] se elimina la query del 27 Former-commit-id: 1756d296ad9c13c62c4eb46a854291dfc4200256 --- pandora_console/extras/mr/27.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/pandora_console/extras/mr/27.sql b/pandora_console/extras/mr/27.sql index 38d0d0d7bb..697be21a93 100644 --- a/pandora_console/extras/mr/27.sql +++ b/pandora_console/extras/mr/27.sql @@ -50,6 +50,5 @@ UPDATE `trecon_script` SET `type` = 4 WHERE `name` LIKE "IPMI%Recon"; UPDATE `trecon_task` SET `type`=3 WHERE `description`="Discovery.Application.VMware"; UPDATE `trecon_task` SET `type`=2 WHERE `description`="Discovery.Cloud"; UPDATE `trecon_task` SET `type`=7 WHERE `description`="Discovery.Cloud.RDS"; -DELETE FROM 'tevent_response' WHERE 'name' LIKE 'Create Integria IMS incident from event'; COMMIT; From 283be8f63265883ffb2629aaa5f7bd2194983bfe Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Tue, 7 May 2019 16:07:07 +0200 Subject: [PATCH 10/18] New menu module graph - #3617 --- pandora_console/include/ajax/module.php | 4 +- pandora_console/include/styles/pandora.css | 63 +++++++++ .../operation/agentes/stat_win.php | 120 ++++++++---------- 3 files changed, 117 insertions(+), 70 deletions(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 7ce37005ea..7b11249f18 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -1120,11 +1120,11 @@ if (check_login()) { $draw_events = 0; } - $link = "winopeng('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module['id_agente_modulo'].'&'.'label='.rawurlencode( + $link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module['id_agente_modulo'].'&'.'label='.rawurlencode( urlencode( base64_encode($module['nombre']) ) - ).'&'.'refresh='.SECONDS_10MINUTES.'&'."draw_events=$draw_events', 'day_".$win_handle."')"; + ).'&'.'refresh='.SECONDS_10MINUTES.'&'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 650)"; if (!is_snapshot_data($module['datos'])) { $data[8] .= ''.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).'   '; } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index bd0001b769..a897c26247 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -5438,3 +5438,66 @@ table.info_table.policy_sub_table { margin-top: 0px; align-items: flex-start; } + +/* mergear esto antes */ + +table.events_show_more_table tr:nth-child(odd) td { + background-color: #ffffff; +} +table.events_show_more_table tr:nth-child(even) td { + background-color: #f5f5f5; + border-top: 1px solid #cacaca; + border-bottom: 1px solid #cacaca; +} + +table.events_show_more_table tr td { + height: 22px; + padding: 4px; +} + +table.events_show_more_table tr td:first-child { + width: 35%; + font-weight: bold; + padding-left: 20px; +} + +/* nuevassss */ +.module_graph_menu_dropdown { + padding-top: 20px; + padding-bottom: 20px; + position: absolute; + top: 10px; + width: 100%; + z-index: 1; +} + +.module_graph_menu_content, +.module_graph_menu_header { + width: 92%; + border: 1px solid #e2e2e2; + margin: 0 auto; + box-sizing: border-box; + background-color: #fff; +} + +.module_graph_menu_content { + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + padding: 15px; + border-top: none; +} + +.module_graph_menu_header { + border-top-left-radius: 4px; + border-top-right-radius: 4px; + padding: 6px 10px; + cursor: pointer; + display: flex; + justify-content: space-between; + align-items: center; +} + +.module_graph_menu_header span > img { + vertical-align: middle; + padding-left: 5px; +} diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 78cd56cfcc..767bc3de2a 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -89,7 +89,7 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent); }; - + "; @@ -175,8 +175,28 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent); $unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $id); - echo '
'; + + // MENU + $menu_form = "
".html_print_input_hidden('id', $id, true).html_print_input_hidden('label', $label, true); + + if (!empty($server_id)) { + $menu_form .= html_print_input_hidden('server', $server_id, true); + } + + if (isset($_GET['type'])) { + $type = get_parameter_get('type'); + $menu_form .= html_print_input_hidden('type', $type, true); + } + + echo $menu_form; + + echo ''; + + echo '
'; + + + echo '
'; $width = '90%'; $height = '450'; @@ -228,39 +248,16 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent); echo '
'; - // - // SIDE MENU - // - $params = []; - // TOP TEXT - // Use the no_meta parameter because this image is only in the base console - $params['top_text'] = "
".html_print_image('images/wrench_blanco.png', true, ['width' => '16px'], false, false, true).' '.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_w.png', true).'
'; - $params['body_text'] = "'; - unset($table); - $table = new stdClass(); - $table->id = 'stat_win_form'; - $table->width = '100%'; - $table->cellspacing = 2; - $table->cellpadding = 2; - $table->class = 'databox'; - $data = []; - $data[0] = html_print_div( - [ - 'id' => 'field_list', - 'content' => $form_table, - 'style' => 'overflow: auto; height: 220px', - ], - true - ); - $table->data[] = $data; - $table->rowclass[] = ''; - - $params['body_text'] .= html_print_table($table, true); - $params['body_text'] .= ''; - $params['body_text'] .= '
'; - // outer - // ICONS - $params['icon_closed'] = '/images/graphmenu_arrow_hide.png'; - $params['icon_open'] = '/images/graphmenu_arrow.png'; - - // SIZE - $params['width'] = 500; - - // POSITION - $params['position'] = 'left'; - - html_print_side_layer($params); + echo '
+
+ show/hide + '.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).' + Manage +
+ +
'; // Hidden div to forced title html_print_div( @@ -491,11 +462,24 @@ ui_include_time_picker(true); $.datepicker.setDefaults($.datepicker.regional[""]); - $(window).ready(function() { - $("#field_list").css('height', ($(window).height() - 160) + 'px'); +//$(window).ready(function() { + $('.print_menu').append($('.module_graph_menu_dropdown')); +//}); + + + $('#module_graph_menu_header').on('click', function(){ + if( $('.module_graph_menu_content').hasClass('module_graph_menu_content_closed')){ + $('.module_graph_menu_content').show(); + $('.module_graph_menu_content').removeClass('module_graph_menu_content_closed'); + $('#module_graph_menu_header .imagen').attr('src',$('#module_graph_menu_header .imagen').attr('src').replace('arrow_down_green','arrow_up_green')) + } + else{ + $('.module_graph_menu_content').hide(); + $('.module_graph_menu_content').addClass('module_graph_menu_content_closed'); + $('#module_graph_menu_header .imagen').attr('src',$('#module_graph_menu_header .imagen').attr('src').replace('arrow_up_green','arrow_down_green')) + } + + }); - $(window).resize(function() { - $("#field_list").css('height', ($(document).height() - 160) + 'px'); - }); From fa14fa9510a2396f5dce0a82bf7ee5b41e036de4 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Tue, 7 May 2019 17:47:47 +0200 Subject: [PATCH 11/18] Show new values after update --- .../godmode/alerts/configure_alert_command.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/alerts/configure_alert_command.php b/pandora_console/godmode/alerts/configure_alert_command.php index 7482c21f63..3e93319b76 100644 --- a/pandora_console/godmode/alerts/configure_alert_command.php +++ b/pandora_console/godmode/alerts/configure_alert_command.php @@ -33,6 +33,7 @@ if (! check_acl($config['id_user'], 0, 'LM')) { $update_command = (bool) get_parameter('update_command'); $id = (int) get_parameter('id'); $pure = get_parameter('pure', 0); +$alert = []; // Header if (defined('METACONSOLE')) { @@ -86,7 +87,15 @@ if ($update_command) { $result = ''; } else { $result = alerts_update_alert_command($id, $values); - $info = '{"Name":"'.$name.'","Command":"'.$command.'","Description":"'.$description.' '.$info_fields.'"}'; + if ($result) { + $info = '{"Name":"'.$name.'","Command":"'.$command.'","Description":"'.$description.' '.$info_fields.'"}'; + $alert['fields_values'] = io_json_mb_encode($fields_values); + $alert['fields_descriptions'] = io_json_mb_encode($fields_descriptions); + $alert['name'] = $name; + $alert['command'] = $command; + $alert['description'] = $description; + $alert['id_group'] = $id_group; + } } if ($result) { @@ -110,7 +119,10 @@ $fields_descriptions = ''; $fields_values = ''; $id_group = 0; if ($id) { - $alert = alerts_get_alert_command($id); + if (!$result) { + $alert = alerts_get_alert_command($id); + } + $name = $alert['name']; $command = $alert['command']; $description = $alert['description']; From 5e0b53e3c23bdaef379fcd1520e827008420400b Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Wed, 8 May 2019 09:35:28 +0200 Subject: [PATCH 12/18] New menu module graph - #3617 --- pandora_console/include/styles/pandora.css | 116 +++++++++++++----- .../operation/agentes/stat_win.php | 54 ++++---- 2 files changed, 106 insertions(+), 64 deletions(-) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index a897c26247..ba026abbda 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -3598,6 +3598,78 @@ div.simple_value > a > span.text p { cursor: pointer; } +.events_show_more_table { + border-spacing: 0px; + text-align: left; +} + +/* Modal window - Show More */ +table.events_show_more_table tr:nth-child(odd) td { + background-color: #ffffff; +} +table.events_show_more_table tr:nth-child(even) td { + background-color: #f5f5f5; + border-top: 1px solid #cacaca; + border-bottom: 1px solid #cacaca; +} + +table.events_show_more_table tr td { + height: 22px; + padding: 4px; +} + +table.events_show_more_table tr td:first-child { + width: 35%; + font-weight: bold; + padding-left: 20px; +} + +ul.events_tabs { + background: #ffffff !important; + border: 0px; + display: flex; + justify-content: space-between; + padding: 0px !important; +} + +ul.events_tabs:before, +ul.events_tabs:after { + content: none !important; +} + +ul.events_tabs > li { + margin: 0 !important; + width: 20%; + text-align: center; + float: none !important; + outline-width: 0; +} + +ul.events_tabs > li.ui-state-default { + background: #fff !important; + border: none !important; + border-bottom: 2px solid black !important; +} + +ul.events_tabs > li a { + text-align: center; + float: none !important; + padding: 8px !important; + display: block; +} + +ul.events_tabs > li span { + position: relative; + top: -6px; + left: 5px; + margin-right: 10px; +} + +ul.events_tabs > li.ui-tabs-active { + border-bottom: 2px solid #82b92e !important; + border-top: 2px solid #82b92e !important; +} + /* * --------------------------------------------------------------------- * - modal window and edit user - @@ -5439,36 +5511,18 @@ table.info_table.policy_sub_table { align-items: flex-start; } -/* mergear esto antes */ - -table.events_show_more_table tr:nth-child(odd) td { - background-color: #ffffff; -} -table.events_show_more_table tr:nth-child(even) td { - background-color: #f5f5f5; - border-top: 1px solid #cacaca; - border-bottom: 1px solid #cacaca; -} - -table.events_show_more_table tr td { - height: 22px; - padding: 4px; -} - -table.events_show_more_table tr td:first-child { - width: 35%; - font-weight: bold; - padding-left: 20px; -} - -/* nuevassss */ +/* + * --------------------------------------------------------------------- + * - MODULE GRAPHS + * --------------------------------------------------------------------- + */ .module_graph_menu_dropdown { padding-top: 20px; padding-bottom: 20px; position: absolute; top: 10px; width: 100%; - z-index: 1; + z-index: 1001; } .module_graph_menu_content, @@ -5480,13 +5534,6 @@ table.events_show_more_table tr td:first-child { background-color: #fff; } -.module_graph_menu_content { - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - padding: 15px; - border-top: none; -} - .module_graph_menu_header { border-top-left-radius: 4px; border-top-right-radius: 4px; @@ -5501,3 +5548,10 @@ table.events_show_more_table tr td:first-child { vertical-align: middle; padding-left: 5px; } + +.module_graph_menu_content { + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + padding: 15px; + border-top: none; +} diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 767bc3de2a..f04a3eafa4 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -176,26 +176,7 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent); $unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $id); - - // MENU - $menu_form = "
".html_print_input_hidden('id', $id, true).html_print_input_hidden('label', $label, true); - - if (!empty($server_id)) { - $menu_form .= html_print_input_hidden('server', $server_id, true); - } - - if (isset($_GET['type'])) { - $type = get_parameter_get('type'); - $menu_form .= html_print_input_hidden('type', $type, true); - } - - echo $menu_form; - - echo ''; - - echo '
'; - - + // Graph. echo '
'; $width = '90%'; $height = '450'; @@ -250,7 +231,7 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent); - // FORM TABLE + // FORM TABLE. $table = html_get_predefined_table('transparent', 2); $table->width = '100%'; $table->id = 'stat_win_form_div'; @@ -405,15 +386,28 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent); ).'
'; + // Menu. + $menu_form = "
".html_print_input_hidden('id', $id, true).html_print_input_hidden('label', $label, true); - echo '
+ if (!empty($server_id)) { + $menu_form .= html_print_input_hidden('server', $server_id, true); + } + + if (isset($_GET['type'])) { + $type = get_parameter_get('type'); + $menu_form .= html_print_input_hidden('type', $type, true); + } + + echo $menu_form; + echo '
- show/hide + '.html_print_image('images/arrow_down_green.png', true, ['class' => 'module_graph_menu_arrow', 'float' => 'left'], false, false, true).' '.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).' - Manage + '.html_print_image('images/config.png', true, ['float' => 'right'], false, false, true).'
'; + echo ''; // Hidden div to forced title html_print_div( @@ -462,24 +456,18 @@ ui_include_time_picker(true); $.datepicker.setDefaults($.datepicker.regional[""]); -//$(window).ready(function() { - $('.print_menu').append($('.module_graph_menu_dropdown')); -//}); - - + // Menu. $('#module_graph_menu_header').on('click', function(){ if( $('.module_graph_menu_content').hasClass('module_graph_menu_content_closed')){ $('.module_graph_menu_content').show(); $('.module_graph_menu_content').removeClass('module_graph_menu_content_closed'); - $('#module_graph_menu_header .imagen').attr('src',$('#module_graph_menu_header .imagen').attr('src').replace('arrow_down_green','arrow_up_green')) + $('#module_graph_menu_header .module_graph_menu_arrow').attr('src',$('#module_graph_menu_header .module_graph_menu_arrow').attr('src').replace('arrow_down_green','arrow_up_green')) } else{ $('.module_graph_menu_content').hide(); $('.module_graph_menu_content').addClass('module_graph_menu_content_closed'); - $('#module_graph_menu_header .imagen').attr('src',$('#module_graph_menu_header .imagen').attr('src').replace('arrow_up_green','arrow_down_green')) + $('#module_graph_menu_header .module_graph_menu_arrow').attr('src',$('#module_graph_menu_header .module_graph_menu_arrow').attr('src').replace('arrow_up_green','arrow_down_green')) } - - }); From cb49de4d81ee7a81a5e6fe0db26c19e966129d00 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Wed, 8 May 2019 10:28:00 +0200 Subject: [PATCH 13/18] New menu module graph - #3617 --- pandora_console/include/javascript/tree/TreeController.js | 6 ++++-- pandora_console/operation/agentes/stat_win.php | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index 1ce416e770..b544dbfd95 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -747,9 +747,11 @@ var TreeController = { } } else { try { - winopeng( + winopeng_var( element.moduleGraph.url, - element.moduleGraph.handle + element.moduleGraph.handle, + 1000, + 650 ); } catch (error) { // console.log(error); diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index f04a3eafa4..ef4a448360 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -458,15 +458,18 @@ ui_include_time_picker(true); // Menu. $('#module_graph_menu_header').on('click', function(){ + var arrow = $('#module_graph_menu_header .module_graph_menu_arrow'); + var arrow_up = 'arrow_up_green'; + var arrow_down = 'arrow_down_green'; if( $('.module_graph_menu_content').hasClass('module_graph_menu_content_closed')){ $('.module_graph_menu_content').show(); $('.module_graph_menu_content').removeClass('module_graph_menu_content_closed'); - $('#module_graph_menu_header .module_graph_menu_arrow').attr('src',$('#module_graph_menu_header .module_graph_menu_arrow').attr('src').replace('arrow_down_green','arrow_up_green')) + arrow.attr('src',arrow.attr('src').replace(arrow_down, arrow_up)); } else{ $('.module_graph_menu_content').hide(); $('.module_graph_menu_content').addClass('module_graph_menu_content_closed'); - $('#module_graph_menu_header .module_graph_menu_arrow').attr('src',$('#module_graph_menu_header .module_graph_menu_arrow').attr('src').replace('arrow_up_green','arrow_down_green')) + arrow.attr('src',arrow.attr('src').replace(arrow_up, arrow_down)); } }); From 1644b492d2ccfa0e43cd0ec2af0239204c504be2 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 8 May 2019 18:29:33 +0200 Subject: [PATCH 14/18] fixed errors pdf SLA Weekly --- .../include/functions_reporting.php | 2 +- .../include/functions_reporting_html.php | 24 ++----------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 9b67d16b42..a877361766 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -11663,7 +11663,7 @@ function reporting_translate_sla_status_for_graph($status) * * @return html Return table of header. */ -function reporting_header_table_for_pdf(string $title='', string $description='') +function reporting_header_table_for_pdf($title='', $description='') { $result_pdf .= ''; $result_pdf .= ''; diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index dc6010e34a..10bef8631f 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -1026,11 +1026,9 @@ function reporting_html_event_report_group($table, $item, $pdf=0) if ($pdf) { $table0 = new stdClass(); $table0->width = '99%'; - $table0->class = 'table-beauty'; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $pdf_export = html_print_table($table0, true); - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1046,7 +1044,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_agent']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1064,7 +1061,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_user_validator']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1082,7 +1078,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_criticity']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1100,7 +1095,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['validated_vs_unvalidated']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1117,7 +1111,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0) if ($pdf) { $table0 = new stdClass(); $table0->width = '99%'; - $table0->class = 'table-beauty'; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $pdf_export = html_print_table($table0, true); @@ -1233,11 +1226,9 @@ function reporting_html_event_report_module($table, $item, $pdf=0) if ($pdf) { $table0 = new stdClass(); $table0->width = '99%'; - $table0->class = 'table-beauty'; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $pdf_export = html_print_table($table0, true); - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1253,7 +1244,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_agent']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1271,7 +1261,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_user_validator']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1289,7 +1278,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_criticity']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1307,7 +1295,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['validated_vs_unvalidated']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1326,7 +1313,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0) if ($pdf) { $table0 = new stdClass(); $table0->width = '99%'; - $table0->class = 'table-beauty'; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $pdf_export = html_print_table($table0, true); @@ -2021,11 +2007,9 @@ function reporting_html_event_report_agent($table, $item, $pdf=0) if ($pdf) { $table0 = new stdClass(); $table0->width = '99%'; - $table0->class = 'table-beauty'; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $pdf_export = html_print_table($table0, true); - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -2042,7 +2026,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_user_validator']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -2060,7 +2043,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_criticity']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -2078,7 +2060,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['validated_vs_unvalidated']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -2095,7 +2076,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0) if ($pdf) { $table0 = new stdClass(); $table0->width = '99%'; - $table0->class = 'table-beauty'; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $pdf_export = html_print_table($table0, true); @@ -2438,7 +2418,7 @@ function reporting_html_alert_report($table, $item, $pdf=0) $table->data['alerts']['cell'] = html_print_table($table1, true); if ($pdf) { - $table1->class = 'table-beauty pdf_alert_table'; + $table1->class = 'pdf_alert_table'; return html_print_table($table1, true); } } @@ -4937,7 +4917,7 @@ function reporting_html_planned_downtimes_table($planned_downtimes) if ($for_pdf) { $table->titlestyle = 'background: #373737; color: #FFF; display: table-cell; font-size: 12px; border: 1px solid grey'; - $table->class = 'table_sla table_beauty'; + $table->class = 'table_sla'; for ($i = 0; $i < count($table->head); $i++) { $table->headstyle[$i] = 'background: #666; color: #FFF; display: table-cell; font-size: 11px; border: 1px solid grey'; From fd83540ad5fd2f61fce45cbf3a119d23d4fe2534 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Thu, 9 May 2019 12:39:03 +0200 Subject: [PATCH 15/18] New menu module graph for interface modules- #3617 --- .../agentes/interface_traffic_graph_win.php | 96 +++++++++---------- 1 file changed, 47 insertions(+), 49 deletions(-) diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index 72e8f8989f..e00ed0d254 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -96,7 +96,7 @@ if ($refresh > 0) { --> - + $now) { $urlImage = ui_get_full_url(false); - echo '
'; + // Graph. + echo '
'; $height = 400; $width = '90%'; @@ -177,27 +178,14 @@ if ($date > $now) { echo '
'; - // - // SIDE MENU - // - $side_layer_params = []; - // TOP TEXT - $side_layer_params['top_text'] = "
".html_print_image('/images/config.disabled.png', true, ['width' => '16px'], false, false, false, true).' '.__('Graph configuration menu').'
'; - $side_layer_params['body_text'] = "'; - // outer - // ICONS - $side_layer_params['icon_closed'] = '/images/graphmenu_arrow_hide.png'; - $side_layer_params['icon_open'] = '/images/graphmenu_arrow.png'; - - // SIZE - $side_layer_params['width'] = 500; - - // POSITION - $side_layer_params['position'] = 'left'; - - html_print_side_layer($side_layer_params); + echo $menu_form; + echo '
+
+ '.html_print_image('images/arrow_down_green.png', true, ['class' => 'module_graph_menu_arrow', 'float' => 'left'], false, false, true).' + '.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).' + '.html_print_image('images/config.png', true, ['float' => 'right'], false, false, true).' +
+ +
'; + echo ''; // Hidden div to forced title html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true]); @@ -341,4 +321,22 @@ ui_include_time_picker(true); $.datepicker.setDefaults($.datepicker.regional[""]); forced_title_callback(); + + // Menu. + $('#module_graph_menu_header').on('click', function(){ + var arrow = $('#module_graph_menu_header .module_graph_menu_arrow'); + var arrow_up = 'arrow_up_green'; + var arrow_down = 'arrow_down_green'; + if( $('.module_graph_menu_content').hasClass('module_graph_menu_content_closed')){ + $('.module_graph_menu_content').show(); + $('.module_graph_menu_content').removeClass('module_graph_menu_content_closed'); + arrow.attr('src',arrow.attr('src').replace(arrow_down, arrow_up)); + } + else{ + $('.module_graph_menu_content').hide(); + $('.module_graph_menu_content').addClass('module_graph_menu_content_closed'); + arrow.attr('src',arrow.attr('src').replace(arrow_up, arrow_down)); + } + }); + From 9b51928e350b7e48dcc589895d659cc94140d517 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 9 May 2019 16:01:51 +0200 Subject: [PATCH 16/18] Added HTML edit feature, needed because TinyEdit adds lot's of HTML and is not practical. You need to edit the contents in HTML. Is not a security issue, because only admin can edit this news contents. Former-commit-id: 4039346ffe4fc2628f515b4cdaeaf1655377e74b --- pandora_console/godmode/setup/news.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/setup/news.php b/pandora_console/godmode/setup/news.php index 4e51181b8a..61491496f5 100644 --- a/pandora_console/godmode/setup/news.php +++ b/pandora_console/godmode/setup/news.php @@ -331,7 +331,7 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/'); theme : "advanced", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", - theme_advanced_buttons1 : "bold,italic, |, image, link, |, cut, copy, paste, |, undo, redo, |, forecolor, |, fontsizeselect, |, justifyleft, justifycenter, justifyright", + theme_advanced_buttons1 : "bold,italic, |, image, link, |, cut, copy, paste, |, undo, redo, |, forecolor, |, fontsizeselect, |, justifyleft, justifycenter, justifyright, | ,code", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", convert_urls : false, From 5126c651f7ce8ac32baf5e5d4ac658dbee87878c Mon Sep 17 00:00:00 2001 From: Marcos Alconada Date: Thu, 9 May 2019 17:38:40 +0200 Subject: [PATCH 17/18] Changed '' of query --- pandora_console/extras/mr/28.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/extras/mr/28.sql b/pandora_console/extras/mr/28.sql index 5d61a98318..e4dfe8fe9b 100644 --- a/pandora_console/extras/mr/28.sql +++ b/pandora_console/extras/mr/28.sql @@ -1,5 +1,5 @@ START TRANSACTION; -DELETE FROM 'tevent_response' WHERE 'name' LIKE 'Create Integria IMS incident from event'; +DELETE FROM `tevent_response` WHERE `name` LIKE 'Create Integria IMS incident from event'; COMMIT; From 3119278b2662c4bfc293261309bade41807d84d5 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 10 May 2019 00:01:14 +0200 Subject: [PATCH 18/18] Auto-updated build strings. Former-commit-id: 1dc55561e83817f91b38b437d57e479fb13f3ac3 --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index cebf58c0cc..e5ce7197b1 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.734-190509 +Version: 7.0NG.734-190510 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 05ee21ba04..d6937b6849 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.734-190509" +pandora_version="7.0NG.734-190510" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index fb8671b220..cbb9a72d25 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.734'; -use constant AGENT_BUILD => '190509'; +use constant AGENT_BUILD => '190510'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 8b89542a17..a473681428 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.734 -%define release 190509 +%define release 190510 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 4c5fed356c..8f4c593eab 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.734 -%define release 190509 +%define release 190510 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index e18f072efc..92c4545bab 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.734" -PI_BUILD="190509" +PI_BUILD="190510" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 20da7b7ae4..a964fdec1e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190509} +{190510} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 7a34c41bbe..ff4e0beb79 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.734(Build 190509)") +#define PANDORA_VERSION ("7.0NG.734(Build 190510)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index d792109417..88eb352bc8 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.734(Build 190509))" + VALUE "ProductVersion", "(7.0NG.734(Build 190510))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 11235f2a12..6b3a3f7da5 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.734-190509 +Version: 7.0NG.734-190510 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 7f82def4f9..04b9f9bf47 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.734-190509" +pandora_version="7.0NG.734-190510" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 20e2fb9004..a7ab314bb4 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC190509'; +$build_version = 'PC190510'; $pandora_version = 'v7.0NG.734'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 614151bc47..80deb2e787 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 73d08f06a5..36e47fffbf 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.734 -%define release 190509 +%define release 190510 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 231349ee24..e9dbbf97bb 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.734 -%define release 190509 +%define release 190510 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 1896c72705..078df43672 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.734" -PI_BUILD="190509" +PI_BUILD="190510" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 881f73940b..00fcc25297 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.734 PS190509"; +my $version = "7.0NG.734 PS190510"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index babf1f7eff..1977eb37b9 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.734 PS190509"; +my $version = "7.0NG.734 PS190510"; # save program name for logging my $progname = basename($0);