2009-03-17 16:15:55 +01:00
|
|
|
<?php
|
|
|
|
|
2009-06-08 20:21:21 +02:00
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
2010-07-23 12:04:12 +02:00
|
|
|
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
2009-06-08 20:21:21 +02:00
|
|
|
// Please see http://pandorafms.org for full contribution list
|
2009-03-17 16:15:55 +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,
|
|
|
|
// 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-03-09 13:34:09 +01:00
|
|
|
audit_db ($config['id_user'], $_SERVER['REMOTE_ADDR'], "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 operation section");
|
2009-03-17 16:15:55 +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');
|
|
|
|
|
2009-04-20 16:00:27 +02:00
|
|
|
$tab = (string) get_parameter ('tab', 'copy_modules');
|
2009-03-17 16:15:55 +01:00
|
|
|
|
2010-05-10 12:04:50 +02:00
|
|
|
/* Copy modules */
|
|
|
|
$copymoduletab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&tab=copy_modules">'
|
|
|
|
. print_image ("images/copy.png", true, array ("title" => __('Copy modules')))
|
|
|
|
. "</a>";
|
|
|
|
if($tab == 'copy_modules')
|
|
|
|
$copymoduletab['active'] = true;
|
|
|
|
else
|
|
|
|
$copymoduletab['active'] = false;
|
|
|
|
|
|
|
|
/* Edit Modules */
|
|
|
|
$editmoduletab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&tab=edit_modules">'
|
|
|
|
. print_image ("images/edit.png", true, array ("title" => __('Edit modules')))
|
|
|
|
. "</a>";
|
|
|
|
if($tab == 'edit_modules')
|
|
|
|
$editmoduletab['active'] = true;
|
|
|
|
else
|
|
|
|
$editmoduletab['active'] = false;
|
|
|
|
|
|
|
|
/* Delete Modules */
|
|
|
|
$deletemoduletab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&tab=delete_modules">'
|
|
|
|
. print_image ("images/delete_modules.png", true, array ("title" => __('Delete modules')))
|
|
|
|
. "</a>";
|
|
|
|
if($tab == 'delete_modules')
|
|
|
|
$deletemoduletab['active'] = true;
|
|
|
|
else
|
|
|
|
$deletemoduletab['active'] = false;
|
|
|
|
|
|
|
|
/* Delete Agents */
|
|
|
|
$deleteagenttab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&tab=delete_agents">'
|
|
|
|
. print_image ("images/delete_agents.png", true, array ("title" => __('Delete agents')))
|
|
|
|
. "</a>";
|
|
|
|
if($tab == 'delete_agents')
|
|
|
|
$deleteagenttab['active'] = true;
|
|
|
|
else
|
|
|
|
$deleteagenttab['active'] = false;
|
|
|
|
|
2010-05-31 11:22:15 +02:00
|
|
|
/* Add alerts actions */
|
|
|
|
$addactionalerttab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&tab=add_action_alerts">'
|
|
|
|
. print_image ("images/cog.png", true, array ("title" => __('Add Actions')))
|
|
|
|
. "</a>";
|
|
|
|
if($tab == 'add_action_alerts')
|
|
|
|
$addactionalerttab['active'] = true;
|
|
|
|
else
|
|
|
|
$addactionalerttab['active'] = false;
|
|
|
|
|
|
|
|
/* Delete alerts actions */
|
|
|
|
$deleteactionalerttab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&tab=delete_action_alerts">'
|
|
|
|
. print_image ("images/cog_del.png", true, array ("title" => __('Delete Actions')))
|
|
|
|
. "</a>";
|
|
|
|
if($tab == 'delete_action_alerts')
|
|
|
|
$deleteactionalerttab['active'] = true;
|
|
|
|
else
|
|
|
|
$deleteactionalerttab['active'] = false;
|
|
|
|
|
|
|
|
/* Add Alerts */
|
|
|
|
$addalerttab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&tab=add_alerts">'
|
|
|
|
. print_image ("images/god2.png", true, array ("title" => __('Add alerts')))
|
|
|
|
. "</a>";
|
|
|
|
if($tab == 'add_alerts')
|
|
|
|
$addalerttab['active'] = true;
|
|
|
|
else
|
|
|
|
$addalerttab['active'] = false;
|
|
|
|
|
2010-05-10 12:04:50 +02:00
|
|
|
/* Delete Alerts */
|
|
|
|
$deletealerttab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&tab=delete_alerts">'
|
|
|
|
. print_image ("images/delete_alerts.png", true, array ("title" => __('Delete alerts')))
|
|
|
|
. "</a>";
|
|
|
|
if($tab == 'delete_alerts')
|
|
|
|
$deletealerttab['active'] = true;
|
|
|
|
else
|
|
|
|
$deletealerttab['active'] = false;
|
|
|
|
|
|
|
|
|
2010-05-31 11:22:15 +02:00
|
|
|
$onheader = array('copy_modules' => $copymoduletab, 'edit_modules' => $editmoduletab, 'delete_modules' => $deletemoduletab, 'delete_agents' => $deleteagenttab, 'add_action_alerts' => $addactionalerttab, 'delete_action_alerts' => $deleteactionalerttab, 'add_alerts' => $addalerttab, 'delete_alerts' => $deletealerttab);
|
2010-05-10 12:04:50 +02:00
|
|
|
|
|
|
|
print_page_header (__('Agent configuration'). ' » '. __('Massive operations'), "images/god1.png", false, "", true, $onheader);
|
2009-03-17 16:15:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
switch ($tab) {
|
|
|
|
case 'delete_alerts':
|
|
|
|
require_once ('godmode/agentes/massive_delete_alerts.php');
|
|
|
|
break;
|
2010-05-31 11:22:15 +02:00
|
|
|
case 'add_alerts':
|
|
|
|
require_once ('godmode/agentes/massive_add_alerts.php');
|
|
|
|
break;
|
|
|
|
case 'delete_action_alerts':
|
|
|
|
require_once ('godmode/agentes/massive_delete_action_alerts.php');
|
|
|
|
break;
|
|
|
|
case 'add_action_alerts':
|
|
|
|
require_once ('godmode/agentes/massive_add_action_alerts.php');
|
|
|
|
break;
|
2009-03-17 16:15:55 +01:00
|
|
|
case 'delete_agents':
|
|
|
|
require_once ('godmode/agentes/massive_delete_agents.php');
|
|
|
|
break;
|
|
|
|
case 'delete_modules':
|
|
|
|
require_once ('godmode/agentes/massive_delete_modules.php');
|
|
|
|
break;
|
2009-03-18 16:42:15 +01:00
|
|
|
case 'edit_modules':
|
|
|
|
require_once ('godmode/agentes/massive_edit_modules.php');
|
|
|
|
break;
|
2009-03-17 16:15:55 +01:00
|
|
|
case 'copy_modules':
|
|
|
|
default:
|
|
|
|
require_once ('godmode/agentes/massive_config.php');
|
|
|
|
}
|
|
|
|
?>
|