From d12791c03f9dcf0fc93b9992272c425c9cb12cc8 Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" Date: Thu, 25 Oct 2018 10:41:40 +0200 Subject: [PATCH 001/209] Added parameter width id agent - #2958 --- pandora_console/godmode/alerts/alert_list.builder.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index d32ab3ed48..5092d9b5f0 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -65,6 +65,8 @@ if (! $id_agente) { $params['selectbox_id'] = 'id_agent_module'; $params['javascript_is_function_select'] = true; $params['metaconsole_enabled'] = false; + $params['use_hidden_input_idagent'] = true; + $params['print_hidden_input_idagent'] = true; $table->data['agent'][1] = ui_print_agent_autocomplete_input($params); } From 4b522d3f0349f92c32b80b52064905b54162f78d Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" Date: Thu, 25 Oct 2018 13:18:28 +0200 Subject: [PATCH 002/209] Added disabled field in sql query - #2955 --- pandora_console/include/functions_groupview.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/include/functions_groupview.php b/pandora_console/include/functions_groupview.php index 15b4d577bf..41ada4fecf 100644 --- a/pandora_console/include/functions_groupview.php +++ b/pandora_console/include/functions_groupview.php @@ -68,6 +68,7 @@ function groupview_get_modules_counters($groups_ids = false) { ta.id_grupo AS g FROM $table ta WHERE ta.id_grupo IN ($groups_ids) + AND ta.disabled = 0 GROUP BY ta.id_grupo UNION ALL SELECT SUM(ta.normal_count) AS module_normal, From e3b7f33287f9ade162d77c64a949a8bc3daa6ddc Mon Sep 17 00:00:00 2001 From: samucarc Date: Thu, 25 Oct 2018 13:26:35 +0200 Subject: [PATCH 003/209] Added improvements in the creation of agents in the meta console --- pandora_console/images/success.png | Bin 0 -> 1486 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 pandora_console/images/success.png diff --git a/pandora_console/images/success.png b/pandora_console/images/success.png new file mode 100644 index 0000000000000000000000000000000000000000..0dcd96a046286bf469b6f84dc782ad79642ce8f7 GIT binary patch literal 1486 zcmbVMeQXnD7=O3UG1+abI$<(0Z&y&1ws+TFyY^_ewY_#NS?AoEFb$Dj?`~_ewRgMT zY_|~IhQda|M5Ylj5n_mvN#-yFAqZ}RCL01A9wrU8D7({Elb09m&ObZXkif|Ui};Kh)D z`l4)$&>*mUXZvS@4FFX*5@=GI{IxVEM)hnOqfbU9$Ogbxm6TYnRZ!57&=QH+v8yLO z#?T0F$2OY$gkN$A;fS|O78<+i0$f)sXXUY~O4OF5p@FENuxK*c7K_tKJ2q#RhUc^z z$Iv;5(rU-<2G!)RM_r;Upe8+`;|Mc}nkhX=5mw5oMGXW=;G_X3Ds&`4n<{96MCTt2 zdXxEPx`FY``+|}k3oD95<9H&G&?k&~QEtIWtJR7V2HarKL4+>e8B^G#E*95hEHFZx zlOvK65o2iDA{!Dr6gvhZy_-T*^7|JI$Kvyaf+fR~tb~(#0*^-1dCj5YN`vrE7>lCg zflf)l8-%#nA#<=F&6*4u*6!Yp(m)su{iGa$O<~&@k?V*GF~!H&G5AN%M|j#}t?-a! z1w~XC2(yJGtp+DyAx$nb<)$b%ULo*s{XjY~!a zXE1$S7=9=$td9_bJ0rv8NKJoL1NU>*$2bDXZ$q=GRFw)D>F&GzS7A{7=$`Q4q{Gt< zLN7kf^=?SDOjlBcV) zX>1r-rL`fa_Rb*064QojL&WT@>-X{H_qsLuXycK9-{CXU_Ml1iB_mW~eaJv%PGTT;jEdT1haYvz|y)%yGur{BYumAvy- zU3G!8zK{IvoU>5PgQI1w!JrCcF-M#u7rdt`mmNU%%l*}l>8kH93xeL&UvlJ>s{SzQ zEzm9}i(d-&Zgqo|O5c$Xrq0_K5KioLY#i?ybCZKv%TJ9+IW_M&w~6L&zLs^|M-;Ck+k z{GP0w4gELU4|um+QWdSsHvY7vc!kqd`aauWqmiDyYmktw=+k}AfAAW6?)O;M!Droy zYHXcB&_~~WF5NucUVL&Yw|AWR@sI73$m^R| zfznGuyOB=_(4ii_c7`Z=HGcJl)O804=now)^j*!}J&gQ1oY=p5vz86_z0!8D?A+Jc bwMZZrNQrB2bPe7#rf*oEyN(%l27CVo^BnhQ literal 0 HcmV?d00001 From ad652c82fa0eb48407722f2f1c50135c816c10de Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Thu, 25 Oct 2018 13:56:17 +0200 Subject: [PATCH 004/209] fixed english and spanish version of plugin-in macros help dialog --- pandora_console/include/help/en/help_plugin_macros.php | 8 ++++---- pandora_console/include/help/es/help_plugin_macros.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/help/en/help_plugin_macros.php b/pandora_console/include/help/en/help_plugin_macros.php index 1660c45e13..6d1e508b21 100644 --- a/pandora_console/include/help/en/help_plugin_macros.php +++ b/pandora_console/include/help/en/help_plugin_macros.php @@ -31,10 +31,10 @@ Hidden this macros because they cannot edit in the module form -->
  • _plugin_parameters_ : Plug-in Parameters of the module.
  • -
  • _name_tag_ : Nombre de los tags asociados al módulo.
  • -
  • _email_tag_ : Emails asociados a los tags de módulos.
  • -
  • _phone_tag_ : Teléfonos asociados a los tags de módulos.
  • -
  • _moduletags_ : Teléfonos asociados a los tags de módulos.
  • +
  • _name_tag_ : Names of the tags associated to the module.
  • +
  • _email_tag_ : Emails associated to module tags.
  • +
  • _phone_tag_ : Phone numbers associated to module tags.
  • +
  • _moduletags_ : URLs associated to module tags.
  • _agentcustomfield_n_: Agent custom field number n (eg. _agentcustomfield_9_).
  • diff --git a/pandora_console/include/help/es/help_plugin_macros.php b/pandora_console/include/help/es/help_plugin_macros.php index 701d15f35e..77c97aa4d7 100644 --- a/pandora_console/include/help/es/help_plugin_macros.php +++ b/pandora_console/include/help/es/help_plugin_macros.php @@ -30,9 +30,9 @@ Hidden this macros because they cannot edit in the module form -->

  • _plugin_parameters_ : Parámetros del Plug-in del módulo.
  • -
  • _name_tag_ : Names of the tags associated to the module.
  • -
  • _email_tag_ : Emails associated to the module tags.
  • -
  • _phone_tag_ : Phone numbers associated to the module tags.
  • -
  • _moduletags_ : URLs associated to the module tags.
  • +
  • _name_tag_ : Nombre de los tags asociados al módulo.
  • +
  • _email_tag_ : Emails asociados a los tags de módulos.
  • +
  • _phone_tag_ : Teléfonos asociados a los tags de módulos.
  • +
  • _moduletags_ : URLs asociadas a los tags de módulos.
  • _agentcustomfield_n_: Campo personalizado número n del agente (eg. _agentcustomfield_9_).
  • From 2849d62faa6e8cd62101b9bf31d723ed5c85f026 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Thu, 25 Oct 2018 19:48:23 +0200 Subject: [PATCH 005/209] Add generic API functions set access control and traps functions - #2978 --- pandora_console/include/functions_api.php | 276 ++++++++++++++++++++++ 1 file changed, 276 insertions(+) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index a2fc33d938..cff419acb4 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -30,6 +30,7 @@ include_once($config['homedir'] . "/include/functions_network_components.php"); include_once($config['homedir'] . "/include/functions_netflow.php"); include_once($config['homedir'] . "/include/functions_servers.php"); include_once($config['homedir'] . "/include/functions_planned_downtimes.php"); +include_once($config['homedir'] . "/include/functions_db.php"); enterprise_include_once ('include/functions_local_components.php'); enterprise_include_once ('include/functions_events.php'); enterprise_include_once ('include/functions_agents.php'); @@ -11505,7 +11506,282 @@ function util_api_check_agent_and_print_error($id_agent, $returnType, $access = return false; } +function api_get_user_info($thrash1, $thrash2, $other, $returnType) { + if (defined ('METACONSOLE')) { + return; + } + + $separator = ';'; + + $other = json_decode(base64_decode($other['data']),true); + + $sql = 'select * from tusuario where id_user = "'.$other[0]['id_user'].'" and password = "'.$other[0]['password'].'"'; + + $user_info = db_get_all_rows_sql($sql); + if (count($user_info) > 0 and $user_info !== false) { + $data = array('type' => 'array', 'data' => $user_info); + returnData($returnType, $data, $separator); + } + else { + return 0; + } +} + + +/* + +This function receives different parameters to process one of these actions the logging process in our application from the records in the audit of pandora fms, to avoid concurrent access of administrator users, and optionally to prohibit access to non-administrator users: + +Parameter 0 + +The User ID that attempts the action is used to check the status of the application for access. + +Parameter 1 + +Login, logout, exclude, browse. + +These requests receive a response that we can treat as we consider, this function only sends answers, does not perform any action in your application, you must customize them. + +Login action: free (register our access), taken, denied (if you are not an administrator user and parameter four is set to 1, register the expulsion). + +Browse action: It has the same answers as login, but does not register anything in the audit. + +Logout action: It records the deslogeo but does not send a response. + +All other actions do not return a response, + +Parameter 2 + +IP address of the application is also used to check the status of the application for access. + +Parameter 3 + +Name of the application, it is also used to check the status of the application for access. + +Parameter 4 + +If you mark 1 you will avoid the access to the non-administrators users, returning the response `denied' and registering that expulsion in the audit of pandora fms. + +*/ + + + +function api_set_access_process($thrash1, $thrash2, $other, $returnType) { + if (defined ('METACONSOLE')) { + return; + } + + $other['data'] = explode('|',$other['data']); + + $sql = 'select id_usuario,utimestamp from tsesion where descripcion like "%'.$other['data'][2].'%" and accion like "%'.$other['data'][3].' Logon%" and id_usuario IN (select id_user from tusuario where is_admin = 1) and id_usuario != "'.$other['data'][0].'" order by utimestamp DESC limit 1'; + $audit_concurrence = db_get_all_rows_sql($sql); + $sql_user = 'select id_usuario,utimestamp from tsesion where descripcion like "%'.$other['data'][2].'%" and accion like "%'.$other['data'][3].' Logon%" and id_usuario IN (select id_user from tusuario where is_admin = 1) and id_usuario = "'.$other['data'][0].'" order by utimestamp DESC limit 1'; + $audit_concurrence_user = db_get_all_rows_sql($sql_user); + $sql2 = 'select id_usuario,utimestamp,accion from tsesion where descripcion like "%'.$other['data'][2].'%" and accion like "%'.$other['data'][3].' Logoff%" and id_usuario = "'.$audit_concurrence[0]['id_usuario'].'" order by utimestamp DESC limit 1'; + $audit_concurrence_2 = db_get_all_rows_sql($sql2); + + //The user trying to log in is an administrator + if(users_is_admin($other['data'][0])){ + //The admin user is trying to login + if($other['data'][1] == 'login'){ + // Check if there is an administrator user logged in prior to our last login + if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_user[0]['utimestamp']){ + // Check if the administrator user logged in later to us has unlogged and left the node free + if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_2[0]['utimestamp']){ + // The administrator user logged in later has not yet unlogged + returnData('string', array('type' => 'string', 'data' => 'taken')); + } + else{ + // The administrator user logged in later has already unlogged + returnData('string', array('type' => 'string', 'data' => 'free')); + } + } + else{ + // There is no administrator user who has logged in since then to log us in. + db_pandora_audit($other['data'][3].' Logon', 'Logged in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]); + returnData('string', array('type' => 'string', 'data' => 'free')); + } + + } + elseif ($other['data'][1] == 'logout') { + // The administrator user wants to log out + db_pandora_audit($other['data'][3].' Logoff', 'Logout from '.$other['data'][3].' node '.$other['data'][2], $other['data'][0]); + } + elseif ($other['data'][1] == 'exclude') { + // The administrator user has ejected another administrator user who was logged in + db_pandora_audit($other['data'][3].' Logon', 'Logged in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]); + db_pandora_audit($other['data'][3].' Logoff', 'Logout from '.$other['data'][3].' node '.$other['data'][2] , $audit_concurrence[0]['id_usuario']); + + } + //The admin user is trying to browse + elseif ($other['data'][1] == 'browse') { + // Check if there is an administrator user logged in prior to our last login + if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_user[0]['utimestamp']){ + // Check if the administrator user logged in later to us has unlogged and left the node free + if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_2[0]['utimestamp']){ + // The administrator user logged in later has not yet unlogged + returnData('string', array('type' => 'string', 'data' => $audit_concurrence[0]['id_usuario'])); + } + else{ + // The administrator user logged in later has already unlogged + returnData('string', array('type' => 'string', 'data' => 'free')); + } + } + else{ + // There is no administrator user who has logged in since then to log us in. + returnData('string', array('type' => 'string', 'data' => 'free')); + } + + } + elseif ($other['data'][1] == 'cancelled'){ + //The administrator user tries to log in having another administrator logged in, but instead of expelling him he cancels his log in. + db_pandora_audit($other['data'][3].' cancelled access', 'Cancelled access in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]); + returnData('string', array('type' => 'string', 'data' => 'cancelled')); + } + +} +else{ + + if($other['data'][4] == 1){ + //The user trying to log in is not an administrator and is not allowed no admin access + db_pandora_audit($other['data'][3].' denied access', 'Denied access to non-admin user '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]); + returnData('string', array('type' => 'string', 'data' => 'denied')); + } + else{ + //The user trying to log in is not an administrator and is allowed no admin access + if($other['data'][1] == 'login'){ + //The user trying to login is not admin, can enter without concurrent use filter + db_pandora_audit($other['data'][3].' Logon', 'Logged in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]); + returnData('string', array('type' => 'string', 'data' => 'free')); + + } + elseif ($other['data'][1] == 'logout') { + //The user trying to logoff is not admin + db_pandora_audit($other['data'][3].' Logoff', 'Logout from '.$other['data'][3].' node '.$other['data'][2], $other['data'][0]); + } + elseif ($other['data'][1] == 'browse'){ + //The user trying to browse in an app page is not admin, can enter without concurrent use filter + returnData('string', array('type' => 'string', 'data' => 'free')); + } + } + } +} + + +function api_get_traps($thrash1, $thrash2, $other, $returnType) { + + if (defined ('METACONSOLE')) { + return; + } + + $other['data'] = explode('|',$other['data']); + + $other['data'][1] = date("Y-m-d H:i:s",$other['data'][1]); + + $sql = 'SELECT * from ttrap where timestamp >= "'.$other['data'][1].'"'; + + // $sql = 'SELECT * from ttrap where source = "'.$other['data'][0].'" and timestamp >= "'.$other['data'][1].'"'; + + if($other['data'][4]){ + $other['data'][4] = date("Y-m-d H:i:s",$other['data'][4]); + $sql .= ' and timestamp <= "'.$other['data'][4].'"'; + } + + if($other['data'][2]){ + $sql .= ' limit '.$other['data'][2]; + } + + if($other['data'][3]){ + $sql .= ' offset '.$other['data'][3]; + } + + if($other['data'][5]){ + $sql .= ' and status = 0'; + } + + if(sizeof($other['data']) == 0){ + $sql = 'SELECT * from ttrap'; + } + + + $traps = db_get_all_rows_sql($sql); + + if($other['data'][6]){ + + foreach ($traps as $key => $value) { + + if(!strpos($value['oid_custom'],$other['data'][6]) && $other['data'][7] == 'false'){ + unset($traps[$key]); + } + + if(strpos($value['oid_custom'],$other['data'][6]) && $other['data'][7] == 'true'){ + unset($traps[$key]); + } + + } + + } + + $traps_json = json_encode($traps); + + if (count($traps) > 0 and $traps !== false) { + returnData('string', array('type' => 'string', 'data' => $traps_json)); + } + else { + return 0; + } + +} + +function api_set_validate_traps ($id, $thrash2, $other, $thrash3) { + + if (defined ('METACONSOLE')) { + return; + } + + if($id == 'all'){ + $result = db_process_sql_update('ttrap',array('status' => 1)); + } + else{ + $result = db_process_sql_update('ttrap', + array('status' => 1), array('id_trap' => $id)); + } + + if (is_error($result)) { + // TODO: Improve the error returning more info + returnError('error_update_trap', __('Error in trap update.')); + } + else { + returnData('string', + array('type' => 'string', + 'data' => __('Validated traps.'))); + } + } + +function api_set_delete_traps ($id, $thrash2, $other, $thrash3) { + + if (defined ('METACONSOLE')) { + return; + } + + if($id == 'all'){ + $result = db_process_sql ('delete from ttrap'); + } + else{ + $result = db_process_sql_delete('ttrap',array('id_trap' => $id)); + } + + if (is_error($result)) { + // TODO: Improve the error returning more info + returnError('error_delete_trap', __('Error in trap delete.')); + } + else { + returnData('string', + array('type' => 'string', + 'data' => __('Deleted traps.'))); + } + } From 7634a41e04df365ffca896d764e88f4a275b0bb3 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Thu, 25 Oct 2018 20:01:04 +0200 Subject: [PATCH 006/209] Api meta functions new,update,delete,get users - #2523 --- pandora_console/include/functions_api.php | 50 +++++++++++++++++++---- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index a2fc33d938..7897b3cf12 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -30,6 +30,7 @@ include_once($config['homedir'] . "/include/functions_network_components.php"); include_once($config['homedir'] . "/include/functions_netflow.php"); include_once($config['homedir'] . "/include/functions_servers.php"); include_once($config['homedir'] . "/include/functions_planned_downtimes.php"); +include_once($config['homedir'] . "/include/functions_db.php"); enterprise_include_once ('include/functions_local_components.php'); enterprise_include_once ('include/functions_events.php'); enterprise_include_once ('include/functions_agents.php'); @@ -6917,9 +6918,9 @@ function api_get_graph_module_data($id, $thrash1, $other, $thrash2) { function api_set_new_user($id, $thrash2, $other, $thrash3) { global $config; - if (defined ('METACONSOLE')) { - return; - } + // if (defined ('METACONSOLE')) { + // return; + // } if(!check_acl($config['id_user'], 0, "UM")) { returnError('forbidden', 'string'); @@ -6936,6 +6937,10 @@ function api_set_new_user($id, $thrash2, $other, $thrash3) { $values['phone'] = $other['data'][6]; $values['language'] = $other['data'][7]; $values['comments'] = $other['data'][8]; + $values['time_autorefresh'] = $other['data'][9]; + $values['default_event_filter'] = $other['data'][10]; + $values['section'] = $other['data'][11]; + $values['session_time'] = $other['data'][12]; if (!create_user ($id, $password, $values)) returnError('error_create_user', 'Error create user'); @@ -6980,7 +6985,12 @@ function api_set_update_user($id, $thrash2, $other, $thrash3) { 'comments', 'is_admin', 'block_size', - 'flash_chart'); + 'flash_chart', + 'time_autorefresh', + 'default_event_filter', + 'section', + 'session_time' + ); if ($id == "") { @@ -6998,6 +7008,7 @@ function api_set_update_user($id, $thrash2, $other, $thrash3) { } $cont = 0; + foreach ($fields_user as $field) { if ($other['data'][$cont] != "" and $field != "password") { $values[$field] = $other['data'][$cont]; @@ -8603,9 +8614,9 @@ function api_get_events($trash1, $trash2, $other, $returnType, $user_in_db = nul function api_set_delete_user($id, $thrash1, $thrash2, $thrash3) { global $config; - if (defined ('METACONSOLE')) { - return; - } + // if (defined ('METACONSOLE')) { + // return; + // } if (!check_acl($config['id_user'], 0, "UM")) { returnError('forbidden', 'string'); @@ -11505,6 +11516,31 @@ function util_api_check_agent_and_print_error($id_agent, $returnType, $access = return false; } +function api_get_users($thrash1, $thrash2, $other, $returnType) { + + global $config; + + $user_info = get_users(); + + if (!isset($returnType) || empty($returnType) || $returnType == '') { + $returnType = "json"; + $data['data'] = "json"; + } + + if (!isset($separator) || empty($separator) || $separator == '') { + $separator = ";"; + } + + $data['data'] = $user_info; + + if (count($data) > 0 and $data !== false) { + returnData($returnType, $data, $separator); + } + else { + returnError('error_users', 'No users retrieved.'); + } + + } From da91b4d25f4e884250cd7961f6a25f4a07ba4acd Mon Sep 17 00:00:00 2001 From: Kike Date: Mon, 29 Oct 2018 16:16:03 +0100 Subject: [PATCH 007/209] Solved errors in mobile events view --- pandora_console/include/functions_events.php | 34 +++++++++++--------- pandora_console/mobile/operation/events.php | 16 +++++---- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index ce5d2f0c42..d88e1716b9 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -95,21 +95,25 @@ function events_get_events ($filter = false, $fields = false) { * * @return mixed False in case of error or invalid values passed. Event row otherwise */ -function events_get_event ($id, $fields = false) { - if (empty ($id)) - return false; - global $config; - - if (is_array ($fields)) { - if (! in_array ('id_grupo', $fields)) - $fields[] = 'id_grupo'; - } - - $event = db_get_row ('tevento', 'id_evento', $id, $fields); - if (! check_acl ($config['id_user'], $event['id_grupo'], 'ER')) - return false; - - return $event; +function events_get_event ($id, $fields = false, $meta = false) { + if (empty ($id)) + return false; + global $config; + + if (is_array ($fields)) { + if (! in_array ('id_grupo', $fields)) + $fields[] = 'id_grupo'; + } + + if ($meta === true){ + $event = db_get_row ('tmetaconsole_event', 'id_evento', $id, $fiel ds); + }else{ + $event = db_get_row ('tevento', 'id_evento', $id, $fields); + } + if (! check_acl ($config['id_user'], $event['id_grupo'], 'ER')) + return false; + + return $event; } function events_get_events_no_grouped($sql_post, $offset = 0, $pagination = 1, $meta = false, $history = false, $total = false, diff --git a/pandora_console/mobile/operation/events.php b/pandora_console/mobile/operation/events.php index d60fc248cc..064ecf65d1 100644 --- a/pandora_console/mobile/operation/events.php +++ b/pandora_console/mobile/operation/events.php @@ -297,7 +297,7 @@ class Events { $id_event = $system->getRequest('id_event', 0); - if (events_change_status($id_event, EVENT_VALIDATE)) { + if (events_change_status($id_event, EVENT_VALIDATE,$system->getConfig('metaconsole'))) { echo json_encode(array('correct' => 1)); } else { @@ -379,11 +379,15 @@ class Events { $this->default_filters['severity'] = false; } - $this->filter = $system->getRequest('filter', __('Preset Filters')); - if (($this->filter === __("Preset Filters")) || ($this->filter == 0)) { - $this->filter = 0; - } - else { + if ($system->getRequest('filter', __('Preset Filters')) === __("Preset Filters")) { + //Set filter as default user event filter (only first time) + $this->filter = db_get_value('default_event_filter', 'tusuario', 'id_user', $system->getConfig('id_user')); + } + else { + $this->filter = $system->getRequest('filter', __('Preset Filters')); + } + + if ($this->filter != 0) { $this->default = false; } From 8b53dbc444a38444c398d1071a1585f5320e50cf Mon Sep 17 00:00:00 2001 From: Kike Date: Mon, 29 Oct 2018 17:44:09 +0100 Subject: [PATCH 008/209] Corrected typing error --- pandora_console/include/functions_events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index d88e1716b9..cf9016b749 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -106,7 +106,7 @@ function events_get_event ($id, $fields = false, $meta = false) { } if ($meta === true){ - $event = db_get_row ('tmetaconsole_event', 'id_evento', $id, $fiel ds); + $event = db_get_row ('tmetaconsole_event', 'id_evento', $id, $fields); }else{ $event = db_get_row ('tevento', 'id_evento', $id, $fields); } From 74016c928fea3a17769c18b83c5e4066853a5f4d Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 30 Oct 2018 10:20:31 +0100 Subject: [PATCH 009/209] fixed bug: failing load of post process and unit fields in plugin component in module creation --- .../agentes/module_manager_editor_common.php | 2 +- pandora_console/include/javascript/pandora.js | 43 ++++++++++++++++++- .../include/javascript/pandora_modules.js | 19 +++++++- 3 files changed, 59 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 0527bea08d..19dcc94ffa 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -439,7 +439,7 @@ $table_advanced->data[2][1] .= html_print_input_hidden ('moduletype', $moduletyp $table_advanced->data[2][3] = __('Post process').' ' . ui_print_help_icon ('postprocess', true); $table_advanced->data[2][4] = html_print_extended_select_for_post_process('post_process', - $post_process, '', '', '0', false, true, false, true, + $post_process, '', '', '0', false, true, false, false, $disabledBecauseInPolicy); $table_advanced->colspan[2][4] = 3; diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 2b323a55f1..1ca0759801 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -594,12 +594,51 @@ function post_process_select_init_unit(name,selected) { function post_process_select_events_unit(name,selected) { $('.' + name + '_toggler').click(function() { - $('#' + name + '_select option[value=none]').attr("selected",true); - $('#text-' + name + '_text').val(""); + var value = $('#text-' + name + '_text').val(); + + var count = $('#' + name + '_select option') + .filter(function(i, item) { + + if ($(item).val() == value) + return true; + else return false; + }) + .length; + + if (count != 1) { + $('#' + name + '_select') + .append($("