pandorafms/pandora_console/godmode/massive/massive_delete_agents.php

129 lines
3.8 KiB
PHP
Raw Normal View History

2009-02-19 Esteban Sanchez <estebans@artica.es> * include/functions_ui.php: Added require_css_file(), require_javascript_file() and require_jquery_file() to add CSS, javascript and jQuery files to the header easily without changing config object. A path parameter is addded to allow the use on enterprise code. * include/functions_db.php: Added get_db_value_filter(), get_db_all_rows_filter() and process_sql_delete(). Fixed delete_agent() style and use these functions. Added process_page_head() from functions_ui.php and changed a bit the config javascript object part. * include/functions_custom_graphs.php: Get results indexed by id on get_user_custom_graphs(). * include/functions.php: Moved process_page_head to functions_ui.php. * godmode/agentes/manage_delete.php: New interface to perform massive agents deletion. * godmode/menu.php: Added new option to massive agents deletion. * general/main_menu.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor.php, godmode/agentes/planned_downtime.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/configure_alert_template.php, godmode/reporting/map_builder.php, operation/agentes/networkmap.php, operation/reporting/reporting_viewer.php, operation/visual_console/render_view.php: Use new functions in include CSS and javascript files. * index.php: Bit of style when printing the header so the HTML can be readed easily in a editor. * include/javascript/pandora.js: Added a variable to determine the enterprise directory. * include/styles/pandora.css: Added style for manage_delete.php git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
2009-02-19 Esteban Sanchez <estebans@artica.es> * include/functions_ui.php: Added require_css_file(), require_javascript_file() and require_jquery_file() to add CSS, javascript and jQuery files to the header easily without changing config object. A path parameter is addded to allow the use on enterprise code. * include/functions_db.php: Added get_db_value_filter(), get_db_all_rows_filter() and process_sql_delete(). Fixed delete_agent() style and use these functions. Added process_page_head() from functions_ui.php and changed a bit the config javascript object part. * include/functions_custom_graphs.php: Get results indexed by id on get_user_custom_graphs(). * include/functions.php: Moved process_page_head to functions_ui.php. * godmode/agentes/manage_delete.php: New interface to perform massive agents deletion. * godmode/menu.php: Added new option to massive agents deletion. * general/main_menu.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor.php, godmode/agentes/planned_downtime.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/configure_alert_template.php, godmode/reporting/map_builder.php, operation/agentes/networkmap.php, operation/reporting/reporting_viewer.php, operation/visual_console/render_view.php: Use new functions in include CSS and javascript files. * index.php: Bit of style when printing the header so the HTML can be readed easily in a editor. * include/javascript/pandora.js: Added a variable to determine the enterprise directory. * include/styles/pandora.css: Added style for manage_delete.php git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
2009-02-19 Esteban Sanchez <estebans@artica.es> * include/functions_ui.php: Added require_css_file(), require_javascript_file() and require_jquery_file() to add CSS, javascript and jQuery files to the header easily without changing config object. A path parameter is addded to allow the use on enterprise code. * include/functions_db.php: Added get_db_value_filter(), get_db_all_rows_filter() and process_sql_delete(). Fixed delete_agent() style and use these functions. Added process_page_head() from functions_ui.php and changed a bit the config javascript object part. * include/functions_custom_graphs.php: Get results indexed by id on get_user_custom_graphs(). * include/functions.php: Moved process_page_head to functions_ui.php. * godmode/agentes/manage_delete.php: New interface to perform massive agents deletion. * godmode/menu.php: Added new option to massive agents deletion. * general/main_menu.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor.php, godmode/agentes/planned_downtime.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/configure_alert_template.php, godmode/reporting/map_builder.php, operation/agentes/networkmap.php, operation/reporting/reporting_viewer.php, operation/visual_console/render_view.php: Use new functions in include CSS and javascript files. * index.php: Bit of style when printing the header so the HTML can be readed easily in a editor. * include/javascript/pandora.js: Added a variable to determine the enterprise directory. * include/styles/pandora.css: Added style for manage_delete.php git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
check_login ();
2009-04-02 Sancho Lerena <slerena@artica.es> * pandoradb.sql: Final DB changes proposed for closing this month the DB scheme. tagente-> new server_name field to assign server (old fields will be removed). talert_templates has two new types (warning, critical). tevento has "user_comment" new field. Tserver has three new fields, server_type (so some old fields will be deleted), threads and queued_modules this last two are for statistical options. Tusuario add language type to override global language. * update_manager/main.php: Minor changes for correct ACL usage. Non PM users could see in what revision it the system, but only that. * pandoradb_migrate_v2.x_to_v3.0.sql: Updated script for new DB changes. * general/noaccess.php: Added footer and ending div. Page was very ugly when showing noaccess errors, nobody see it ???. * godmode/menu.php: A LOT of ACL fixes on several options. * godmode/agentes/agent_manager.php: Fixed a crazy floating icon. * godmode/agentes/manage_config_remote.php: A LOT of changes, rewriting stuff, because was not working. This also adds a lot of ACL checks. * godmode/agentes/massive_config.php, massive*: ACL changes. * godmode/agentes/modificar_agente.php: Fixed ACL problems. * godmode/agentes/module_manager_editor.php: Fixed bad module categories for some types (data, plugin and prediction). * godmode/alerts/alert_list.php: Fixed ACL problem. * godmode/reporting/graph_builder.php: Added ACl restriction for non-viewable agents for current user. Seems to be a problem with data with more than 2 sources. * godmode/reporting/map_builder.php: ACL checks improved. * godmode/reporting/reporting_builder.php: ACL checks added (was missing), some code ported from 2.1, other is new. New fields shown in list. * include/functions.php: Fixed the annoying bug of "bad counters" in function human_time_description_raw(). Function used,format_numeric() should not be used never to calculate nothing, only to print formatted strings. * include/functions_db.php: Added function user_access_to_agent() to know if a given user has access to a given agent. * include/functioins_report.php: get_report() should let admin to watch any report. Fixed. * agentes/alerts_status.php: Fixed ACL problem for view alert. * operation/incidents/incident.php: Bad call for pagination() was giving problems to pagination call. Somebody changes pagination() interface and make this broken. Please if you change any interface, be sure that is compatible with old code or make a post in the list about this ! * godmode/users/user_edit.php: Additional ACL check to do not let anybody to watch non accesible users. Even for see the username or description. * reporting/pchart_graph.php:Progress bar shown text in white when > 60%. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1594 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-02 21:16:59 +02:00
if (! give_acl ($config['id_user'], 0, "AW")) {
2010-10-27 Miguel de Dios <miguel.dedios@artica.es> * godmode/admin_access_logs.php: added hooks to enterprise code, and added new filter with more options. * include/functions_db.php: erase the deprecated function "audit_db", and added in function "pandora_audit" two new parameters $user_id, $ip for pass this values when it are differents to the default values. Finally replaced the depecrated "audit_db" for "pandora_audit". * include/functions_events.php, include/functions_filemanager.php, include/ajax/reporting.ajax.php, include/ajax/visual_console_builder.ajax.php, include/ajax/alert_list.ajax.php, include/help/es/modu_group_list.php, include/functions_incidents.php, index.php, extensions/agents_modules.php, extensions/insert_data.php, extensions/system_info.php, extensions/dbmanager.php, extensions/update_manager/settings.php, extensions/pandora_logs.php, extensions/plugin_registration.php, operation/incidents/incident.php, operation/incidents/incident_detail.php, operation/incidents/incident_statistics.php, operation/extensions.php, operation/visual_console/render_view.php, operation/agentes/status_monitor.php, operation/agentes/export_csv.php, operation/agentes/datos_agente.php, operation/agentes/alerts_status.php, operation/agentes/estado_generalagente.php, operation/agentes/custom_fields.php, operation/agentes/estado_agente.php, operation/agentes/networkmap.topology.php, operation/agentes/networkmap.groups.php, operation/agentes/sla_view.php, operation/agentes/gis_view.php, operation/agentes/estado_monitores.php, operation/agentes/ver_agente.php, operation/agentes/graphs.php, operation/agentes/agent_fields.php, operation/agentes/tactical.php, operation/agentes/group_view.php, operation/agentes/networkmap.php, operation/servers/view_server.php,operation/servers/view_server_detail.php, operation/snmpconsole/snmp_view.php, operation/users/user_edit.php, operation/gis_maps/render_view.php, operation/events/event_statistics.php, operation/events/sound_events.php, operation/events/events_validate.php, operation/events/events_list.php, operation/events/events_marquee.php, operation/events/events.php, operation/reporting/reporting_xml.php, operation/reporting/reporting_viewer.php, operation/reporting/graph_viewer.php, mobile/operation/agents/view_agents.php, mobile/index.php, godmode/groups/modu_group_list.php, godmode/groups/configure_group.php, godmode/groups/configure_modu_group.php, godmode/groups/group_list.php, godmode/extensions.php, godmode/db/db_main.php, godmode/db/db_audit.php, godmode/db/db_sanity.php, godmode/db/db_refine.php, godmode/db/db_info.php, godmode/db/db_event.php, godmode/db/db_purge.php, godmode/agentes/fields_manager.php, godmode/agentes/module_manager.php, godmode/agentes/modificar_agente.php, godmode/agentes/configurar_agente.php, godmode/agentes/configure_field.php, godmode/agentes/planned_downtime.php, godmode/agentes/manage_config_remote.php, godmode/agentes/agent_manager.php, godmode/servers/manage_export.php, godmode/servers/recon_script.php, godmode/servers/manage_export_form.php, godmode/servers/plugin.php, godmode/servers/manage_recontask.php, godmode/servers/modificar_server.php, godmode/servers/manage_recontask_form.php, godmode/alerts/alert_list.list.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_template.php, godmode/alerts/alert_templates.php, godmode/alerts/configure_alert_action.php, godmode/alerts/configure_alert_command.php, godmode/alerts/alert_actions.php, godmode/alerts/alert_list.builder.php, godmode/alerts/alert_commands.php, godmode/snmpconsole/snmp_alert.php, godmode/snmpconsole/snmp_filters.php, godmode/setup/file_manager.php, godmode/setup/os.list.php, godmode/setup/news.php, godmode/setup/gis_step_2.php, godmode/setup/links.php, godmode/setup/setup.php, godmode/setup/os.php, godmode/setup/performance.php, godmode/setup/setup_auth.php, godmode/setup/gis.php, godmode/setup/os.builder.php, godmode/setup/setup_visuals.php, godmode/users/user_list.php, godmode/users/configure_user.php, godmode/users/configure_profile.php, godmode/gis_maps/configure_gis_map.php, godmode/gis_maps/index.php, godmode/massive/massive_add_alerts.php, godmode/massive/massive_copy_modules.php, godmode/massive/massive_delete_agents.php, godmode/massive/massive_enable_disable_alerts.php, godmode/massive/massive_operations.php, godmode/massive/massive_delete_profiles.php, godmode/massive/massive_edit_agents.php, godmode/massive/massive_delete_action_alerts.php, godmode/massive/massive_delete_modules.php, godmode/massive/massive_add_profiles.php, godmode/massive/massive_delete_alerts.php, godmode/massive/massive_edit_modules.php, godmode/massive/massive_standby_alerts.php, godmode/massive/massive_add_action_alerts.php, godmode/modules/manage_network_components_form.php, godmode/modules/manage_nc_groups_form.php, godmode/modules/manage_network_templates.php, godmode/modules/module_list.php, godmode/modules/manage_network_components_form_common.php, godmode/modules/manage_network_components_form_network.php, godmode/modules/manage_network_templates_form.php, godmode/modules/manage_network_components_form_wmi.php, godmode/modules/manage_network_components.php, godmode/modules/manage_nc_groups.php, godmode/reporting/reporting_builder.list_items.php, godmode/reporting/graph_builder.main.php, godmode/reporting/visual_console_builder.wizard.php, godmode/reporting/visual_console_builder.php, godmode/reporting/reporting_builder.preview.php, godmode/reporting/reporting_builder.main.php, godmode/reporting/visual_console_builder.data.php, godmode/reporting/map_builder_wizard.php, godmode/reporting/visual_console_builder.elements.php, godmode/reporting/graph_builder.php, godmode/reporting/visual_console_builder.preview.php, godmode/reporting/graph_builder.graph_editor.php, godmode/reporting/reporting_builder.php, godmode/reporting/visual_console_builder.editor.php, godmode/reporting/reporting_builder.item_editor.php, godmode/reporting/graphs.php, godmode/reporting/graph_builder.preview.php: Replaced the depecrated "audit_db" for "pandora_audit". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-27 12:47:07 +02:00
pandora_audit("ACL Violation",
2009-04-02 Sancho Lerena <slerena@artica.es> * pandoradb.sql: Final DB changes proposed for closing this month the DB scheme. tagente-> new server_name field to assign server (old fields will be removed). talert_templates has two new types (warning, critical). tevento has "user_comment" new field. Tserver has three new fields, server_type (so some old fields will be deleted), threads and queued_modules this last two are for statistical options. Tusuario add language type to override global language. * update_manager/main.php: Minor changes for correct ACL usage. Non PM users could see in what revision it the system, but only that. * pandoradb_migrate_v2.x_to_v3.0.sql: Updated script for new DB changes. * general/noaccess.php: Added footer and ending div. Page was very ugly when showing noaccess errors, nobody see it ???. * godmode/menu.php: A LOT of ACL fixes on several options. * godmode/agentes/agent_manager.php: Fixed a crazy floating icon. * godmode/agentes/manage_config_remote.php: A LOT of changes, rewriting stuff, because was not working. This also adds a lot of ACL checks. * godmode/agentes/massive_config.php, massive*: ACL changes. * godmode/agentes/modificar_agente.php: Fixed ACL problems. * godmode/agentes/module_manager_editor.php: Fixed bad module categories for some types (data, plugin and prediction). * godmode/alerts/alert_list.php: Fixed ACL problem. * godmode/reporting/graph_builder.php: Added ACl restriction for non-viewable agents for current user. Seems to be a problem with data with more than 2 sources. * godmode/reporting/map_builder.php: ACL checks improved. * godmode/reporting/reporting_builder.php: ACL checks added (was missing), some code ported from 2.1, other is new. New fields shown in list. * include/functions.php: Fixed the annoying bug of "bad counters" in function human_time_description_raw(). Function used,format_numeric() should not be used never to calculate nothing, only to print formatted strings. * include/functions_db.php: Added function user_access_to_agent() to know if a given user has access to a given agent. * include/functioins_report.php: get_report() should let admin to watch any report. Fixed. * agentes/alerts_status.php: Fixed ACL problem for view alert. * operation/incidents/incident.php: Bad call for pagination() was giving problems to pagination call. Somebody changes pagination() interface and make this broken. Please if you change any interface, be sure that is compatible with old code or make a post in the list about this ! * godmode/users/user_edit.php: Additional ACL check to do not let anybody to watch non accesible users. Even for see the username or description. * reporting/pchart_graph.php:Progress bar shown text in white when > 60%. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1594 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-02 21:16:59 +02:00
"Trying to access massive agent deletion section");
2009-02-19 Esteban Sanchez <estebans@artica.es> * include/functions_ui.php: Added require_css_file(), require_javascript_file() and require_jquery_file() to add CSS, javascript and jQuery files to the header easily without changing config object. A path parameter is addded to allow the use on enterprise code. * include/functions_db.php: Added get_db_value_filter(), get_db_all_rows_filter() and process_sql_delete(). Fixed delete_agent() style and use these functions. Added process_page_head() from functions_ui.php and changed a bit the config javascript object part. * include/functions_custom_graphs.php: Get results indexed by id on get_user_custom_graphs(). * include/functions.php: Moved process_page_head to functions_ui.php. * godmode/agentes/manage_delete.php: New interface to perform massive agents deletion. * godmode/menu.php: Added new option to massive agents deletion. * general/main_menu.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor.php, godmode/agentes/planned_downtime.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/configure_alert_template.php, godmode/reporting/map_builder.php, operation/agentes/networkmap.php, operation/reporting/reporting_viewer.php, operation/visual_console/render_view.php: Use new functions in include CSS and javascript files. * index.php: Bit of style when printing the header so the HTML can be readed easily in a editor. * include/javascript/pandora.js: Added a variable to determine the enterprise directory. * include/styles/pandora.css: Added style for manage_delete.php git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
require ("general/noaccess.php");
return;
}
require_once ('include/functions_agents.php');
require_once ('include/functions_alerts.php');
require_once ('include/functions_modules.php');
function process_manage_delete ($id_agents) {
if (empty ($id_agents)) {
echo '<h3 class="error">'.__('No agents selected').'</h3>';
return false;
}
2009-02-19 Esteban Sanchez <estebans@artica.es> * include/functions_ui.php: Added require_css_file(), require_javascript_file() and require_jquery_file() to add CSS, javascript and jQuery files to the header easily without changing config object. A path parameter is addded to allow the use on enterprise code. * include/functions_db.php: Added get_db_value_filter(), get_db_all_rows_filter() and process_sql_delete(). Fixed delete_agent() style and use these functions. Added process_page_head() from functions_ui.php and changed a bit the config javascript object part. * include/functions_custom_graphs.php: Get results indexed by id on get_user_custom_graphs(). * include/functions.php: Moved process_page_head to functions_ui.php. * godmode/agentes/manage_delete.php: New interface to perform massive agents deletion. * godmode/menu.php: Added new option to massive agents deletion. * general/main_menu.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor.php, godmode/agentes/planned_downtime.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/configure_alert_template.php, godmode/reporting/map_builder.php, operation/agentes/networkmap.php, operation/reporting/reporting_viewer.php, operation/visual_console/render_view.php: Use new functions in include CSS and javascript files. * index.php: Bit of style when printing the header so the HTML can be readed easily in a editor. * include/javascript/pandora.js: Added a variable to determine the enterprise directory. * include/styles/pandora.css: Added style for manage_delete.php git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
$id_agents = (array) $id_agents;
$copy_modules = (bool) get_parameter ('copy_modules');
$copy_alerts = (bool) get_parameter ('copy_alerts');
process_sql_begin ();
2009-02-19 Esteban Sanchez <estebans@artica.es> * include/functions_ui.php: Added require_css_file(), require_javascript_file() and require_jquery_file() to add CSS, javascript and jQuery files to the header easily without changing config object. A path parameter is addded to allow the use on enterprise code. * include/functions_db.php: Added get_db_value_filter(), get_db_all_rows_filter() and process_sql_delete(). Fixed delete_agent() style and use these functions. Added process_page_head() from functions_ui.php and changed a bit the config javascript object part. * include/functions_custom_graphs.php: Get results indexed by id on get_user_custom_graphs(). * include/functions.php: Moved process_page_head to functions_ui.php. * godmode/agentes/manage_delete.php: New interface to perform massive agents deletion. * godmode/menu.php: Added new option to massive agents deletion. * general/main_menu.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor.php, godmode/agentes/planned_downtime.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/configure_alert_template.php, godmode/reporting/map_builder.php, operation/agentes/networkmap.php, operation/reporting/reporting_viewer.php, operation/visual_console/render_view.php: Use new functions in include CSS and javascript files. * index.php: Bit of style when printing the header so the HTML can be readed easily in a editor. * include/javascript/pandora.js: Added a variable to determine the enterprise directory. * include/styles/pandora.css: Added style for manage_delete.php git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
$error = false;
foreach ($id_agents as $id_agent) {
$success = delete_agent ($id_agent);
if (! $success)
break;
}
if (! $success) {
echo '<h3 class="error">'.__('There was an error deleting the agent, the operation has been cancelled').'</h3>';
echo '<h4>'.__('Could not delete agent').' '.get_agent_name ($id_agent).'</h4>';
process_sql_rollback ();
return false;
}
else {
2009-02-19 Esteban Sanchez <estebans@artica.es> * include/functions_ui.php: Added require_css_file(), require_javascript_file() and require_jquery_file() to add CSS, javascript and jQuery files to the header easily without changing config object. A path parameter is addded to allow the use on enterprise code. * include/functions_db.php: Added get_db_value_filter(), get_db_all_rows_filter() and process_sql_delete(). Fixed delete_agent() style and use these functions. Added process_page_head() from functions_ui.php and changed a bit the config javascript object part. * include/functions_custom_graphs.php: Get results indexed by id on get_user_custom_graphs(). * include/functions.php: Moved process_page_head to functions_ui.php. * godmode/agentes/manage_delete.php: New interface to perform massive agents deletion. * godmode/menu.php: Added new option to massive agents deletion. * general/main_menu.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor.php, godmode/agentes/planned_downtime.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/configure_alert_template.php, godmode/reporting/map_builder.php, operation/agentes/networkmap.php, operation/reporting/reporting_viewer.php, operation/visual_console/render_view.php: Use new functions in include CSS and javascript files. * index.php: Bit of style when printing the header so the HTML can be readed easily in a editor. * include/javascript/pandora.js: Added a variable to determine the enterprise directory. * include/styles/pandora.css: Added style for manage_delete.php git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
echo '<h3 class="suc">'.__('Successfully deleted').'</h3>';
process_sql_commit ();
return true;
2009-02-19 Esteban Sanchez <estebans@artica.es> * include/functions_ui.php: Added require_css_file(), require_javascript_file() and require_jquery_file() to add CSS, javascript and jQuery files to the header easily without changing config object. A path parameter is addded to allow the use on enterprise code. * include/functions_db.php: Added get_db_value_filter(), get_db_all_rows_filter() and process_sql_delete(). Fixed delete_agent() style and use these functions. Added process_page_head() from functions_ui.php and changed a bit the config javascript object part. * include/functions_custom_graphs.php: Get results indexed by id on get_user_custom_graphs(). * include/functions.php: Moved process_page_head to functions_ui.php. * godmode/agentes/manage_delete.php: New interface to perform massive agents deletion. * godmode/menu.php: Added new option to massive agents deletion. * general/main_menu.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor.php, godmode/agentes/planned_downtime.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/configure_alert_template.php, godmode/reporting/map_builder.php, operation/agentes/networkmap.php, operation/reporting/reporting_viewer.php, operation/visual_console/render_view.php: Use new functions in include CSS and javascript files. * index.php: Bit of style when printing the header so the HTML can be readed easily in a editor. * include/javascript/pandora.js: Added a variable to determine the enterprise directory. * include/styles/pandora.css: Added style for manage_delete.php git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
}
}
$id_group = (int) get_parameter ('id_group');
$id_agents = get_parameter ('id_agents');
2009-02-19 Esteban Sanchez <estebans@artica.es> * include/functions_ui.php: Added require_css_file(), require_javascript_file() and require_jquery_file() to add CSS, javascript and jQuery files to the header easily without changing config object. A path parameter is addded to allow the use on enterprise code. * include/functions_db.php: Added get_db_value_filter(), get_db_all_rows_filter() and process_sql_delete(). Fixed delete_agent() style and use these functions. Added process_page_head() from functions_ui.php and changed a bit the config javascript object part. * include/functions_custom_graphs.php: Get results indexed by id on get_user_custom_graphs(). * include/functions.php: Moved process_page_head to functions_ui.php. * godmode/agentes/manage_delete.php: New interface to perform massive agents deletion. * godmode/menu.php: Added new option to massive agents deletion. * general/main_menu.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor.php, godmode/agentes/planned_downtime.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/configure_alert_template.php, godmode/reporting/map_builder.php, operation/agentes/networkmap.php, operation/reporting/reporting_viewer.php, operation/visual_console/render_view.php: Use new functions in include CSS and javascript files. * index.php: Bit of style when printing the header so the HTML can be readed easily in a editor. * include/javascript/pandora.js: Added a variable to determine the enterprise directory. * include/styles/pandora.css: Added style for manage_delete.php git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
$delete = (bool) get_parameter_post ('delete');
if ($delete) {
$result = process_manage_delete ($id_agents);
if ($result) {
pandora_audit("Masive management", "Delete agent ", false, false,
'Agent: ' . json_encode($id_agents));
}
else {
pandora_audit("Masive management", "Fail try to delete agent", false, false,
'Agent: ' . json_encode($id_agents));
}
2009-02-19 Esteban Sanchez <estebans@artica.es> * include/functions_ui.php: Added require_css_file(), require_javascript_file() and require_jquery_file() to add CSS, javascript and jQuery files to the header easily without changing config object. A path parameter is addded to allow the use on enterprise code. * include/functions_db.php: Added get_db_value_filter(), get_db_all_rows_filter() and process_sql_delete(). Fixed delete_agent() style and use these functions. Added process_page_head() from functions_ui.php and changed a bit the config javascript object part. * include/functions_custom_graphs.php: Get results indexed by id on get_user_custom_graphs(). * include/functions.php: Moved process_page_head to functions_ui.php. * godmode/agentes/manage_delete.php: New interface to perform massive agents deletion. * godmode/menu.php: Added new option to massive agents deletion. * general/main_menu.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor.php, godmode/agentes/planned_downtime.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/configure_alert_template.php, godmode/reporting/map_builder.php, operation/agentes/networkmap.php, operation/reporting/reporting_viewer.php, operation/visual_console/render_view.php: Use new functions in include CSS and javascript files. * index.php: Bit of style when printing the header so the HTML can be readed easily in a editor. * include/javascript/pandora.js: Added a variable to determine the enterprise directory. * include/styles/pandora.css: Added style for manage_delete.php git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
}
$groups = get_user_groups ();
$table->id = 'delete_table';
$table->width = '95%';
$table->data = array ();
$table->style = array ();
$table->style[0] = 'font-weight: bold; vertical-align:top';
$table->style[2] = 'font-weight: bold';
$table->size = array ();
$table->size[0] = '15%';
$table->size[1] = '85%';
$table->data = array ();
$table->data[0][0] = __('Group');
2010-07-15 Miguel de Dios <miguel.dedios@artica.es> * include/functions_html.php: added the function "print_select_groups" to print the field select box for groups with tree style. * include/functions_db.php: in function "get_user_groups" added test to false value in parameter $privilege for get all groups without ACL test. Fixed in function "get_user_groups_tree" the call to "get_user_groups" with the correct parameters. * operation/incidents/incident.php, operation/incidents/incident_detail.php, operation/events/events.php, operation/agentes/status_monitor.php, operation/agentes/estado_agente.php, operation/agentes/alerts_status.functions.php, operation/agentes/exportdata.php, operation/agentes/networkmap.php, operation/messages/message.php, general/ui/agents_list.php, godmode/groups/configure_group.php, godmode/groups/group_list.php, godmode/agentes/massive_add_alerts.php, godmode/agentes/massive_delete_agents.php, godmode/agentes/massive_config.php, godmode/agentes/massive_delete_action_alerts.php, godmode/agentes/massive_delete_alerts.php, godmode/agentes/modificar_agente.php, godmode/agentes/massive_delete_modules.php, godmode/agentes/massive_add_action_alerts.php, godmode/agentes/planned_downtime.php, godmode/agentes/manage_config_remote.php, godmode/agentes/agent_manager.php, godmode/servers/manage_recontask_form.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/alert_compounds.php, godmode/alerts/configure_alert_template.php, godmode/alerts/configure_alert_action.php, godmode/setup/gis_step_2.php, godmode/users/configure_user.php, godmode/gis_maps/configure_gis_map.php, godmode/reporting/graph_builder.main.php, godmode/reporting/reporting_builder.main.php, godmode/reporting/visual_console_builder.data.php: changed the fields select box of group to tree style select box for groups. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3009 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-07-15 17:20:43 +02:00
$table->data[0][1] = print_select_groups(false, "AR", true, 'id_group', $id_group,
2009-02-19 Esteban Sanchez <estebans@artica.es> * include/functions_ui.php: Added require_css_file(), require_javascript_file() and require_jquery_file() to add CSS, javascript and jQuery files to the header easily without changing config object. A path parameter is addded to allow the use on enterprise code. * include/functions_db.php: Added get_db_value_filter(), get_db_all_rows_filter() and process_sql_delete(). Fixed delete_agent() style and use these functions. Added process_page_head() from functions_ui.php and changed a bit the config javascript object part. * include/functions_custom_graphs.php: Get results indexed by id on get_user_custom_graphs(). * include/functions.php: Moved process_page_head to functions_ui.php. * godmode/agentes/manage_delete.php: New interface to perform massive agents deletion. * godmode/menu.php: Added new option to massive agents deletion. * general/main_menu.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor.php, godmode/agentes/planned_downtime.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/configure_alert_template.php, godmode/reporting/map_builder.php, operation/agentes/networkmap.php, operation/reporting/reporting_viewer.php, operation/visual_console/render_view.php: Use new functions in include CSS and javascript files. * index.php: Bit of style when printing the header so the HTML can be readed easily in a editor. * include/javascript/pandora.js: Added a variable to determine the enterprise directory. * include/styles/pandora.css: Added style for manage_delete.php git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
false, '', '', true);
$table->data[1][0] = __('Agents');
$table->data[1][0] .= '<span id="agent_loading" class="invisible">';
2011-02-03 Juan Manuel Ramon <juanmanuel.ramon@artica.es> * include/functions_menu.php include/functions_html.php include/functions_modules.php include/functions_reporting.php include/functions_filemanager.php include/functions_gis.php include/functions_networkmap.php include/functions_visual_map.php include/help/en/help_gis_map_builder.php include/help/en/help_agent_status.php include/help/en/help_eventview.php include/help/en/help_configure_gis_map.php include/help/en/help_cascade_protection.php include/help/en/help_setup_gis_index.php include/help/es/help_gis_map_builder.php include/help/es/help_agent_status.php include/help/es/help_eventview.php include/help/es/help_configure_gis_map.php include/help/es/help_cascade_protection.php include/help/es/modu_group_list.php include/help/ja/help_gis_map_builder.php include/help/ja/help_agent_status.php include/help/ja/help_eventview.php include/help/ja/help_configure_gis_map.php include/help/ja/help_cascade_protection.php include/help/ja/help_setup_gis_index.php include/functions.php include/functions_db.php include/functions_fsgraph.php operation/incidents/incident_detail.php operation/agentes/status_monitor.php operation/agentes/estado_ultimopaquete.php operation/agentes/alerts_status.php operation/agentes/estado_generalagente.php operation/agentes/estado_agente.php operation/agentes/estado_monitores.php operation/agentes/ver_agente.php operation/agentes/group_view.php operation/servers/view_server_detail.php operation/snmpconsole/snmp_view.php operation/users/user_edit.php operation/gis_maps/render_view.php operation/events/sound_events.php operation/search_alerts.php operation/reporting/reporting_viewer.php operation/reporting/custom_reporting.php operation/search_reports.php operation/search_users.php general/pandora_help.php general/noaccess.php general/ui/agents_list.php general/header.php godmode/groups/modu_group_list.php godmode/groups/configure_group.php godmode/groups/group_list.php godmode/extensions.php godmode/db/db_sanity.php godmode/db/db_info.php godmode/agentes/agent_template.php godmode/agentes/module_manager_editor_common.php godmode/agentes/module_manager_editor_network.php godmode/agentes/fields_manager.php godmode/agentes/module_manager.php godmode/agentes/modificar_agente.php godmode/agentes/planned_downtime.php godmode/agentes/agent_manager.php godmode/servers/recon_script.php godmode/servers/plugin.php godmode/servers/manage_recontask.php godmode/alerts/alert_list.list.php godmode/alerts/configure_alert_compound.php godmode/alerts/alert_compounds.php godmode/alerts/alert_actions.php godmode/alerts/alert_list.builder.php godmode/alerts/alert_commands.php godmode/snmpconsole/snmp_alert.php godmode/snmpconsole/snmp_filters.php godmode/setup/os.list.php godmode/setup/news.php godmode/setup/links.php godmode/setup/setup.php godmode/users/user_list.php godmode/gis_maps/configure_gis_map.php godmode/massive/massive_add_alerts.php godmode/massive/massive_delete_agents.php godmode/massive/massive_enable_disable_alerts.php godmode/massive/massive_delete_profiles.php godmode/massive/massive_edit_agents.php godmode/massive/massive_delete_action_alerts.php godmode/massive/massive_delete_modules.php godmode/massive/massive_add_profiles.php godmode/massive/massive_delete_alerts.php godmode/massive/massive_edit_modules.php godmode/massive/massive_standby_alerts.php godmode/massive/massive_add_action_alerts.php godmode/modules/module_list.php godmode/modules/manage_network_templates_form.php godmode/reporting/reporting_builder.list_items.php godmode/reporting/reporting_builder.preview.php godmode/reporting/visual_console_builder.elements.php godmode/reporting/graph_builder.graph_editor.php godmode/reporting/reporting_builder.item_editor.php godmode/reporting/graphs.php: Changed the way of print images from "<src=.." html tag to print_image function. * include/functions_ui.php mobile/operation/agents/view_agents.php: print_group_icon2 function renamed to print_group_icon_with_path git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3800 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-02-04 14:30:50 +01:00
$table->data[1][0] .= print_image('images/spinner.png', true);
2009-02-19 Esteban Sanchez <estebans@artica.es> * include/functions_ui.php: Added require_css_file(), require_javascript_file() and require_jquery_file() to add CSS, javascript and jQuery files to the header easily without changing config object. A path parameter is addded to allow the use on enterprise code. * include/functions_db.php: Added get_db_value_filter(), get_db_all_rows_filter() and process_sql_delete(). Fixed delete_agent() style and use these functions. Added process_page_head() from functions_ui.php and changed a bit the config javascript object part. * include/functions_custom_graphs.php: Get results indexed by id on get_user_custom_graphs(). * include/functions.php: Moved process_page_head to functions_ui.php. * godmode/agentes/manage_delete.php: New interface to perform massive agents deletion. * godmode/menu.php: Added new option to massive agents deletion. * general/main_menu.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor.php, godmode/agentes/planned_downtime.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/configure_alert_template.php, godmode/reporting/map_builder.php, operation/agentes/networkmap.php, operation/reporting/reporting_viewer.php, operation/visual_console/render_view.php: Use new functions in include CSS and javascript files. * index.php: Bit of style when printing the header so the HTML can be readed easily in a editor. * include/javascript/pandora.js: Added a variable to determine the enterprise directory. * include/styles/pandora.css: Added style for manage_delete.php git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
$table->data[1][0] .= '</span>';
$table->data[1][1] = print_select (get_group_agents ($id_group, false, "none"),
'id_agents[]', 0, false, '', '', true, true);
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_agents" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
2009-02-19 Esteban Sanchez <estebans@artica.es> * include/functions_ui.php: Added require_css_file(), require_javascript_file() and require_jquery_file() to add CSS, javascript and jQuery files to the header easily without changing config object. A path parameter is addded to allow the use on enterprise code. * include/functions_db.php: Added get_db_value_filter(), get_db_all_rows_filter() and process_sql_delete(). Fixed delete_agent() style and use these functions. Added process_page_head() from functions_ui.php and changed a bit the config javascript object part. * include/functions_custom_graphs.php: Get results indexed by id on get_user_custom_graphs(). * include/functions.php: Moved process_page_head to functions_ui.php. * godmode/agentes/manage_delete.php: New interface to perform massive agents deletion. * godmode/menu.php: Added new option to massive agents deletion. * general/main_menu.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor.php, godmode/agentes/planned_downtime.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/configure_alert_template.php, godmode/reporting/map_builder.php, operation/agentes/networkmap.php, operation/reporting/reporting_viewer.php, operation/visual_console/render_view.php: Use new functions in include CSS and javascript files. * index.php: Bit of style when printing the header so the HTML can be readed easily in a editor. * include/javascript/pandora.js: Added a variable to determine the enterprise directory. * include/styles/pandora.css: Added style for manage_delete.php git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
print_input_hidden ('delete', 1);
print_submit_button (__('Delete'), 'go', false, 'class="sub delete"');
echo '</div>';
echo '</form>';
echo '<h3 class="error invisible" id="message"> </h3>';
require_jquery_file ('form');
require_jquery_file ('pandora.controls');
?>
<script type="text/javascript">
$(document).ready (function () {
$("#id_group").pandoraSelectGroupAgent ({
2009-03-17 Esteban Sanchez <estebans@artica.es> * godmode/agentes/massive_operations.php: Added to repository. New page to group massive operations in a single page. * godmode/agentes/massive_config.php: Renamed from manage_config.php. * godmode/agentes/massive_delete_agents.php: Renamed from manage_delete.php. * godmode/agentes/massive_delete_modules.php: Added to repository. Interface to delete modules. * godmode/agentes/massive_delete_alerts.php: Added to repository. Interface to delete alerts. * godmode/agentes/agent_manager.php: Fixed table width to make it variable. * godmode/agentes/module_manager.php: Rewritten to use Pandora functions. * include/javascript/jquery.pandora.controls.js: Added pandoraSelectAgentAlert. Renamed pandoraSelectAgent to pandoraSelectAgentModule. Get only needed fields to make it quicker and avoid showing disabled modules. * godmode/alerts/alert_list.php: Adapted to changes in jquery.pandora.controls.js. * godmode/menu.php: Group some pages into new "Massive operation" submenu. * images/copy.png: Replaced with a better icon. * images/delete_agents.png, images/delete_alerts.php, images/delete_modules.php: Added to repository. * include/styles/pandora.css: Set color on input.sub * include/styles/pandora_width.css: Make menu_tab_frame wider. * include/functions_db.php: Removed deprecated dame_nombre_grupomodulo(). Added support to __() to receive multiple parameters so translatable strings can handle now printf format characters. * include/functions_modules.php: Added delete_agent_module(). * operation/agentes/ver_agente.php: Allow fields to be passed to get_agent_modules_json AJAX operation. * reporting/fgraph.php: Replaced sprintf() with __(). Some casts added. Show a sparse chart even if it has no max/min value. * godmode/modules/manage_network_components_form_network.php, operation/agentes/estado_ultimopaquete.php, godmode/modules/manage_network_components_form_wmi.php: Use get_modulegroup_name(). * godmode/agentes/configurar_agente.php, godmode/modules/manage_network_components.php: Style correction. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1544 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-17 16:15:55 +01:00
agentSelect: "select#id_agents"
2009-02-19 Esteban Sanchez <estebans@artica.es> * include/functions_ui.php: Added require_css_file(), require_javascript_file() and require_jquery_file() to add CSS, javascript and jQuery files to the header easily without changing config object. A path parameter is addded to allow the use on enterprise code. * include/functions_db.php: Added get_db_value_filter(), get_db_all_rows_filter() and process_sql_delete(). Fixed delete_agent() style and use these functions. Added process_page_head() from functions_ui.php and changed a bit the config javascript object part. * include/functions_custom_graphs.php: Get results indexed by id on get_user_custom_graphs(). * include/functions.php: Moved process_page_head to functions_ui.php. * godmode/agentes/manage_delete.php: New interface to perform massive agents deletion. * godmode/menu.php: Added new option to massive agents deletion. * general/main_menu.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor.php, godmode/agentes/planned_downtime.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/configure_alert_template.php, godmode/reporting/map_builder.php, operation/agentes/networkmap.php, operation/reporting/reporting_viewer.php, operation/visual_console/render_view.php: Use new functions in include CSS and javascript files. * index.php: Bit of style when printing the header so the HTML can be readed easily in a editor. * include/javascript/pandora.js: Added a variable to determine the enterprise directory. * include/styles/pandora.css: Added style for manage_delete.php git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
});
});
</script>