2010-09-29 12:28:10 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
|
|
|
|
// 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,
|
|
|
|
// 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 ();
|
|
|
|
|
|
|
|
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",
|
2010-09-29 12:28:10 +02:00
|
|
|
"Trying to access massive agent deletion section");
|
|
|
|
require ("general/noaccess.php");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
require_once ('include/functions_agents.php');
|
|
|
|
require_once ('include/functions_ui.php');
|
|
|
|
require_once ('include/functions_alerts.php');
|
|
|
|
require_once ('include/functions_modules.php');
|
|
|
|
require_once ('include/functions_servers.php');
|
|
|
|
require_once ('include/functions_gis.php');
|
|
|
|
|
|
|
|
if (is_ajax ()) {
|
|
|
|
$get_n_conf_files = (bool) get_parameter ('get_n_conf_files');
|
|
|
|
|
|
|
|
if ($get_n_conf_files) {
|
|
|
|
$id_agents = get_parameter('id_agents');
|
|
|
|
$cont = 0;
|
|
|
|
foreach($id_agents as $id_agent) {
|
|
|
|
$name = get_agent_name($id_agent);
|
|
|
|
$agent_md5 = md5($name);
|
|
|
|
if (file_exists ($config["remote_config"]."/md5/".$agent_md5.".md5"))
|
|
|
|
$cont ++;
|
|
|
|
}
|
2010-10-27 19:28:05 +02:00
|
|
|
|
2010-09-29 12:28:10 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$update_agents = get_parameter ('update_agents', 0);
|
|
|
|
|
|
|
|
if ($update_agents) {
|
|
|
|
$values = array();
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (get_parameter ('group', '') != -1)
|
2010-09-29 12:28:10 +02:00
|
|
|
$values['id_grupo'] = get_parameter ('group');
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (get_parameter ('interval', '') != '')
|
2010-09-29 12:28:10 +02:00
|
|
|
$values['intervalo'] = get_parameter ('interval');
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (get_parameter ('id_os', '') != -1)
|
2010-09-29 12:28:10 +02:00
|
|
|
$values['id_os'] = get_parameter ('id_os');
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (get_parameter ('id_parent', '') != '')
|
2010-12-22 19:56:36 +01:00
|
|
|
$values['id_parent'] = get_agent_id(get_parameter ('id_parent'));
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (get_parameter ('server_name', '') != -1)
|
2010-09-29 12:28:10 +02:00
|
|
|
$values['server_name'] = get_parameter ('server_name');
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (get_parameter ('description', '') != '')
|
2010-09-29 12:28:10 +02:00
|
|
|
$values['comentarios'] = get_parameter ('description');
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (get_parameter ('mode', '') != -1)
|
2010-09-29 12:28:10 +02:00
|
|
|
$values['modo'] = get_parameter ('mode');
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (get_parameter ('disabled', '') != -1)
|
2010-09-29 12:28:10 +02:00
|
|
|
$values['disabled'] = get_parameter ('disabled');
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (get_parameter ('icon_path', '') != '')
|
2010-09-29 12:28:10 +02:00
|
|
|
$values['icon_path'] = get_parameter('icon_path');
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (get_parameter ('update_gis_data', -1) != -1)
|
2010-09-29 12:28:10 +02:00
|
|
|
$values['update_gis_data'] = get_parameter('update_gis_data');
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (get_parameter ('custom_id', '') != '')
|
2010-09-29 12:28:10 +02:00
|
|
|
$values['custom_id'] = get_parameter('custom_id');
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (get_parameter ('cascade_protection', -1) != -1)
|
2010-09-29 12:28:10 +02:00
|
|
|
$values['cascade_protection'] = get_parameter('cascade_protection');
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (get_parameter ('delete_conf', 0) != 0)
|
2010-09-29 12:28:10 +02:00
|
|
|
$values['delete_conf'] = get_parameter('delete_conf');
|
|
|
|
|
|
|
|
$fields = get_db_all_fields_in_table('tagent_custom_fields');
|
|
|
|
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if ($fields === false) $fields = array();
|
2010-09-29 12:28:10 +02:00
|
|
|
|
|
|
|
$id_agents = get_parameter('id_agents', false);
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (!$id_agents) {
|
2010-09-29 12:28:10 +02:00
|
|
|
print_error_message(__('No agents selected'));
|
|
|
|
$id_agents = array();
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (empty($values) && empty($fields)) {
|
2010-09-29 12:28:10 +02:00
|
|
|
print_error_message(__('No values changed'));
|
|
|
|
$id_agents = array();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// CONF FILE DELETION
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (isset($values['delete_conf'])) {
|
2010-09-29 12:28:10 +02:00
|
|
|
unset($values['delete_conf']);
|
|
|
|
$n_deleted = 0;
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
foreach ($id_agents as $id_agent) {
|
2010-09-29 12:28:10 +02:00
|
|
|
$agent_md5 = md5(get_agent_name($id_agent));
|
|
|
|
@unlink ($config["remote_config"]."/md5/".$agent_md5.".md5");
|
|
|
|
$result = @unlink ($config["remote_config"]."/conf/".$agent_md5.".conf");
|
|
|
|
|
|
|
|
$n_deleted += (int)$result;
|
|
|
|
}
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
if ($n_deleted > 0) {
|
|
|
|
pandora_audit("Masive management", "Delete conf file " . $id_agent);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
pandora_audit("Masive management", "Try to delete conf file " . $id_agent);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print_result_message ($n_deleted > 0,
|
2010-09-29 12:28:10 +02:00
|
|
|
__('Configuration files deleted successfully').'('.$n_deleted.')',
|
|
|
|
__('Configuration files cannot be deleted'));
|
|
|
|
}
|
|
|
|
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (empty($values) && empty($fields)) {
|
2010-09-29 12:28:10 +02:00
|
|
|
$id_agents = array();
|
|
|
|
}
|
|
|
|
|
|
|
|
$n_edited = 0;
|
|
|
|
$result = false;
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
foreach ($id_agents as $id_agent) {
|
|
|
|
if (!empty($values)) {
|
2010-09-29 12:28:10 +02:00
|
|
|
$result = process_sql_update ('tagente',
|
|
|
|
$values,
|
|
|
|
array ('id_agente' => $id_agent));
|
|
|
|
}
|
|
|
|
|
|
|
|
// Update Custom Fields
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
foreach ($fields as $field) {
|
|
|
|
if (get_parameter_post ('customvalue_'.$field['id_field'], '') != '') {
|
2010-09-29 12:28:10 +02:00
|
|
|
$key = $field['id_field'];
|
|
|
|
$value = get_parameter_post ('customvalue_'.$field['id_field'], '');
|
|
|
|
|
|
|
|
$old_value = get_db_all_rows_filter('tagent_custom_data', array('id_agent' => $id_agent, 'id_field' => $key));
|
|
|
|
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if ($old_value === false) {
|
2010-09-29 12:28:10 +02:00
|
|
|
// Create custom field if not exist
|
|
|
|
$result = process_sql_insert ('tagent_custom_data',
|
|
|
|
array('id_field' => $key,'id_agent' => $id_agent, 'description' => $value));
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
}
|
|
|
|
else {
|
2010-09-29 12:28:10 +02:00
|
|
|
$result = process_sql_update ('tagent_custom_data',
|
|
|
|
array('description' => $value),
|
|
|
|
array('id_field' => $key,'id_agent' => $id_agent));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$n_edited += (int)$result;
|
|
|
|
}
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
if ($n_edited > 0) {
|
|
|
|
pandora_audit("Masive management", "Update agent " . $id_agent, false, false, json_encode($fields));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
pandora_audit("Masive management", "Try to update agent " . $id_agent, false, false, json_encode($fields));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-09-29 12:28:10 +02:00
|
|
|
print_result_message ($n_edited > 0,
|
|
|
|
__('Agents updated successfully').'('.$n_edited.')',
|
|
|
|
__('Agents cannot be updated'));
|
|
|
|
|
|
|
|
}
|
|
|
|
$id_group = 0;
|
|
|
|
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
$groups = get_user_groups();
|
2010-09-29 12:28:10 +02:00
|
|
|
|
|
|
|
$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');
|
|
|
|
$table->data[0][1] = print_select_groups(false, "AR", true, 'id_group', $id_group,
|
|
|
|
false, '', '', true);
|
|
|
|
|
|
|
|
$table->data[1][0] = __('Agents');
|
|
|
|
$table->data[1][0] .= '<span id="agent_loading" class="invisible">';
|
2011-02-04 14:30:50 +01:00
|
|
|
$table->data[1][0] .= print_image('images/spinner.png', true);
|
2010-09-29 12:28:10 +02:00
|
|
|
$table->data[1][0] .= '</span>';
|
|
|
|
$enabled_agents = get_group_agents ($id_group, array('disabled' => 0), "none");
|
|
|
|
$all_agents = get_group_agents ($id_group, array('disabled' => 1), "none") + $enabled_agents;
|
|
|
|
|
|
|
|
$table->data[1][1] = print_select ($all_agents,
|
|
|
|
'id_agents[]', 0, false, '', '', true, true);
|
|
|
|
|
2010-10-12 03:32:05 +02:00
|
|
|
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_agents" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
|
2010-09-29 12:28:10 +02:00
|
|
|
print_table ($table);
|
|
|
|
|
|
|
|
$nombre_agente = "";
|
|
|
|
$direccion_agente = "";
|
|
|
|
$id_agente = 0;
|
|
|
|
$id_parent = 0;
|
|
|
|
$cascade_protection = 0;
|
|
|
|
$group = 0;
|
|
|
|
$interval = '';
|
|
|
|
$id_os = 0;
|
|
|
|
$server_name = 0;
|
|
|
|
$description = "";
|
|
|
|
|
|
|
|
echo '<div id="form_agents" style="display: none;">';
|
|
|
|
|
|
|
|
$table->width = '95%';
|
|
|
|
$table->class = "databox_color";
|
|
|
|
|
|
|
|
$table->head = array ();
|
|
|
|
$table->style = array ();
|
|
|
|
$table->style[0] = 'font-weight: bold; width: 150px;';
|
|
|
|
$table->data = array ();
|
|
|
|
|
|
|
|
$groups = get_user_groups ($config["id_user"], "AR",false);
|
|
|
|
$agents = get_group_agents (array_keys ($groups));
|
|
|
|
|
2010-10-07 10:13:36 +02:00
|
|
|
$table->data[0][0] = __('Parent');
|
|
|
|
$table->data[0][1] = print_input_text_extended ('id_parent', get_agent_name ($id_parent), 'text-id_parent', '', 30, 100, false, '',
|
2010-09-29 12:28:10 +02:00
|
|
|
array('style' => 'background: url(images/lightning.png) no-repeat right;'), true)
|
|
|
|
. '<a href="#" class="tip"> <span>' . __("Type at least two characters to search") . '</span></a>';
|
|
|
|
|
2010-10-07 10:13:36 +02:00
|
|
|
$table->data[0][1] .= print_checkbox ("cascade_protection", 1, $cascade_protection, true).__('Cascade protection'). " " . print_help_icon("cascade_protection", true);
|
2010-09-29 12:28:10 +02:00
|
|
|
|
2010-10-07 10:13:36 +02:00
|
|
|
$table->data[1][0] = __('Group');
|
|
|
|
$table->data[1][1] = print_select_groups(false, "AR", false, 'group', $group, '', __('No change'), -1, true, false, true, '', false, 'width: 150px;');
|
2010-09-29 12:28:10 +02:00
|
|
|
|
2010-10-07 10:13:36 +02:00
|
|
|
$table->data[2][0] = __('Interval');
|
2010-09-29 12:28:10 +02:00
|
|
|
|
|
|
|
$intervals = array ();
|
|
|
|
$intervals[30] = human_time_description_raw (30);
|
|
|
|
$intervals[60] = human_time_description_raw (60);
|
|
|
|
$intervals[300] = human_time_description_raw (300);
|
|
|
|
$intervals[600] = human_time_description_raw (600);
|
|
|
|
$intervals[1200] = human_time_description_raw (1200);
|
|
|
|
$intervals[1800] = human_time_description_raw (1800);
|
|
|
|
$intervals[3600] = human_time_description_raw (3600);
|
|
|
|
$intervals[7200] = human_time_description_raw (7200);
|
2010-10-07 10:13:36 +02:00
|
|
|
$table->data[2][1] = print_extended_select_for_time ($intervals, 'interval', $interval, '', '', '0', 10, true, 'width: 150px') . __(" seconds.");
|
2010-09-29 12:28:10 +02:00
|
|
|
|
2010-10-07 10:13:36 +02:00
|
|
|
$table->data[3][0] = __('OS');
|
|
|
|
$table->data[3][1] = print_select_from_sql ('SELECT id_os, name FROM tconfig_os',
|
2010-09-29 12:28:10 +02:00
|
|
|
'id_os', $id_os, '', __('No change'), -1, true, false, true, false, 'width: 105px;');
|
2010-10-07 10:13:36 +02:00
|
|
|
$table->data[3][1] .= ' <span id="os_preview">';
|
|
|
|
$table->data[3][1] .= print_os_icon ($id_os, false, true);
|
|
|
|
$table->data[3][1] .= '</span>';
|
2010-09-29 12:28:10 +02:00
|
|
|
|
|
|
|
// Network server
|
|
|
|
$none = '';
|
|
|
|
if ($server_name == '' && $id_agente)
|
|
|
|
$none = __('None');
|
2010-10-07 10:13:36 +02:00
|
|
|
$table->data[4][0] = __('Server');
|
|
|
|
$table->data[4][1] = print_select (get_server_names (),
|
2010-09-29 12:28:10 +02:00
|
|
|
'server_name', $server_name, '', __('No change'), -1, true, false, true, '', false, 'width: 150px;');
|
|
|
|
|
|
|
|
// Description
|
2010-10-07 10:13:36 +02:00
|
|
|
$table->data[5][0] = __('Description');
|
|
|
|
$table->data[5][1] = print_input_text ('description', $description, '', 45, 255, true);
|
2010-09-29 12:28:10 +02:00
|
|
|
|
|
|
|
print_table ($table);
|
|
|
|
unset($table);
|
|
|
|
|
|
|
|
$custom_id = '';
|
|
|
|
$mode = -1;
|
|
|
|
$disabled = -1;
|
|
|
|
$new_agent = true;
|
|
|
|
$icon_path = '';
|
|
|
|
$update_gis_data = -1;
|
|
|
|
$cascade_protection = -1;
|
|
|
|
|
|
|
|
$table->width = '95%';
|
|
|
|
$table->class = "databox_color";
|
|
|
|
|
|
|
|
$table->head = array ();
|
|
|
|
$table->style = array ();
|
|
|
|
$table->style[0] = 'font-weight: bold; width: 150px;';
|
|
|
|
$table->data = array ();
|
|
|
|
|
|
|
|
// Custom ID
|
|
|
|
$table->data[0][0] = __('Custom ID');
|
|
|
|
$table->data[0][1] = print_input_text ('custom_id', $custom_id, '', 16, 255, true);
|
|
|
|
|
|
|
|
// Learn mode / Normal mode
|
|
|
|
$table->data[1][0] = __('Module definition').print_help_icon("module_definition", true);
|
|
|
|
$table->data[1][1] = __('No change').' '.print_radio_button_extended ("mode", -1, '', $mode, false, '', 'style="margin-right: 40px;"', true);
|
|
|
|
$table->data[1][1] .= __('Learning mode').' '.print_radio_button_extended ("mode", 1, '', $mode, false, '', 'style="margin-right: 40px;"', true);
|
|
|
|
$table->data[1][1] .= __('Normal mode').' '.print_radio_button_extended ("mode", 0, '', $mode, false, '', 'style="margin-right: 40px;"', true);
|
|
|
|
|
|
|
|
// Status (Disabled / Enabled)
|
|
|
|
$table->data[2][0] = __('Status');
|
|
|
|
$table->data[2][1] = __('No change').' '.print_radio_button_extended ("disabled", -1, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
|
|
|
|
$table->data[2][1] .= __('Disabled').' '.print_radio_button_extended ("disabled", 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
|
|
|
|
$table->data[2][1] .= __('Active').' '.print_radio_button_extended ("disabled", 0, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
|
|
|
|
|
|
|
|
// Remote configuration
|
|
|
|
$table->data[3][0] = __('Remote configuration');
|
|
|
|
|
|
|
|
// Delete remote configuration
|
|
|
|
$table->data[3][1] = '<div id="delete_configurations" style="display: none">'. __('Delete available remote configurations').' (';
|
|
|
|
$table->data[3][1] .= '<span id="n_configurations"></span>';
|
|
|
|
$table->data[3][1] .= ') '.print_radio_button_extended ("delete_conf", 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true).'</div>';
|
|
|
|
|
|
|
|
$table->data[3][1] .= '<div id="not_available_configurations" style="display: none"><em>'.__('Not available').'</em></div>';
|
|
|
|
|
|
|
|
$listIcons = getArrayListIcons();
|
|
|
|
|
|
|
|
$arraySelectIcon = array();
|
|
|
|
foreach ($listIcons as $index => $value) $arraySelectIcon[$index] = $index;
|
|
|
|
|
|
|
|
$path = 'images/gis_map/icons/'; //TODO set better method the path
|
|
|
|
|
|
|
|
$table->data[4][0] = __('Agent icon');
|
|
|
|
$table->data[4][1] = print_select($arraySelectIcon, "icon_path", $icon_path, "changeIcons();", __('None'), '', true) .
|
2011-02-04 14:30:50 +01:00
|
|
|
' ' . __('Without status') . ': ' . print_image($path . $icon_path . 'default.png', true, array("id" => 'icon_without_status',"style" => 'display:none;')) .
|
|
|
|
' ' . __('Default') . ': ' . print_image($path . $icon_path . 'default.png', true, array("id" => 'icon_default',"style" => 'display:none;')) .
|
|
|
|
' ' . __('Ok') . ': ' . print_image($path . $icon_path . 'ok.png', true, array("id" => 'icon_ok',"style" => 'display:none;')) .
|
|
|
|
' ' . __('Bad') . ': ' . print_image($path . $icon_path . 'bad.png', true, array("id" => 'icon_bad',"style" => 'display:none;')) . ' ' . __('Warning') . ': ' . print_image($path . $icon_path . 'warning.png', true, array("id" => 'icon_warning',"style" => 'display:none;'));
|
2010-09-29 12:28:10 +02:00
|
|
|
|
|
|
|
if ($config['activate_gis']) {
|
|
|
|
$table->data[5][0] = __('Ignore new GIS data:');
|
|
|
|
$table->data[5][1] = __('No change').' '.print_radio_button_extended ("update_gis_data", -1, '', $update_gis_data, false, '', 'style="margin-right: 40px;"', true);
|
|
|
|
$table->data[5][1] .= __('Disabled').' '.print_radio_button_extended ("update_gis_data", 0, '', $update_gis_data, false, '', 'style="margin-right: 40px;"', true);
|
|
|
|
$table->data[5][1] .= __('Active').' '.print_radio_button_extended ("update_gis_data", 1, '', $update_gis_data, false, '', 'style="margin-right: 40px;"', true);
|
|
|
|
}
|
|
|
|
|
|
|
|
toggle(print_table ($table, true), __('Advanced options'));
|
|
|
|
unset($table);
|
|
|
|
|
|
|
|
$table->width = '95%';
|
|
|
|
$table->class = "databox_color";
|
|
|
|
|
|
|
|
$table->head = array ();
|
|
|
|
$table->style = array ();
|
|
|
|
$table->style[0] = 'font-weight: bold; width: 150px;';
|
|
|
|
$table->data = array ();
|
|
|
|
|
|
|
|
$fields = get_db_all_fields_in_table('tagent_custom_fields');
|
|
|
|
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if ($fields === false) $fields = array();
|
2010-09-29 12:28:10 +02:00
|
|
|
|
|
|
|
foreach ($fields as $field) {
|
|
|
|
|
|
|
|
$data[0] = '<b>'.$field['name'].'</b>';
|
|
|
|
|
|
|
|
$custom_value = get_db_value_filter('description', 'tagent_custom_data', array('id_field' => $field['id_field'], 'id_agent' => $id_agente));
|
|
|
|
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if ($custom_value === false) {
|
2010-09-29 12:28:10 +02:00
|
|
|
$custom_value = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
$data[1] = print_textarea ('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'style="min-height: 30px;"', true);
|
|
|
|
|
|
|
|
array_push ($table->data, $data);
|
|
|
|
}
|
|
|
|
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (!empty($fields)) {
|
2010-09-29 12:28:10 +02:00
|
|
|
toggle(print_table ($table, true), __('Custom fields'));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
echo '<h3 class="error invisible" id="message"> </h3>';
|
|
|
|
|
|
|
|
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
|
|
|
|
|
|
|
print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"');
|
|
|
|
print_input_hidden ('update_agents', 1);
|
|
|
|
print_input_hidden ('id_agente', $id_agente);
|
|
|
|
|
|
|
|
echo "</div>"; // Shown and hide div
|
|
|
|
|
|
|
|
echo '</div></form>';
|
|
|
|
|
|
|
|
require_jquery_file ('form');
|
|
|
|
require_jquery_file ('pandora.controls');
|
|
|
|
|
|
|
|
|
|
|
|
require_jquery_file ('pandora.controls');
|
|
|
|
require_jquery_file ('ajaxqueue');
|
|
|
|
require_jquery_file ('bgiframe');
|
|
|
|
require_jquery_file ('autocomplete');
|
|
|
|
?>
|
|
|
|
<script type="text/javascript">
|
|
|
|
/* <![CDATA[ */
|
|
|
|
|
|
|
|
//Use this function for change 3 icons when change the selectbox
|
|
|
|
$(document).ready (function () {
|
|
|
|
function changeIcons() {
|
|
|
|
icon = $("#icon_path :selected").val();
|
|
|
|
|
|
|
|
$("#icon_without_status").attr("src", "images/spinner.png");
|
|
|
|
$("#icon_default").attr("src", "images/spinner.png");
|
|
|
|
$("#icon_ok").attr("src", "images/spinner.png");
|
|
|
|
$("#icon_bad").attr("src", "images/spinner.png");
|
|
|
|
$("#icon_warning").attr("src", "images/spinner.png");
|
|
|
|
|
|
|
|
if (icon.length == 0) {
|
|
|
|
$("#icon_without_status").attr("style", "display:none;");
|
|
|
|
$("#icon_default").attr("style", "display:none;");
|
|
|
|
$("#icon_ok").attr("style", "display:none;");
|
|
|
|
$("#icon_bad").attr("style", "display:none;");
|
|
|
|
$("#icon_warning").attr("style", "display:none;");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#icon_without_status").attr("src", "<?php echo $path; ?>" + icon + ".default.png");
|
|
|
|
$("#icon_default").attr("src", "<?php echo $path; ?>" + icon + ".default.png");
|
|
|
|
$("#icon_ok").attr("src", "<?php echo $path; ?>" + icon + ".ok.png");
|
|
|
|
$("#icon_bad").attr("src", "<?php echo $path; ?>" + icon + ".bad.png");
|
|
|
|
$("#icon_warning").attr("src", "<?php echo $path; ?>" + icon + ".warning.png");
|
|
|
|
$("#icon_without_status").attr("style", "");
|
|
|
|
$("#icon_default").attr("style", "");
|
|
|
|
$("#icon_ok").attr("style", "");
|
|
|
|
$("#icon_bad").attr("style", "");
|
|
|
|
$("#icon_warning").attr("style", "");
|
|
|
|
}
|
|
|
|
|
|
|
|
//$("#icon_default").attr("src", "<?php echo $path; ?>" + icon +
|
|
|
|
}
|
|
|
|
|
|
|
|
function get_n_conf_files(idAgents) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$("#id_agents").change (function () {
|
|
|
|
var idAgents = Array();
|
|
|
|
jQuery.each ($("#id_agents option:selected"), function (i, val) {
|
|
|
|
idAgents.push($(val).val());
|
|
|
|
});
|
|
|
|
|
|
|
|
jQuery.post ("ajax.php",
|
|
|
|
{"page" : "godmode/massive/massive_edit_agents",
|
|
|
|
"get_n_conf_files" : 1,
|
|
|
|
"id_agents[]" : idAgents
|
|
|
|
},
|
|
|
|
function (data, status) {
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
if (data == 0) {
|
2010-09-29 12:28:10 +02:00
|
|
|
$("#delete_configurations").attr("style", "display: none");
|
|
|
|
$("#not_available_configurations").attr("style", "");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#n_configurations").text(data);
|
|
|
|
$("#not_available_configurations").attr("style", "display: none");
|
|
|
|
$("#delete_configurations").attr("style", "");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"json"
|
|
|
|
);
|
|
|
|
|
|
|
|
$("#form_agents").attr("style", "");
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#id_group").change (function () {
|
|
|
|
$("#form_agents").attr("style", "display: none");
|
|
|
|
});
|
|
|
|
|
|
|
|
$("select#id_os").pandoraSelectOS ();
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
|
2010-09-29 12:28:10 +02:00
|
|
|
$("#text-id_parent").autocomplete ("ajax.php",
|
|
|
|
{
|
|
|
|
scroll: true,
|
|
|
|
minChars: 2,
|
|
|
|
extraParams: {
|
|
|
|
page: "godmode/agentes/agent_manager",
|
|
|
|
search_parents: 1,
|
|
|
|
id_group: function() { return $("#group").val(); },
|
|
|
|
id_agent: <?php echo $id_agente ?>
|
|
|
|
},
|
|
|
|
formatItem: function (data, i, total) {
|
|
|
|
if (total == 0)
|
|
|
|
$("#text-id_parent").css ('background-color', '#cc0000');
|
|
|
|
else
|
|
|
|
$("#text-id_parent").css ('background-color', '');
|
|
|
|
if (data == "")
|
|
|
|
return false;
|
|
|
|
return data[0]+'<br><span class="ac_extra_field"><?php echo __("IP") ?>: '+data[1]+'</span>';
|
|
|
|
},
|
|
|
|
delay: 200
|
|
|
|
}
|
|
|
|
);
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
|
2010-09-29 12:28:10 +02:00
|
|
|
$("#id_group").pandoraSelectGroupAgent ({
|
|
|
|
agentSelect: "select#id_agents"
|
|
|
|
});
|
2010-10-29 Miguel de Dios <miguel.dedios@artica.es>
* extensions/dbmanager.php, godmode/agentes/module_manager_editor.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: now in the source code pick
more info in the audit for actions.
Pending tasks: #3089687
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3480 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-29 14:35:34 +02:00
|
|
|
|
2010-09-29 12:28:10 +02:00
|
|
|
$("#id_group").pandoraSelectGroupAgentDisabled ({
|
|
|
|
agentSelect: "select#id_agents"
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|