From 3252832cc7762ad386cbc7d7a298affd6c367e2a Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Thu, 20 Jan 2022 10:55:23 +0100 Subject: [PATCH] WIP: Check audit logs --- pandora_console/ajax.php | 10 +- pandora_console/extensions/agents_modules.php | 7 +- pandora_console/extensions/api_checker.php | 2 +- pandora_console/extensions/db_status.php | 2 +- pandora_console/extensions/dbmanager.php | 5 +- .../extensions/disabled/matrix_events.php | 5 +- .../extensions/extension_uploader.php | 7 +- pandora_console/extensions/files_repo.php | 5 +- pandora_console/extensions/insert_data.php | 5 +- .../extensions/matrix_events/ajax.php | 5 +- pandora_console/extensions/module_groups.php | 2 +- pandora_console/extensions/pandora_logs.php | 5 +- pandora_console/extensions/quick_shell.php | 2 +- .../extensions/resource_exportation.php | 10 +- .../extensions/resource_registration.php | 36 +- .../general/first_task/HA_cluster_builder.php | 2 +- .../general/first_task/cluster_builder.php | 2 +- .../godmode/agentes/agent_incidents.php | 2 +- .../godmode/agentes/agent_manager.php | 5 +- .../godmode/agentes/configurar_agente.php | 64 +- .../godmode/agentes/configure_field.php | 5 +- .../godmode/agentes/fields_manager.php | 2 +- .../godmode/agentes/modificar_agente.php | 12 +- .../godmode/agentes/module_manager.php | 2 +- .../godmode/agentes/module_manager_editor.php | 9 +- .../pandora_networkmap_empty.editor.php | 2 +- .../agentes/planned_downtime.editor.php | 16 +- .../agentes/planned_downtime.export_csv.php | 5 +- .../godmode/agentes/planned_downtime.list.php | 6 +- .../agentes/status_monitor_custom_fields.php | 2 +- .../godmode/alerts/alert_actions.php | 18 +- .../godmode/alerts/alert_commands.php | 23 +- .../godmode/alerts/alert_list.builder.php | 2 +- .../godmode/alerts/alert_list.list.php | 2 +- pandora_console/godmode/alerts/alert_list.php | 38 +- .../godmode/alerts/alert_templates.php | 17 +- pandora_console/godmode/alerts/alert_view.php | 2 +- .../godmode/alerts/configure_alert_action.php | 4 +- .../alerts/configure_alert_command.php | 8 +- .../alerts/configure_alert_template.php | 16 +- pandora_console/godmode/audit_log_csv.php | 5 +- pandora_console/godmode/category/category.php | 6 +- .../godmode/category/edit_category.php | 10 +- pandora_console/godmode/db/db_main.php | 2 +- .../godmode/events/custom_events.php | 2 +- .../godmode/events/event_edit_filter.php | 2 +- .../godmode/events/event_filter.php | 4 +- .../godmode/events/event_responses.editor.php | 4 +- .../godmode/events/event_responses.list.php | 2 +- .../godmode/events/event_responses.php | 2 +- pandora_console/godmode/events/events.php | 2 +- pandora_console/godmode/extensions.php | 2 +- .../godmode/gis_maps/configure_gis_map.php | 923 ++++++++++-------- .../godmode/groups/configure_group.php | 2 +- .../godmode/groups/configure_modu_group.php | 2 +- pandora_console/godmode/groups/group_list.php | 10 +- .../godmode/groups/modu_group_list.php | 4 +- .../massive/massive_add_action_alerts.php | 4 +- .../godmode/massive/massive_add_alerts.php | 10 +- .../godmode/massive/massive_add_profiles.php | 8 +- .../godmode/massive/massive_copy_modules.php | 6 +- .../massive/massive_delete_action_alerts.php | 6 +- .../godmode/massive/massive_delete_agents.php | 6 +- .../godmode/massive/massive_delete_alerts.php | 10 +- .../massive/massive_delete_modules.php | 8 +- .../massive/massive_delete_profiles.php | 8 +- .../godmode/massive/massive_edit_agents.php | 12 +- .../godmode/massive/massive_edit_modules.php | 6 +- .../godmode/massive/massive_edit_plugins.php | 2 +- .../massive/massive_enable_disable_alerts.php | 10 +- .../godmode/massive/massive_operations.php | 2 +- .../massive/massive_standby_alerts.php | 10 +- .../module_library/module_library_view.php | 2 +- .../modules/configuration_wizard_setup.php | 2 +- .../godmode/modules/manage_nc_groups.php | 18 +- .../godmode/modules/manage_nc_groups_form.php | 2 +- .../modules/manage_network_components.php | 18 +- .../manage_network_components_form.php | 2 +- .../manage_network_components_form_common.php | 2 +- ...manage_network_components_form_network.php | 2 +- .../manage_network_components_form_wizard.php | 2 +- .../manage_network_components_form_wmi.php | 2 +- .../modules/manage_network_templates.php | 10 +- .../modules/manage_network_templates_form.php | 10 +- .../godmode/modules/module_list.php | 2 +- pandora_console/godmode/netflow/nf_edit.php | 4 +- .../godmode/netflow/nf_edit_form.php | 2 +- .../godmode/reporting/create_container.php | 2 +- .../reporting/graph_builder.graph_editor.php | 2 +- .../godmode/reporting/graph_builder.main.php | 2 +- .../godmode/reporting/graph_builder.php | 12 +- .../godmode/reporting/graph_container.php | 2 +- pandora_console/godmode/reporting/graphs.php | 29 +- .../godmode/reporting/map_builder.php | 38 +- .../reporting_builder.item_editor.php | 2 +- .../reporting_builder.list_items.php | 2 +- .../reporting/reporting_builder.main.php | 2 +- .../godmode/reporting/reporting_builder.php | 85 +- .../reporting/visual_console_builder.data.php | 2 +- .../visual_console_builder.editor.php | 4 +- .../visual_console_builder.elements.php | 4 +- .../reporting/visual_console_builder.php | 41 +- .../visual_console_builder.wizard.php | 4 +- .../reporting/visual_console_favorite.php | 2 +- pandora_console/godmode/servers/discovery.php | 2 +- .../godmode/servers/modificar_server.php | 2 +- pandora_console/godmode/servers/plugin.php | 2 +- .../godmode/servers/plugin_registration.php | 2 +- .../godmode/servers/servers.build_table.php | 2 +- .../godmode/setup/file_manager.php | 2 +- pandora_console/godmode/setup/gis.php | 2 +- pandora_console/godmode/setup/gis_step_2.php | 2 +- pandora_console/godmode/setup/license.php | 2 +- pandora_console/godmode/setup/links.php | 2 +- pandora_console/godmode/setup/news.php | 2 +- pandora_console/godmode/setup/os.builder.php | 2 +- pandora_console/godmode/setup/os.list.php | 2 +- pandora_console/godmode/setup/os.php | 2 +- pandora_console/godmode/setup/performance.php | 2 +- pandora_console/godmode/setup/setup.php | 2 +- pandora_console/godmode/setup/setup_auth.php | 2 +- .../godmode/setup/setup_ehorus.php | 2 +- .../godmode/setup/setup_integria.php | 2 +- .../godmode/setup/setup_visuals.php | 2 +- pandora_console/godmode/setup/snmp_wizard.php | 2 +- .../godmode/snmpconsole/snmp_alert.php | 4 +- .../godmode/snmpconsole/snmp_filters.php | 2 +- .../snmpconsole/snmp_trap_generator.php | 2 +- pandora_console/godmode/tag/edit_tag.php | 2 +- pandora_console/godmode/tag/tag.php | 2 +- pandora_console/godmode/um_client/index.php | 2 +- .../godmode/update_manager/update_manager.php | 2 +- .../update_manager/update_manager.setup.php | 2 +- .../godmode/users/configure_profile.php | 4 +- .../godmode/users/configure_user.php | 20 +- .../godmode/users/profile_list.php | 6 +- pandora_console/godmode/users/user_list.php | 8 +- .../wizards/DiscoveryTaskList.class.php | 10 +- .../godmode/wizards/HostDevices.class.php | 2 +- .../include/ajax/alert_list.ajax.php | 12 +- .../include/ajax/double_auth.ajax.php | 2 +- pandora_console/include/ajax/events.php | 2 +- pandora_console/include/ajax/group.php | 2 +- .../include/ajax/map_enterprise.ajax.php | 2 +- .../include/ajax/reporting.ajax.php | 2 +- .../include/ajax/visual_console.ajax.php | 2 +- .../ajax/visual_console_builder.ajax.php | 6 +- .../include/class/AgentWizard.class.php | 2 +- .../include/class/AgentsAlerts.class.php | 4 +- .../include/class/AuditLog.class.php | 2 +- .../include/class/CalendarManager.class.php | 2 +- .../include/class/ConfigPEN.class.php | 2 +- .../include/class/CredentialStore.class.php | 2 +- .../include/class/CustomNetScan.class.php | 2 +- .../include/class/ExternalTools.class.php | 4 +- .../class/ManageNetScanScripts.class.php | 2 +- .../include/class/ModuleTemplates.class.php | 2 +- .../include/class/NetworkMap.class.php | 2 +- .../class/WebServerModuleDebug.class.php | 2 +- pandora_console/include/constants.php | 26 + pandora_console/include/functions.php | 6 +- pandora_console/include/functions_agents.php | 48 +- pandora_console/include/functions_alerts.php | 2 +- pandora_console/include/functions_api.php | 22 +- pandora_console/include/functions_db.php | 56 +- pandora_console/include/functions_events.php | 8 +- .../include/functions_filemanager.php | 9 +- .../include/functions_treeview.php | 2 +- .../Dashboard/Widgets/maps_made_by_user.php | 2 +- .../Dashboard/Widgets/system_group_status.php | 2 +- pandora_console/include/rest-api/index.php | 8 +- .../rest-api/models/VisualConsole/View.php | 4 +- pandora_console/index.php | 76 +- .../mobile/include/system.class.php | 2 +- .../operation/agentes/agent_fields.php | 2 +- .../operation/agentes/alerts_status.php | 6 +- .../operation/agentes/custom_fields.php | 2 +- .../operation/agentes/datos_agente.php | 2 +- pandora_console/operation/agentes/ehorus.php | 2 +- .../operation/agentes/estado_agente.php | 4 +- .../agentes/estado_generalagente.php | 2 +- .../operation/agentes/estado_monitores.php | 2 +- .../operation/agentes/export_csv.php | 2 +- .../operation/agentes/gis_view.php | 2 +- pandora_console/operation/agentes/graphs.php | 2 +- .../operation/agentes/group_view.php | 4 +- .../operation/agentes/interface_view.php | 2 +- .../operation/agentes/networkmap.dinamic.php | 6 +- .../agentes/pandora_networkmap.editor.php | 2 +- .../operation/agentes/pandora_networkmap.php | 22 +- .../agentes/pandora_networkmap.view.php | 14 +- .../operation/agentes/status_monitor.php | 2 +- .../operation/agentes/tactical.php | 2 +- .../operation/agentes/url_address.php | 2 +- .../operation/agentes/ver_agente.php | 2 +- pandora_console/operation/events/events.php | 4 +- .../operation/events/events_list.php | 2 +- .../operation/events/sound_events.php | 2 +- .../operation/gis_maps/render_view.php | 2 +- .../operation/netflow/netflow_explorer.php | 2 +- .../operation/netflow/nf_live_view.php | 2 +- .../operation/network/network_report.php | 2 +- .../operation/network/network_usage_map.php | 2 +- .../operation/reporting/graph_viewer.php | 4 +- .../operation/reporting/reporting_viewer.php | 4 +- .../operation/reporting/reporting_xml.php | 6 +- .../operation/servers/recon_view.php | 2 +- .../operation/snmpconsole/snmp_browser.php | 2 +- .../snmpconsole/snmp_mib_uploader.php | 2 +- .../operation/snmpconsole/snmp_statistics.php | 2 +- .../operation/snmpconsole/snmp_view.php | 2 +- .../operation/users/user_edit_header.php | 2 +- .../visual_console/legacy_public_view.php | 2 +- .../operation/visual_console/legacy_view.php | 6 +- .../operation/visual_console/public_view.php | 2 +- .../operation/visual_console/view.php | 4 +- .../intel_dcm/extensions/intel_dcm_setup.php | 2 +- 217 files changed, 1280 insertions(+), 1088 deletions(-) diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php index f0032476e2..d6a48d27d0 100644 --- a/pandora_console/ajax.php +++ b/pandora_console/ajax.php @@ -89,7 +89,11 @@ if (isset($_GET['loginhash']) === true) { $config['id_user'] = $loginhash_user; } else { include_once 'general/login_page.php'; - db_pandora_audit('Logon Failed (loginhash', '', 'system'); + db_pandora_audit( + AUDIT_LOG_USER_REGISTRATION, + 'Loginhash failed', + 'system' + ); while (ob_get_length() > 0) { ob_end_flush(); } @@ -111,8 +115,8 @@ if (class_exists($auth_class) === false || $public_hash === false) { } else { if ($auth_class::validatePublicHash($public_hash) === false) { db_pandora_audit( - 'Invalid public hash', - 'Trying to access public dashboard' + AUDIT_LOG_USER_REGISTRATION, + 'Trying to access public dashboard (Invalid public hash)' ); include 'general/noaccess.php'; exit; diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index 815a0ed8d0..08218e7f51 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -284,7 +284,7 @@ function mainAgentsModules() // ACL Check. if (! check_acl($config['id_user'], 0, 'AR')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Agent view (Grouped)' ); include 'general/noaccess.php'; @@ -304,7 +304,10 @@ function mainAgentsModules() db_process_sql_update('tagente_modulo', ['flag' => 1], $where); } else { - db_pandora_audit('ACL Violation', 'Trying to set flag for groups'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to set flag for groups' + ); include 'general/noaccess.php'; exit; } diff --git a/pandora_console/extensions/api_checker.php b/pandora_console/extensions/api_checker.php index 14aa4c8191..69ca680c6a 100755 --- a/pandora_console/extensions/api_checker.php +++ b/pandora_console/extensions/api_checker.php @@ -63,7 +63,7 @@ function extension_api_checker() if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Profile Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/extensions/db_status.php b/pandora_console/extensions/db_status.php index d55294f3a6..638d795b31 100755 --- a/pandora_console/extensions/db_status.php +++ b/pandora_console/extensions/db_status.php @@ -32,7 +32,7 @@ function extension_db_status() if (!is_user_admin($config['id_user'])) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access db status' ); include 'general/noaccess.php'; diff --git a/pandora_console/extensions/dbmanager.php b/pandora_console/extensions/dbmanager.php index 7d32b730e5..0bf77fdb30 100644 --- a/pandora_console/extensions/dbmanager.php +++ b/pandora_console/extensions/dbmanager.php @@ -89,7 +89,10 @@ function dbmgr_extension_main() global $config; if (!is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/extensions/disabled/matrix_events.php b/pandora_console/extensions/disabled/matrix_events.php index e93cd24f8e..e695e81bcf 100644 --- a/pandora_console/extensions/disabled/matrix_events.php +++ b/pandora_console/extensions/disabled/matrix_events.php @@ -16,7 +16,10 @@ function load_matrix_console() global $config; if (! check_acl($config['id_user'], 0, 'ER')) { - db_pandora_audit('ACL Violation', 'Trying to access event viewer'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access event viewer' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/extensions/extension_uploader.php b/pandora_console/extensions/extension_uploader.php index 4df1c25bd1..7871ab0b2a 100644 --- a/pandora_console/extensions/extension_uploader.php +++ b/pandora_console/extensions/extension_uploader.php @@ -17,7 +17,7 @@ function extension_uploader_extensions() if (!check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Group Management' ); include 'general/noaccess.php'; @@ -61,7 +61,10 @@ function extension_uploader_extensions() } if ($result) { - db_pandora_audit('Extension manager', 'Upload extension '.$_FILES['extension']['name']); + db_pandora_audit( + AUDIT_LOG_EXTENSION_MANAGER, + 'Upload extension '.$_FILES['extension']['name'] + ); } ui_print_result_message( diff --git a/pandora_console/extensions/files_repo.php b/pandora_console/extensions/files_repo.php index d0edb1f591..34e5fe52d2 100644 --- a/pandora_console/extensions/files_repo.php +++ b/pandora_console/extensions/files_repo.php @@ -106,7 +106,10 @@ function pandora_files_repo_godmode() // ACL Check check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { - db_pandora_audit('ACL Violation', 'Trying to access to Files repository'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access to Files repository' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/extensions/insert_data.php b/pandora_console/extensions/insert_data.php index d6b54cdb11..54306ac5d7 100644 --- a/pandora_console/extensions/insert_data.php +++ b/pandora_console/extensions/insert_data.php @@ -58,7 +58,10 @@ function mainInsertData() ui_print_page_header(__('Insert data'), 'images/extensions.png', false, '', true, ''); if (! check_acl($config['id_user'], 0, 'AW') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/extensions/matrix_events/ajax.php b/pandora_console/extensions/matrix_events/ajax.php index f83ae58c36..3931770309 100644 --- a/pandora_console/extensions/matrix_events/ajax.php +++ b/pandora_console/extensions/matrix_events/ajax.php @@ -15,7 +15,10 @@ global $config; if (is_ajax()) { if (! check_acl($config['id_user'], 0, 'ER')) { - db_pandora_audit('ACL Violation', 'Trying to access event viewer'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access event viewer' + ); return; } diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php index affcff93de..4dc3b6d865 100644 --- a/pandora_console/extensions/module_groups.php +++ b/pandora_console/extensions/module_groups.php @@ -33,7 +33,7 @@ check_login(); // ACL Check. if (!check_acl($config['id_user'], 0, 'AR')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Module Groups view' ); include 'general/noaccess.php'; diff --git a/pandora_console/extensions/pandora_logs.php b/pandora_console/extensions/pandora_logs.php index 420d2bc6c1..21b817b978 100644 --- a/pandora_console/extensions/pandora_logs.php +++ b/pandora_console/extensions/pandora_logs.php @@ -56,7 +56,10 @@ function pandoralogs_extension_main() global $config; if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/extensions/quick_shell.php b/pandora_console/extensions/quick_shell.php index 54cb24e9f4..bc5f545905 100644 --- a/pandora_console/extensions/quick_shell.php +++ b/pandora_console/extensions/quick_shell.php @@ -46,7 +46,7 @@ function quickShell() if (check_acl($config['id_user'], 0, 'PM') === false) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Profile Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/extensions/resource_exportation.php b/pandora_console/extensions/resource_exportation.php index 16201ccec0..a9202a0381 100755 --- a/pandora_console/extensions/resource_exportation.php +++ b/pandora_console/extensions/resource_exportation.php @@ -29,7 +29,10 @@ if (isset($_GET['get_ptr'])) { if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } @@ -404,7 +407,10 @@ function resource_exportation_extension_main() check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/extensions/resource_registration.php b/pandora_console/extensions/resource_registration.php index 1d6ae952a7..4f23e340b3 100755 --- a/pandora_console/extensions/resource_registration.php +++ b/pandora_console/extensions/resource_registration.php @@ -143,14 +143,14 @@ function process_upload_xml_report($xml, $group_filter=0) if ($id_report) { db_pandora_audit( - 'Report management', + AUDIT_LOG_REPORT_MANAGEMENT, 'Create report '.$id_report, false, false ); } else { db_pandora_audit( - 'Report management', + AUDIT_LOG_REPORT_MANAGEMENT, 'Fail to create report', false, false @@ -554,7 +554,11 @@ function process_upload_xml_visualmap($xml, $filter_group=0) ); if ($id_visual_map !== false) { - db_pandora_audit('CREATE VISUAL CONSOLE', $id_visual_map, $config['id_user']); + db_pandora_audit( + AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT, + sprintf('Create Visual Console #%s', $id_visual_map), + $config['id_user'] + ); } else { break; } @@ -716,7 +720,11 @@ function process_upload_xml_visualmap($xml, $filter_group=0) ); if ($id_item !== false) { - db_pandora_audit('CREATE ITEM VISUAL CONSOLE', $values['id_layout'].' - '.$id_item, $config['id_user']); + db_pandora_audit( + AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT, + sprintf('Create Item %s in Visual Console #%s', $id_item, $values['id_layout']), + $config['id_user'] + ); } } else { foreach ($agents_in_item as $id => $agent) { @@ -725,7 +733,7 @@ function process_upload_xml_visualmap($xml, $filter_group=0) $id_item = db_process_sql_insert('tlayout_data', $values); - if (isset($item->other_id)) { + if (isset($item->other_id) === true) { $relation_other_ids[(string) $item->other_id] = $id_item; } @@ -736,9 +744,14 @@ function process_upload_xml_visualmap($xml, $filter_group=0) ); if ($id_item !== false) { - db_pandora_audit('CREATE ITEM VISUAL CONSOLE', $values['id_layout'].' - '.$id_item, $config['id_user']); + db_pandora_audit( + AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT, + sprintf('Create Item %s in Visual Console #%s', $id_item, $values['id_layout']), + $config['id_user'] + ); } } else { + // TODO: Review this else. foreach ($agent['modules'] as $id_module => $module) { $values['id_agent'] = $id; $values['id_agente_modulo'] = $id_module; @@ -752,7 +765,11 @@ function process_upload_xml_visualmap($xml, $filter_group=0) ); if ($id_item !== false) { - db_pandora_audit('CREATE ITEM VISUAL CONSOLE', $values['id_layout'].' - '.$id_item, $config['id_user']); + db_pandora_audit( + AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT, + sprintf('Create Item %s in Visual Console #%s', $id_item, $values['id_layout']), + $config['id_user'] + ); } } } @@ -1063,7 +1080,10 @@ function resource_registration_extension_main() global $config; if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/general/first_task/HA_cluster_builder.php b/pandora_console/general/first_task/HA_cluster_builder.php index e39892b254..2f0bb24a20 100644 --- a/pandora_console/general/first_task/HA_cluster_builder.php +++ b/pandora_console/general/first_task/HA_cluster_builder.php @@ -26,7 +26,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access HA cluster' ); include 'general/noaccess.php'; diff --git a/pandora_console/general/first_task/cluster_builder.php b/pandora_console/general/first_task/cluster_builder.php index 22c624c9a6..3e6fe3dad4 100644 --- a/pandora_console/general/first_task/cluster_builder.php +++ b/pandora_console/general/first_task/cluster_builder.php @@ -17,7 +17,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AR') && ! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Inventory' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/agent_incidents.php b/pandora_console/godmode/agentes/agent_incidents.php index 3917c2f81a..796a3afd77 100644 --- a/pandora_console/godmode/agentes/agent_incidents.php +++ b/pandora_console/godmode/agentes/agent_incidents.php @@ -27,7 +27,7 @@ $group = $id_grupo; if (! check_acl($config['id_user'], $group, 'AW', $id_agente)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access agent manager' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 2d77e7de29..9452a9f0b0 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -154,7 +154,10 @@ ui_require_javascript_file('openlayers.pandora'); $new_agent = (empty($id_agente)) ? true : false; if (! isset($id_agente) && ! $new_agent) { - db_pandora_audit('ACL Violation', 'Trying to access agent manager witout an agent'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access agent manager witout an agent' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 7965dbc566..d50a616379 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -70,7 +70,7 @@ if (!check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { if (!$access_granted) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access agent manager' ); include 'general/noaccess.php'; @@ -198,7 +198,10 @@ if ($create_agent) { $grupo = (int) get_parameter_post('grupo'); if ((bool) check_acl($config['id_user'], $grupo, 'AW') === false) { - db_pandora_audit('ACL Violation', 'Trying to access agent manager'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access agent manager' + ); include $config['homedir'].'/general/noaccess.php'; return; } @@ -352,7 +355,7 @@ if ($create_agent) { $unsafe_alias = io_safe_output($alias); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, 'Created agent '.$unsafe_alias, false, true, @@ -1243,7 +1246,7 @@ if ($update_agent) { ui_print_success_message(__('Successfully updated')); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, 'Updated agent '.io_safe_output($alias), false, false, @@ -1259,7 +1262,10 @@ if ($id_agente) { // This has been done in the beginning of the page, but if an agent was created, this id might change. $id_grupo = agents_get_agent_group($id_agente); if (!check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') && !check_acl_one_of_groups($config['id_user'], $all_groups, 'AD')) { - db_pandora_audit('ACL Violation', 'Trying to admin an agent without access'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to admin an agent without access' + ); include 'general/noaccess.php'; exit; } @@ -1319,7 +1325,7 @@ if ($update_module || $create_module) { if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to create a module without admin rights' ); include 'general/noaccess.php'; @@ -1803,7 +1809,7 @@ if ($update_module) { $edit_module = true; db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, "Fail to try update module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']) ); } else { @@ -1827,7 +1833,7 @@ if ($update_module) { $agent = db_get_row('tagente', 'id_agente', $id_agente); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, "Updated module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']), false, false, @@ -1989,7 +1995,7 @@ if ($create_module) { $edit_module = true; $moduletype = $id_module; db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, "Fail to try added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']) ); } else { @@ -2014,7 +2020,7 @@ if ($create_module) { $agent = db_get_row('tagente', 'id_agente', $id_agente); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, "Added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']), false, true, @@ -2049,12 +2055,12 @@ if ($enable_module) { $success_action = $result; if ($result === NOERR) { db_pandora_audit( - 'Module management', + AUDIT_LOG_MODULE_MANAGEMENT, 'Enable #'.$enable_module.' | '.$module_name.' | '.io_safe_output($agent['alias']) ); } else { db_pandora_audit( - 'Module management', + AUDIT_LOG_MODULE_MANAGEMENT, 'Fail to enable #'.$enable_module.' | '.$module_name.' | '.io_safe_output($agent['alias']) ); } @@ -2084,12 +2090,12 @@ if ($disable_module) { if ($result === NOERR) { db_pandora_audit( - 'Module management', + AUDIT_LOG_MODULE_MANAGEMENT, 'Disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias']) ); } else { db_pandora_audit( - 'Module management', + AUDIT_LOG_MODULE_MANAGEMENT, 'Fail to disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias']) ); } @@ -2133,7 +2139,7 @@ if ($delete_module) { if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to delete a module without admin rights' ); include 'general/noaccess.php'; @@ -2143,7 +2149,7 @@ if ($delete_module) { if (empty($module_data) || $id_borrar_modulo < 1) { db_pandora_audit( - 'HACK Attempt', + AUDIT_LOG_HACK_ATTEMPT, 'Expected variable from form is not correct' ); include 'general/noaccess.php'; @@ -2165,7 +2171,7 @@ if ($delete_module) { $agent = db_get_row('tagente', 'id_agente', $id_agente); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, "Deleted module '".io_safe_output($module_data['nombre'])."' for agent ".io_safe_output($agent['alias']) ); } @@ -2206,12 +2212,12 @@ if (!empty($duplicate_module)) { if ($result) { db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, "Duplicate module '".$id_duplicate_module."' for agent ".$agent['alias'].' with the new id for clon '.$result ); } else { db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, "Fail to try duplicate module '".$id_duplicate_module."' for agent ".$agent['alias'] ); } @@ -2225,9 +2231,15 @@ if ($enable_module) { if ($result === NOERR) { enterprise_hook('config_agents_enable_module_conf', [$id_agente, $enable_module]); - db_pandora_audit('Module management', 'Enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias']); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias'] + ); } else { - db_pandora_audit('Module management', 'Fail to enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias']); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Fail to enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias'] + ); } ui_print_result_message( @@ -2244,9 +2256,15 @@ if ($disable_module) { if ($result === NOERR) { enterprise_hook('config_agents_disable_module_conf', [$id_agente, $disable_module]); - db_pandora_audit('Module management', 'Disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias']); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias'] + ); } else { - db_pandora_audit('Module management', 'Fail to disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias']); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Fail to disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias'] + ); } ui_print_result_message( diff --git a/pandora_console/godmode/agentes/configure_field.php b/pandora_console/godmode/agentes/configure_field.php index 0f7a42820a..7ef0fe042a 100755 --- a/pandora_console/godmode/agentes/configure_field.php +++ b/pandora_console/godmode/agentes/configure_field.php @@ -16,7 +16,10 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { - db_pandora_audit('ACL Violation', 'Trying to access Group Management2'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Group Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/agentes/fields_manager.php b/pandora_console/godmode/agentes/fields_manager.php index 3fd8db3849..960ed62776 100644 --- a/pandora_console/godmode/agentes/fields_manager.php +++ b/pandora_console/godmode/agentes/fields_manager.php @@ -18,7 +18,7 @@ check_login(); if (!check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Group Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index e2aca5017f..2d6dd90bbe 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -58,7 +58,7 @@ if (! check_acl( ) ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access agent manager' ); include 'general/noaccess.php'; @@ -158,7 +158,7 @@ if ($agent_to_delete) { } else { // NO permissions. db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, "Trying to delete agent \'".agents_get_name($id_agente)."\'" ); include 'general/noaccess.php'; @@ -219,12 +219,12 @@ if ($enable_agent) { ] ); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, 'Enable '.$alias ); } else { db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, 'Fail to enable '.$alias ); } @@ -262,12 +262,12 @@ if ($disable_agent) { ); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, 'Disable '.$alias ); } else { db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, 'Fail to disable '.$alias ); } diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 1d39f0525a..529112bd5a 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -261,7 +261,7 @@ if ($module_action === 'delete') { if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to delete a module without admin rights' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index c4e62816cb..005b1e578f 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -549,7 +549,7 @@ if ($is_function_policies !== ENTERPRISE_NOT_HOOK) { ); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, 'Re-link module '.$id_agent_module ); } @@ -562,7 +562,10 @@ if ($is_function_policies !== ENTERPRISE_NOT_HOOK) { __('Module will be unlinked in the next application') ); - db_pandora_audit('Agent management', 'Unlink module '.$id_agent_module); + db_pandora_audit( + AUDIT_LOG_AGENT_MANAGEMENT, + 'Unlink module '.$id_agent_module + ); } } @@ -582,7 +585,7 @@ if ($__code_from !== 'policies') { if (!$tag_acl) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access agent manager' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/pandora_networkmap_empty.editor.php b/pandora_console/godmode/agentes/pandora_networkmap_empty.editor.php index 9616d568a3..6fa81baca7 100644 --- a/pandora_console/godmode/agentes/pandora_networkmap_empty.editor.php +++ b/pandora_console/godmode/agentes/pandora_networkmap_empty.editor.php @@ -73,7 +73,7 @@ if ($edit_networkmap) { if (!$networkmap_write && !$networkmap_manage) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access networkmap' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/planned_downtime.editor.php b/pandora_console/godmode/agentes/planned_downtime.editor.php index 616777ad6e..1004aeec0d 100644 --- a/pandora_console/godmode/agentes/planned_downtime.editor.php +++ b/pandora_console/godmode/agentes/planned_downtime.editor.php @@ -38,7 +38,7 @@ $agent_w = check_acl($config['id_user'], 0, 'AW'); $access = ($agent_d == true) ? 'AD' : (($agent_w == true) ? 'AW' : 'AD'); if (!$agent_d && !$agent_w) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -169,7 +169,7 @@ if ($delete_downtime_agent === 1) { || !in_array($downtime_group, $user_groups_ad) ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -188,7 +188,7 @@ if ($delete_downtime_agent === 1) { || !in_array($agent_group, $user_groups_ad) ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -265,7 +265,7 @@ if ($create_downtime || $update_downtime) { // Check AD permission on new downtime. if (!in_array($id_group, $user_groups_ad)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -323,7 +323,7 @@ if ($create_downtime || $update_downtime) { // Check AD permission on OLD downtime. if (empty($old_downtime) || !in_array($old_downtime['id_group'], $user_groups_ad)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -333,7 +333,7 @@ if ($create_downtime || $update_downtime) { // Check AD permission on NEW downtime group. if (!in_array($id_group, $user_groups_ad)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -487,7 +487,7 @@ if ($id_downtime > 0) { // Permission check for the downtime with the AD user groups if (empty($result) || !in_array($result['id_group'], $user_groups_ad)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -1082,7 +1082,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad) || !in_array($downtime_group, $user_groups_ad) ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/planned_downtime.export_csv.php b/pandora_console/godmode/agentes/planned_downtime.export_csv.php index 7e0aff8a34..d61df4e8c3 100644 --- a/pandora_console/godmode/agentes/planned_downtime.export_csv.php +++ b/pandora_console/godmode/agentes/planned_downtime.export_csv.php @@ -23,7 +23,10 @@ require_once '../../include/functions_reporting.php'; $config['id_user'] = $_SESSION['id_usuario']; if (! check_acl($config['id_user'], 0, 'AR')) { - db_pandora_audit('ACL Violation', 'Trying to access downtime scheduler'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access downtime scheduler' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/agentes/planned_downtime.list.php b/pandora_console/godmode/agentes/planned_downtime.list.php index d2e7de8ec9..13c458b176 100755 --- a/pandora_console/godmode/agentes/planned_downtime.list.php +++ b/pandora_console/godmode/agentes/planned_downtime.list.php @@ -23,7 +23,7 @@ $access = ($read_permisson == true) ? 'AR' : (($write_permisson == true) ? 'AD' if (! $read_permisson && !$manage_permisson) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -70,7 +70,7 @@ if ($stop_downtime) { // Check AD permission on the downtime if (empty($downtime) || (! check_acl($config['id_user'], $downtime['id_group'], 'AD') && ! check_acl($config['id_user'], $downtime['id_group'], 'AW'))) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -94,7 +94,7 @@ if ($delete_downtime) { // Check AD permission on the downtime if (empty($downtime) || (! check_acl($config['id_user'], $downtime['id_group'], 'AD') && ! check_acl($config['id_user'], $downtime['id_group'], 'AW'))) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/status_monitor_custom_fields.php b/pandora_console/godmode/agentes/status_monitor_custom_fields.php index 2b4b3d0538..d9960c7547 100644 --- a/pandora_console/godmode/agentes/status_monitor_custom_fields.php +++ b/pandora_console/godmode/agentes/status_monitor_custom_fields.php @@ -20,7 +20,7 @@ if (! check_acl($config['id_user'], 0, 'AR') && ! check_acl($config['id_user'], 0, 'AM') ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Agent Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/alerts/alert_actions.php b/pandora_console/godmode/alerts/alert_actions.php index de9d6e126d..85a1533da4 100644 --- a/pandora_console/godmode/alerts/alert_actions.php +++ b/pandora_console/godmode/alerts/alert_actions.php @@ -42,7 +42,7 @@ enterprise_hook('open_meta_frame'); if (! check_acl($config['id_user'], 0, 'LM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert actions' ); include 'general/noaccess.php'; @@ -104,7 +104,7 @@ if ($copy_action) { // Then action group have to be in his own groups. if (!$is_in_group) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -117,12 +117,12 @@ if ($copy_action) { if ($result) { db_pandora_audit( - 'Command management', + AUDIT_LOG_COMMAND_MANAGEMENT, 'Duplicate alert action '.$id.' clone to '.$result ); } else { db_pandora_audit( - 'Command management', + AUDIT_LOG_COMMAND_MANAGEMENT, 'Fail try to duplicate alert action '.$id ); } @@ -145,7 +145,7 @@ if ($delete_action) { if (!check_acl_restricted_all($config['id_user'], $al_action['id_group'], 'LM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -158,7 +158,7 @@ if ($delete_action) { // Then must have "PM" access privileges. if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -182,7 +182,7 @@ if ($delete_action) { // Then action group have to be in his own groups. if (!$is_in_group) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -196,12 +196,12 @@ if ($delete_action) { if ($result) { db_pandora_audit( - 'Command management', + AUDIT_LOG_COMMAND_MANAGEMENT, 'Delete alert action #'.$id ); } else { db_pandora_audit( - 'Command management', + AUDIT_LOG_COMMAND_MANAGEMENT, 'Fail try to delete alert action #'.$id ); } diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index a480f86651..dffe8f08c8 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -21,7 +21,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'LM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -538,9 +538,20 @@ if ($create_command) { } if ($result) { - db_pandora_audit('Command management', 'Create alert command #'.$result, false, false, $info); + db_pandora_audit( + AUDIT_LOG_COMMAND_MANAGEMENT, + 'Create alert command #'.$result, + false, + false, + $info + ); } else { - db_pandora_audit('Command management', 'Fail try to create alert command', false, false); + db_pandora_audit( + AUDIT_LOG_COMMAND_MANAGEMENT, + 'Fail try to create alert command', + false, + false + ); } // Show errors. @@ -570,7 +581,7 @@ if ($delete_command) { // Internal commands cannot be deleted. if (alerts_get_alert_command_internal($id)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -580,9 +591,9 @@ if ($delete_command) { $result = alerts_delete_alert_command($id); if ($result) { - db_pandora_audit('Command management', 'Delete alert command #'.$id); + db_pandora_audit(AUDIT_LOG_COMMAND_MANAGEMENT, 'Delete alert command #'.$id); } else { - db_pandora_audit('Command management', 'Fail try to delete alert command #'.$id); + db_pandora_audit(AUDIT_LOG_COMMAND_MANAGEMENT, 'Fail try to delete alert command #'.$id); } ui_print_result_message( diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index f6a60fffae..8da2925473 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -18,7 +18,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'LW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index 95ace7d345..a721612eed 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -22,7 +22,7 @@ if (! check_acl($config['id_user'], 0, 'LW') && ! check_acl($config['id_user'], 0, 'LM') ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index 14d9bf10d4..22292e2a7d 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -21,7 +21,7 @@ if (! check_acl($config['id_user'], 0, 'LW') && ! check_acl($config['id_user'], 0, 'LM') ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -146,7 +146,7 @@ if ($create_alert) { $unsafe_agent_alias = io_safe_output($agent_alias); if ($id) { db_pandora_audit( - 'Alert management', + AUDIT_LOG_ALERT_MANAGEMENT, "Added alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'", false, false, @@ -154,7 +154,7 @@ if ($create_alert) { ); } else { db_pandora_audit( - 'Alert management', + AUDIT_LOG_ALERT_MANAGEMENT, "Fail Added alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'" ); } @@ -217,12 +217,12 @@ if ($delete_alert) { if ($result) { db_pandora_audit( - 'Alert management', + AUDIT_LOG_ALERT_MANAGEMENT, "Deleted alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'" ); } else { db_pandora_audit( - 'Alert management', + AUDIT_LOG_ALERT_MANAGEMENT, "Fail to deleted alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'" ); } @@ -255,9 +255,9 @@ if ($add_action) { $result = alerts_add_alert_agent_module_action($id_alert_module, $id_action, $values); if ($result) { - db_pandora_audit('Alert management', 'Add action '.$id_action.' in alert '.$id_alert_module); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Add action '.$id_action.' in alert '.$id_alert_module); } else { - db_pandora_audit('Alert management', 'Fail to add action '.$id_action.' in alert '.$id_alert_module); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail to add action '.$id_action.' in alert '.$id_alert_module); } $messageAction = ui_print_result_message( @@ -290,9 +290,9 @@ if ($update_action) { $result = alerts_update_alert_agent_module_action($id_module_action, $values); if ($result) { - db_pandora_audit('Alert management', 'Update action '.$id_action.' in alert '.$id_alert_module); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Update action '.$id_action.' in alert '.$id_alert_module); } else { - db_pandora_audit('Alert management', 'Fail to updated action '.$id_action.' in alert '.$id_alert_module); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail to updated action '.$id_action.' in alert '.$id_alert_module); } $messageAction = ui_print_result_message( @@ -311,9 +311,9 @@ if ($delete_action) { $result = alerts_delete_alert_agent_module_action($id_action); if ($result) { - db_pandora_audit('Alert management', 'Delete action '.$id_action.' in alert '.$id_alert); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Delete action '.$id_action.' in alert '.$id_alert); } else { - db_pandora_audit('Alert management', 'Fail to delete action '.$id_action.' in alert '.$id_alert); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail to delete action '.$id_action.' in alert '.$id_alert); } $messageAction = ui_print_result_message( @@ -332,9 +332,9 @@ if ($enable_alert) { $result = alerts_agent_module_disable($id_alert, false); if ($result) { - db_pandora_audit('Alert management', 'Enable '.$id_alert); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Enable '.$id_alert); } else { - db_pandora_audit('Alert management', 'Fail to enable '.$id_alert); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail to enable '.$id_alert); } $messageAction = ui_print_result_message( @@ -353,9 +353,9 @@ if ($disable_alert) { $result = alerts_agent_module_disable($id_alert, true); if ($result) { - db_pandora_audit('Alert management', 'Disable '.$id_alert); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Disable '.$id_alert); } else { - db_pandora_audit('Alert management', 'Fail to disable '.$id_alert); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail to disable '.$id_alert); } $messageAction = ui_print_result_message( @@ -374,9 +374,9 @@ if ($standbyon_alert) { $result = alerts_agent_module_standby($id_alert, true); if ($result) { - db_pandora_audit('Alert management', 'Standby '.$id_alert); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Standby '.$id_alert); } else { - db_pandora_audit('Alert management', 'Fail to standby '.$id_alert); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail to standby '.$id_alert); } $messageAction = ui_print_result_message( @@ -395,9 +395,9 @@ if ($standbyoff_alert) { $result = alerts_agent_module_standby($id_alert, false); if ($result) { - db_pandora_audit('Alert management', 'Standbyoff '.$id_alert); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Standbyoff '.$id_alert); } else { - db_pandora_audit('Alert management', 'Fail to standbyoff '.$id_alert); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail to standbyoff '.$id_alert); } $messageAction = ui_print_result_message( diff --git a/pandora_console/godmode/alerts/alert_templates.php b/pandora_console/godmode/alerts/alert_templates.php index 3f6d8625b5..4833ef8b55 100644 --- a/pandora_console/godmode/alerts/alert_templates.php +++ b/pandora_console/godmode/alerts/alert_templates.php @@ -108,7 +108,7 @@ if (is_ajax()) { if (! check_acl($config['id_user'], 0, 'LM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -118,12 +118,7 @@ if (! check_acl($config['id_user'], 0, 'LM')) { $update_template = (bool) get_parameter('update_template'); $delete_template = (bool) get_parameter('delete_template'); $pure = get_parameter('pure', 0); - -if (defined('METACONSOLE')) { - $sec = 'advanced'; -} else { - $sec = 'galertas'; -} +$sec = (is_metaconsole() === true) ? 'advanced' : 'galertas'; // This prevents to duplicate the header in // case delete_templete action is performed. @@ -175,7 +170,7 @@ if ($delete_template) { if ($al_template['id_group'] == 0) { if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -217,7 +212,7 @@ if ($delete_template) { } } else { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -242,12 +237,12 @@ if ($delete_template) { if ($result) { db_pandora_audit( - 'Template alert management', + AUDIT_LOG_ALERT_MANAGEMENT, 'Delete alert template #'.$id ); } else { db_pandora_audit( - 'Template alert management', + AUDIT_LOG_ALERT_MANAGEMENT, 'Fail try to delete alert template #'.$id ); } diff --git a/pandora_console/godmode/alerts/alert_view.php b/pandora_console/godmode/alerts/alert_view.php index cc467b99f8..7708eb0697 100644 --- a/pandora_console/godmode/alerts/alert_view.php +++ b/pandora_console/godmode/alerts/alert_view.php @@ -18,7 +18,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'LM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert View (In management section)' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index c8efca1f00..53c5e0809d 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -23,7 +23,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'LM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -96,7 +96,7 @@ if ($al_action !== false) { } if (!$is_in_group && $al_action['id_group'] != 0) { - db_pandora_audit('ACL Violation', 'Trying to access unauthorized alert action configuration'); + db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access unauthorized alert action configuration'); include 'general/noaccess.php'; exit; } diff --git a/pandora_console/godmode/alerts/configure_alert_command.php b/pandora_console/godmode/alerts/configure_alert_command.php index a84aaf5467..7b9b10db4e 100644 --- a/pandora_console/godmode/alerts/configure_alert_command.php +++ b/pandora_console/godmode/alerts/configure_alert_command.php @@ -23,7 +23,7 @@ enterprise_hook('open_meta_frame'); if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -52,7 +52,7 @@ if ($id > 0) { $alert = alerts_get_alert_command($id); if ($alert['internal'] || !check_acl_restricted_all($config['id_user'], $alert['id_group'], 'PM')) { - db_pandora_audit('ACL Violation', 'Trying to access Alert Management'); + db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management'); include 'general/noaccess.php'; exit; } @@ -110,9 +110,9 @@ if ($update_command) { } if ($result) { - db_pandora_audit('Command management', 'Update alert command #'.$id, false, false, $info); + db_pandora_audit(AUDIT_LOG_COMMAND_MANAGEMENT, 'Update alert command #'.$id, false, false, $info); } else { - db_pandora_audit('Command management', 'Fail to update alert command #'.$id, false, false); + db_pandora_audit(AUDIT_LOG_COMMAND_MANAGEMENT, 'Fail to update alert command #'.$id, false, false); } ui_print_result_message( diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index 4936617b47..f9997d8b41 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -26,7 +26,7 @@ enterprise_hook('open_meta_frame'); if (! check_acl($config['id_user'], 0, 'LM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -109,7 +109,7 @@ if ($a_template !== false) { } } else { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -153,9 +153,9 @@ if ($duplicate_template) { $id = alerts_duplicate_alert_template($source_id, $a_template['id_group']); if ($id) { - db_pandora_audit('Template alert management', 'Duplicate alert template '.$source_id.' clone to '.$id); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Duplicate alert template '.$source_id.' clone to '.$id); } else { - db_pandora_audit('Template alert management', 'Fail try to duplicate alert template '.$source_id); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail try to duplicate alert template '.$source_id); } ui_print_result_message( @@ -364,9 +364,9 @@ function update_template($step) } if ($result) { - db_pandora_audit('Template alert management', 'Update alert template #'.$id, false, false, json_encode($values)); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Update alert template #'.$id, false, false, json_encode($values)); } else { - db_pandora_audit('Template alert management', 'Fail try to update alert template #'.$id, false, false, json_encode($values)); + db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail try to update alert template #'.$id, false, false, json_encode($values)); } return $result; @@ -491,7 +491,7 @@ if ($create_template) { if ($result) { db_pandora_audit( - 'Template alert management', + AUDIT_LOG_ALERT_MANAGEMENT, 'Create alert template #'.$result, false, false, @@ -499,7 +499,7 @@ if ($create_template) { ); } else { db_pandora_audit( - 'Template alert management', + AUDIT_LOG_ALERT_MANAGEMENT, 'Fail try to create alert template', false, false, diff --git a/pandora_console/godmode/audit_log_csv.php b/pandora_console/godmode/audit_log_csv.php index 2d91feca9c..7c03d632df 100644 --- a/pandora_console/godmode/audit_log_csv.php +++ b/pandora_console/godmode/audit_log_csv.php @@ -32,7 +32,10 @@ if (!isset($_SESSION['id_usuario'])) { check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { - db_pandora_audit('ACL Violation', 'Trying to access audit CSV export'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access audit CSV export' + ); include 'general/noaccess.php'; exit; } diff --git a/pandora_console/godmode/category/category.php b/pandora_console/godmode/category/category.php index 39683df3ae..bfccb8fad5 100755 --- a/pandora_console/godmode/category/category.php +++ b/pandora_console/godmode/category/category.php @@ -35,7 +35,7 @@ check_login(); enterprise_hook('open_meta_frame'); if (!check_acl($config['id_user'], 0, 'PM') && !is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Categories Management'); + db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access Categories Management'); include 'general/noaccess.php'; return; } @@ -113,10 +113,10 @@ if (is_management_allowed() === false) { if ($is_management_allowed === true && $delete != 0) { $return_delete = categories_delete_category($delete); if (!$return_delete) { - db_pandora_audit('Category management', 'Fail try to delete category #'.$delete); + db_pandora_audit(AUDIT_LOG_CATEGORY_MANAGEMENT, 'Fail try to delete category #'.$delete); ui_print_error_message(__('Error deleting category')); } else { - db_pandora_audit('Category management', 'Delete category #'.$delete); + db_pandora_audit(AUDIT_LOG_CATEGORY_MANAGEMENT, 'Delete category #'.$delete); ui_print_success_message(__('Successfully deleted category')); } } diff --git a/pandora_console/godmode/category/edit_category.php b/pandora_console/godmode/category/edit_category.php index 6278fb6dae..d4d050a7b7 100755 --- a/pandora_console/godmode/category/edit_category.php +++ b/pandora_console/godmode/category/edit_category.php @@ -19,7 +19,7 @@ enterprise_hook('open_meta_frame'); require_once $config['homedir'].'/include/functions_categories.php'; if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Edit Category'); + db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access Edit Category'); include 'general/noaccess.php'; return; @@ -85,10 +85,10 @@ if ($update_category && $id_category != 0) { } if ($result === false) { - db_pandora_audit('Category management', "Fail try to update category #$id_category"); + db_pandora_audit(AUDIT_LOG_CATEGORY_MANAGEMENT, "Fail try to update category #$id_category"); ui_print_error_message(__('Error updating category')); } else { - db_pandora_audit('Category management', "Update category #$id_category"); + db_pandora_audit(AUDIT_LOG_CATEGORY_MANAGEMENT, "Update category #$id_category"); ui_print_success_message(__('Successfully updated category')); } } @@ -107,12 +107,12 @@ if ($create_category) { } if ($return_create === false) { - db_pandora_audit('Category management', 'Fail try to create category'); + db_pandora_audit(AUDIT_LOG_CATEGORY_MANAGEMENT, 'Fail try to create category'); ui_print_error_message(__('Error creating category')); $action = 'new'; // If create action ends successfully then current action is update } else { - db_pandora_audit('Category management', "Create category #$return_create"); + db_pandora_audit(AUDIT_LOG_CATEGORY_MANAGEMENT, "Create category #$return_create"); ui_print_success_message(__('Successfully created category')); $id_category = $return_create; $action = 'update'; diff --git a/pandora_console/godmode/db/db_main.php b/pandora_console/godmode/db/db_main.php index a25d09ec04..79a6c9eba7 100644 --- a/pandora_console/godmode/db/db_main.php +++ b/pandora_console/godmode/db/db_main.php @@ -18,7 +18,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'DM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Database Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/events/custom_events.php b/pandora_console/godmode/events/custom_events.php index a492b0522f..a53657ffce 100644 --- a/pandora_console/godmode/events/custom_events.php +++ b/pandora_console/godmode/events/custom_events.php @@ -17,7 +17,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Custom events Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/events/event_edit_filter.php b/pandora_console/godmode/events/event_edit_filter.php index 43f2162719..b52242f166 100644 --- a/pandora_console/godmode/events/event_edit_filter.php +++ b/pandora_console/godmode/events/event_edit_filter.php @@ -21,7 +21,7 @@ $access = ($event_w == true) ? 'EW' : (($event_m == true) ? 'EM' : 'EW'); if (!$event_w && !$event_m) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access events filter editor' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/events/event_filter.php b/pandora_console/godmode/events/event_filter.php index 07e87284ee..5ddc469034 100644 --- a/pandora_console/godmode/events/event_filter.php +++ b/pandora_console/godmode/events/event_filter.php @@ -22,7 +22,7 @@ $access = ($event_w == true) ? 'EW' : (($event_m == true) ? 'EM' : 'EW'); if (!$event_w && !$event_m) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access events filter editor' ); include 'general/noaccess.php'; @@ -43,7 +43,7 @@ if ($delete) { && !check_acl_restricted_all($config['id_user'], $filter_group, 'EM') ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access events filter editor' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/events/event_responses.editor.php b/pandora_console/godmode/events/event_responses.editor.php index e044528cba..fb6e7ca89f 100644 --- a/pandora_console/godmode/events/event_responses.editor.php +++ b/pandora_console/godmode/events/event_responses.editor.php @@ -17,7 +17,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Group Management' ); include 'general/noaccess.php'; @@ -43,7 +43,7 @@ if ($event_response_id > 0) { // ACL check for event response edition. if (!check_acl_restricted_all($config['id_user'], $event_response['id_group'], 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Group Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/events/event_responses.list.php b/pandora_console/godmode/events/event_responses.list.php index ef0785c978..550ac994e9 100644 --- a/pandora_console/godmode/events/event_responses.list.php +++ b/pandora_console/godmode/events/event_responses.list.php @@ -19,7 +19,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Group Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/events/event_responses.php b/pandora_console/godmode/events/event_responses.php index 28abe474dd..8bc1d1d544 100644 --- a/pandora_console/godmode/events/event_responses.php +++ b/pandora_console/godmode/events/event_responses.php @@ -19,7 +19,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Group Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/events/events.php b/pandora_console/godmode/events/events.php index f32c07ec43..59d7810454 100644 --- a/pandora_console/godmode/events/events.php +++ b/pandora_console/godmode/events/events.php @@ -20,7 +20,7 @@ enterprise_hook('open_meta_frame'); if (!check_acl($config['id_user'], 0, 'EW') && !check_acl($config['id_user'], 0, 'EM') && ! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access event manage' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/extensions.php b/pandora_console/godmode/extensions.php index 6e036827aa..faea92b358 100644 --- a/pandora_console/godmode/extensions.php +++ b/pandora_console/godmode/extensions.php @@ -17,7 +17,7 @@ global $config; if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access extensions list' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/gis_maps/configure_gis_map.php b/pandora_console/godmode/gis_maps/configure_gis_map.php index bcaf41ad64..f91ac9ded0 100644 --- a/pandora_console/godmode/gis_maps/configure_gis_map.php +++ b/pandora_console/godmode/gis_maps/configure_gis_map.php @@ -20,7 +20,7 @@ $gis_m = check_acl($config['id_user'], 0, 'MM'); $access = ($gis_w == true) ? 'MW' : (($gis_m == true) ? 'MM' : 'MW'); if (!$gis_w && !$gis_m) { - db_pandora_audit('ACL Violation', 'Trying to access map builder'); + db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access map builder'); include 'general/noaccess.php'; return; } @@ -33,7 +33,7 @@ $action = get_parameter('action', 'new_map'); $gis_map_group = db_get_value('group_id', 'tgis_map', 'id_tgis_map', $idMap); if ($idMap > 0 && !check_acl_restricted_all($config['id_user'], $gis_map_group, 'MW') && !check_acl_restricted_all($config['id_user'], $gis_map_group, 'MW')) { - db_pandora_audit('ACL Violation', 'Trying to access map builder'); + db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access map builder'); include 'general/noaccess.php'; return; } @@ -463,21 +463,12 @@ foreach ($listConnectionTemp as $connectionTemp) { } $table->data[1][0] = __('Add Map connection').$iconError; -$table->data[1][1] = " - - - - ".gis_add_conection_maps_in_form($map_connection_list).' +)." < / a > < input type = 'hidden' name = 'map_connection_list' value = '' id = 'map_connection_list' / > < input type = 'hidden' name = 'layer_list' value = '' id = 'layer_list' / > < / td > < / tr > (".gis_add_conection_maps_in_form($map_connection_list).'
- ".html_print_select($listConnection, 'map_connection_list', '', '', '', '0', true)." - - ".html_print_image( +$table->data[1][1] = ".html_print_select($listConnection, 'map_connection_list', '', '', '', '0', true)." + < / td > < td > < a href = 'javascript: addConnectionMap();' > ".html_print_image( 'images/add.png', true, ['class' => 'invert_filter'] -)." - - -
'; $own_info = get_user_info($config['id_user']); @@ -553,9 +544,9 @@ $table->data = []; $table->data[0][0] = '

'.__('List of layers').'

'; $table->data[0][1] = '
'.html_print_button(__('New layer'), 'new_layer', false, 'newLayer();', 'class="sub add "', true).'
'; -$table->data[1][0] = '
'; -$table->data[1][1] = '