2008-08-11 Esteban Sanchez <estebans@artica.es>

* include/functions_db.php: Added __ as an alias of lang_string().

	* include/functions_reporting_pdf.php,
	include/functions_reporting.php, include/functions.php,
	include/functions_visual_map.php, index.php,
	operation/incidents/incident.php,
	operation/incidents/incident_detail.php,
	operation/incidents/incident_note.php,
	operation/incidents/incident_search.php,
	operation/incidents/incident_statistics.php,
	operation/snmpconsole/snmp_alert.php,
	operation/snmpconsole/snmp_view.php, operation/users/user.php,
	operation/users/user_edit.php, operation/users/user_statistics.php,
	operation/events/event_statistics.php, operation/events/events.php,
	operation/visual_console/render_view.php,
	operation/visual_console/index.php, operation/extensions.php,
	operation/agentes/estado_alertas.php,
	operation/agentes/status_monitor.php,
	operation/agentes/estado_grupo.php, operation/agentes/export_csv.php,
	operation/agentes/datos_agente.php,
	operation/agentes/estado_ultimopaquete.php,
	operation/agentes/estado_generalagente.php,
	operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
	operation/agentes/status_events.php, operation/agentes/sla_view.php,
	operation/agentes/exportdata.php,
	operation/agentes/estado_monitores.php,
	operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
	operation/agentes/tactical.php, operation/agentes/networkmap.php,
	operation/messages/message.php,
	operation/reporting/reporting_viewer.php,
	operation/reporting/graph_viewer.php,
	operation/reporting/custom_reporting.php,
	operation/servers/view_server.php,
	operation/servers/view_server_detail.php, operation/menu.php,
	reporting/fgraph.php, reporting/stat_win.php, ajax.php,
	general/logoff.php, general/pandora_help.php, general/footer.php,
	general/noaccess.php, general/logon_failed.php,
	general/links_menu.php, general/login_page.php, general/logon_ok.php,
	general/header.php, general/main_menu.php,
	godmode/groups/configure_group.php, godmode/groups/group_list.php,
	godmode/setup/news.php, godmode/setup/links.php,
	godmode/setup/setup.php, godmode/users/user_list.php,
	godmode/users/configure_user.php, godmode/profiles/profile_list.php,
	godmode/admin_access_logs.php, godmode/db/db_info_data.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/extensions.php,
	godmode/agentes/agent_template.php,
	godmode/agentes/module_manager_editor_network.php,
	godmode/agentes/module_manager_editor_wmi.php,
	godmode/agentes/alert_manager.php,
	godmode/agentes/module_manager_editor_plugin.php,
	godmode/agentes/module_manager_editor_prediction.php,
	godmode/agentes/alert_manager_editor.php,
	godmode/agentes/manage_config.php,
	godmode/agentes/module_manager_editor_data.php,
	godmode/agentes/module_manager.php,
	godmode/agentes/modificar_agente.php,
	godmode/agentes/configurar_agente.php,
	godmode/agentes/agent_disk_conf_editor.php,
	godmode/agentes/planned_downtime.php,
	godmode/agentes/manage_config_remote.php,
	godmode/agentes/agent_manager.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_templates_form.php,
	godmode/modules/manage_network_components_form_network.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.php,
	godmode/reporting/map_builder.php,
	godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
	godmode/servers/manage_recontask.php,
	godmode/servers/modificar_server.php,
	godmode/servers/manage_recontask_form.php,
	godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
	godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a
	instead of $lang_label to future use of gettext. Style
	corrections.

	* godmode/agentes/planned_downtime.php: Rewritten to use Pandora
	functions and adopt the UI style. Replaced lang_string with __().

	* pandoradb.sql: Fields in tplanned_downtime renamed to fit
	guidelines.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
esanchezm 2008-08-11 10:59:07 +00:00
parent 04bbcc1d40
commit ae9c96c004
113 changed files with 5042 additions and 5071 deletions

View File

@ -1,3 +1,95 @@
2008-08-11 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Added __ as an alias of lang_string().
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/functions.php,
include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php, operation/extensions.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/status_events.php, operation/agentes/sla_view.php,
operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, ajax.php,
general/logoff.php, general/pandora_help.php, general/footer.php,
general/noaccess.php, general/logon_failed.php,
general/links_menu.php, general/login_page.php, general/logon_ok.php,
general/header.php, general/main_menu.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/setup/news.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/profiles/profile_list.php,
godmode/admin_access_logs.php, godmode/db/db_info_data.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/extensions.php,
godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.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_templates_form.php,
godmode/modules/manage_network_components_form_network.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.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a
instead of $lang_label to future use of gettext. Style
corrections.
* godmode/agentes/planned_downtime.php: Rewritten to use Pandora
functions and adopt the UI style. Replaced lang_string with __().
* pandoradb.sql: Fields in tplanned_downtime renamed to fit
guidelines.
2008-08-05 Sancho Lerena <slerena@gmail.com>
* AUTHORS: Added Evi to AUTHORS file.

View File

@ -50,7 +50,6 @@ $page .= '.php';
$config["id_user"] = $_SESSION["id_usuario"];
session_write_close ();
if (file_exists ($page)) {
$id_user = $_SESSION["id_usuario"];
require_once ($page);
} else {
echo "<br><b class='error'>Sorry! I can't find the page $page!</b>";

View File

@ -20,12 +20,12 @@ global $config;
echo "<center>";
echo '<a class="white_bold" target="_new" href="general/license/pandora_info_'.$config["language"].'.html">
Pandora FMS '.$pandora_version.' - Build '.$build_version.'<br>'.
lang_string ("gpl_notice").'</a><br>';
__('gpl_notice').'</a><br>';
if (isset($_SERVER['REQUEST_TIME'])) {
$time = $_SERVER['REQUEST_TIME'];
} else {
$time = time();
}
echo "<a class='white'>".$lang_label["gen_date"]." ".date("D F d, Y H:i:s", $time)." - Saved ".$sql_cache["saved"]." Queries</a><br>";
echo "<a class='white'>".__('gen_date')." ".date("D F d, Y H:i:s", $time)." - Saved ".$sql_cache["saved"]." Queries</a><br>";
echo "</center>";
?>

View File

@ -35,36 +35,36 @@ if (isset ($_SESSION["id_usuario"])){
echo "<img src='images/user_suit.png' class='bot'> ";
else
echo "<img src='images/user_green.png' class='bot'> ";
echo "<a class='white'>".lang_string ("has_connected"). '
echo "<a class='white'>".__('has_connected'). '
[<b>'. $_SESSION["id_usuario"]. '</b>]</a>';
// Second column
echo "<td>";
echo "<a class='white_bold' href='index.php?sec=main'><img src='images/information.png' class='bot'> ". lang_string ("information")."</a>";
echo "<a class='white_bold' href='index.php?sec=main'><img src='images/information.png' class='bot'> ". __('information')."</a>";
// Third column
echo "<td>";
// Autorefresh
if ((isset($_GET["refr"]) AND $_GET["refr"] != 0) OR (isset($_POST["refr"]) AND $_POST["refr"] != 0)) {
echo "<a class='white_grey_bold' href='".((substr($_SERVER['REQUEST_URI'],-1) != "/") ? $_SERVER['REQUEST_URI'] : "index.php?" )."&refr=0'><img src='images/page_lightning.png' class='bot'> ". lang_string("Autorefresh")."</a>";
echo "<a class='white_grey_bold' href='".((substr($_SERVER['REQUEST_URI'],-1) != "/") ? $_SERVER['REQUEST_URI'] : "index.php?" )."&refr=0'><img src='images/page_lightning.png' class='bot'> ". __('Autorefresh')."</a>";
} else {
echo "<a class='white_bold' href='".((substr($_SERVER['REQUEST_URI'],-1) != "/") ? $_SERVER['REQUEST_URI'] : "index.php?" )."&refr=5'><img src='images/page_lightning.png' class='bot'> ". lang_string("Autorefresh")."</a>";
echo "<a class='white_bold' href='".((substr($_SERVER['REQUEST_URI'],-1) != "/") ? $_SERVER['REQUEST_URI'] : "index.php?" )."&refr=5'><img src='images/page_lightning.png' class='bot'> ". __('Autorefresh')."</a>";
}
echo "<tr><td>";
echo "<a class='white_bold' href='index.php?bye=bye'><img src='images/lock.png' class='bot'> ". lang_string ("logout")."</a>";
echo "<a class='white_bold' href='index.php?bye=bye'><img src='images/lock.png' class='bot'> ". __('logout')."</a>";
echo "<td>";
$server_status = check_server_status ();
if ($server_status == 0)
echo "<a class='white_bold' href='index.php?sec=estado_server&sec2=operation/servers/view_server&refr=60'><img src='images/error.png' class='bot'> ". lang_string("Server status: DOWN")."</a>";
echo "<a class='white_bold' href='index.php?sec=estado_server&sec2=operation/servers/view_server&refr=60'><img src='images/error.png' class='bot'> ". __('Server status: DOWN')."</a>";
else
echo "<a class='white_bold' href='index.php?sec=estado_server&sec2=operation/servers/view_server&refr=60'><img src='images/ok.png' class='bot'> ". lang_string("System ready")."</a>";
echo "<a class='white_bold' href='index.php?sec=estado_server&sec2=operation/servers/view_server&refr=60'><img src='images/ok.png' class='bot'> ". __('System ready')."</a>";
echo "<td>";
// Event - refresh
echo "<a class='white_bold' href='index.php?sec=eventos&sec2=operation/events/events&refr=5'><img src='images/lightning_go.png' class='bot'> ". lang_string("events")."</a>";
echo "<a class='white_bold' href='index.php?sec=eventos&sec2=operation/events/events&refr=5'><img src='images/lightning_go.png' class='bot'> ". __('events')."</a>";
}

View File

@ -19,7 +19,7 @@ $sql='SELECT link,name FROM tlink ORDER BY name';
$result = get_db_all_rows_sql ($sql);
if ($result !== false){
?>
<div class="tit bg4">:: <?php echo $lang_label["links_header"] ?> ::</div>
<div class="tit bg4">:: <?php echo __('links_header') ?> ::</div>
<div class="menul" id="link">
<?php
foreach ($result as $row){

View File

@ -31,7 +31,7 @@ if (isset($_GET['sec'])){
?>
<div class='databox' id='login'>
<h1 id='log'><?php echo $lang_label['welcome_title']; ?></h1>
<h1 id='log'><?php echo __('welcome_title'); ?></h1>
<div class='databox' id='login_in'>
<form method="post" action="index.php?login=1">
<table cellpadding='4' cellspacing='1' width='400'>

View File

@ -20,7 +20,7 @@
<center>
<div class='databox' id='login'>
<h1 id='log'><?php echo $lang_label["logged_out"]; ?></h1>
<h1 id='log'><?php echo __('logged_out'); ?></h1>
<div class='databox' style='width: 400px;'>
<form method="post" action="index.php?login=1">
<table cellpadding='4' cellspacing='1' width='400'>
@ -29,7 +29,7 @@
<img src="images/pandora_logo.png" border="0" alt="logo"></a><br>
<?php echo $pandora_version; ?>
</td><td valign='bottom'>
<?php echo $lang_label["logout_msg"]; ?>
<?php echo __('logout_msg'); ?>
</td></tr>
</table>
</form>

View File

@ -20,7 +20,7 @@
<div class='databox' id='login'>
<div id='login_f' class='databox'>
<h1 id="log_f" style='margin-top: 0px;' class="error"><?php echo $lang_label['err_auth']; ?></h1>
<h1 id="log_f" style='margin-top: 0px;' class="error"><?php echo __('err_auth'); ?></h1>
<div id='noa' style='width:50px' >
<img src='images/noaccess.png' alt='No access'>
</div>
@ -30,6 +30,6 @@
<?php echo $pandora_version; ?>
</div>
<div class="msg"><?php echo $lang_label["err_auth_msg"]; ?></div>
<div class="msg"><?php echo __('err_auth_msg'); ?></div>
</div>
</div>

View File

@ -24,9 +24,9 @@ extensions_call_login_function ();
echo "<div class='jus'>";
$nick = $_SESSION['id_usuario'];
echo "<h1>" . lang_string ("welcome_title") . "</h1>";
echo "<h1>" . __('welcome_title') . "</h1>";
echo "<p>";
echo lang_string ("main_text");
echo __('main_text');
echo "</p>";
// Private messages pending to read !
@ -34,10 +34,10 @@ echo "</p>";
$sql = sprintf ("SELECT COUNT(id_mensaje) AS count FROM tmensajes WHERE id_usuario_destino='%s' AND estado='FALSE';",$nick);
$resultado = get_db_sql ($sql);
if ($resultado != 0) {
echo "<h2>". lang_string ("new_message_bra") . '
echo "<h2>". __('new_message_bra') . '
<a href="index.php?sec=messages&sec2=operation/messages/message">'
.$row["count"] . ' <img src="images/email.png" border="0">'
.lang_string ("new_message_ket") . '</a></h2>';
.__('new_message_ket') . '</a></h2>';
}
echo "<table width=95%>";
@ -45,14 +45,14 @@ echo "<tr><td valign='top'>";
// Site news !
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo '<h2>' . lang_string ("site_news") . '</h2>';
echo '<h2>' . __('site_news') . '</h2>';
$sql_news = "SELECT subject,timestamp,text,author FROM tnews ORDER by timestamp DESC LIMIT 3";
if ($result_news = mysql_query ($sql_news)){
echo '<table cellpadding="4" cellspacing="4" width="270" class="databox">';
while ($row = mysql_fetch_array ($result_news)) {
echo '<tr>';
echo "<th><b>".$row["subject"]."</b>";
echo "<tr><td>".lang_string ("by")." <b>".$row["author"]. "</b> ".lang_string ("at")." <i>".$row["timestamp"]."</i>";
echo "<tr><td>".__('by')." <b>".$row["author"]. "</b> ".__('at')." <i>".$row["timestamp"]."</i>";
echo '<tr><td class=datos>';
echo clean_output_breaks($row["text"]);
}
@ -112,28 +112,28 @@ if ($global_health < 0)
echo "<table class='databox' celldpadding=4 cellspacing=4 width=250>";
echo "<tr><td colspan='2'>".lang_string ("Monitor health")."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$monitor_health' title='$monitor_health % ".lang_string ("of monitors UP")."'>";
echo "<tr><td colspan='2'>".__('Monitor health')."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$monitor_health' title='$monitor_health % ".__('of monitors UP')."'>";
echo "<tr><td colspan='2'>".lang_string ("Data health")."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$data_health' title='$data_health % ".lang_string ("of modules with updated data")."'>";
echo "<tr><td colspan='2'>".__('Data health')."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$data_health' title='$data_health % ".__('of modules with updated data')."'>";
echo "<tr><td colspan='2'>".lang_string ("Global health")."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$global_health' title='$global_health % ".lang_string ("of modules with good data")."'>";
echo "<tr><td colspan='2'>".__('Global health')."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$global_health' title='$global_health % ".__('of modules with good data')."'>";
echo "<tr><td colspan='2'>".lang_string ("Module sanity")."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$module_sanity ' title='$module_sanity % ".lang_string ("of well initialized modules")."'>";
echo "<tr><td colspan='2'>".__('Module sanity')."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$module_sanity ' title='$module_sanity % ".__('of well initialized modules')."'>";
echo "<tr><td colspan='2'>".lang_string ("Alert level")."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$alert_level' title='$alert_level % ".lang_string("of non-fired alerts")."'>";
echo "<tr><td colspan='2'>".__('Alert level')."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$alert_level' title='$alert_level % ".__('of non-fired alerts')."'>";
echo "</table>";
$query1 = "SELECT COUNT(id_usuario) FROM tusuario";
$users_defined = get_db_sql ($query1);
echo "<table class='databox' celldpadding=4 cellspacing=4 width=250>";
echo "<th colspan=2>".lang_string ("Pandora_FMS_summary")."</th>";
echo "<th colspan=2>".__('Pandora_FMS_summary')."</th>";
echo "<tr><td class='datos2'><b>"."Total agents"."</b></td>";
echo "<td class='datos2' style='font: bold 2em Arial, Sans-serif; color: #000;'>".$total_agents."</td>";
echo "</tr><tr><td class='datos'><b>"."Total checks"."</b></td>";
@ -154,7 +154,7 @@ echo "</table>";
echo "<div id='activity'>";
// Show last activity from this user
echo "<h2>" . lang_string ("user_last_activity") . "</h2>";
echo "<h2>" . __('user_last_activity') . "</h2>";
$color = 1;
@ -164,11 +164,11 @@ $table->size = array ();
$table->size[2] = '130px';
$table->size[4] = '200px';
$table->head = array ();
$table->head[0] = lang_string ('user');
$table->head[1] = lang_string ('action');
$table->head[2] = lang_string ('date');
$table->head[3] = lang_string ('src_address');
$table->head[4] = lang_string ('comments');
$table->head[0] = __('user');
$table->head[1] = __('action');
$table->head[2] = __('date');
$table->head[3] = __('src_address');
$table->head[4] = __('comments');
$sql = sprintf ("SELECT ID_usuario,accion,fecha,IP_origen,descripcion
FROM `tsesion`

View File

@ -17,22 +17,18 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
?>
<?php
require ("operation/menu.php");
if (! isset ($_SESSION["id_usuario"])) {
echo '<div class="f10">' . $lang_label["not_connected"];
echo '<div class="f10">' . __('not_connected');
echo '<br /><br />';
echo '<form method="post" action="index.php?login=1">';
echo '<div class="f9b">Login</div><input class="login" type="text" name="nick">';
echo '<div class="f9b">Password</div><input class="login" type="password" name="pass">';
echo '<div><input name="login" type="submit" class="sub" value="' . $lang_label["login"] .'"></div>';
echo '<div><input name="login" type="submit" class="sub" value="' . __('login') .'"></div>';
echo '<br />IP: <b class="f10">' . $REMOTE_ADDR . '</b><br /></div>';
} else {
$iduser = $_SESSION['id_usuario'];
require ("godmode/menu.php");
require ("links_menu.php");
}

View File

@ -10,10 +10,10 @@
<div id="noaccess">
<div align='center'>
<h2><?php echo lang_string ("no_access_title") ?></h2>
<h2><?php echo __('no_access_title') ?></h2>
<div>&nbsp;</div>
<img src='images/noaccess.png' alt='No access'>
<div>&nbsp;</div>
<div class="msg"><?php echo lang_string ("no_access_text");?></div>
<div class="msg"><?php echo __('no_access_text');?></div>
</div>
</div>

View File

@ -2,50 +2,41 @@
// Pandora FMS - the Free Monitoring System
// ========================================
// Copyright (c) 2004-2008 Sancho Lerena, slerena@gmail.com
// Copyright (c) 2008 Esteban Sanchez, estebans@artica.es
// Main PHP/SQL code development, project architecture and management.
// 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.
include "../include/config.php";
include "../include/languages/language_".$config["language"].".php";
require_once ("../include/config.php");
echo '<link rel="stylesheet" href="../include/styles/'.$config['style'].'.css" type="text/css">';
if (isset($_GET["id"])) {
$id = $_GET["id"];
$protofile = $config["homedir"]."/include/help/".$config["language"]."/help_".$id.".php";
if (file_exists ($protofile)){
echo "<div>";
echo "<p align=right>";
echo "<b>Pandora FMS Help System</b></p>";
echo "</div>";
$id = get_parameter ('id');
$help_file = $config["homedir"]."/include/help/".$config["language"]."/help_".$id.".php";
echo "<hr width=100% size=1><div style='font-family: verdana, arial; font-size: 11px; text-align:left'>";
echo "<div style='font-size: 12px; margin-left: 30px; margin-right:25px;'>";
include $protofile;
echo "</div>";
echo "<br><br><hr width=100% size=1><div style='font-family: verdana, arial; font-size: 11px;'>";
include "footer.php";
}
else
show_help_error();
} else {
show_help_error();
if (! $id || ! file_exists ($help_file)) {
echo "<div class='databox' id='login'><div id='login_f' class='databox'>";
echo '<h1 id="log_f" style="margin-top: 0px;" class="error">';
echo __('help_error');
echo "</h1><div id='noa' style='width:120px' >";
echo "<img src='../images/help.jpg' alt='No help section'></div>";
echo "<div style='width: 350px'>";
echo '<a href="index.php"><img src="../images/pandora_logo.png" border="0"></a><br>';
echo "</div>";
echo '<div class="msg">'.__('help_error_msg').'</div></div></div>';
return;
}
function show_help_error(){
global $config;
global $lang_label;
echo "<div class='databox' id='login'><div id='login_f' class='databox'>";
echo '<h1 id="log_f" style="margin-top: 0px;" class="error">';
echo $lang_label['help_error'];
echo "</h1><div id='noa' style='width:120px' >";
echo "<img src='../images/help.jpg' alt='No help section'></div>";
echo "<div style='width: 350px'>";
echo '<a href="index.php"><img src="../images/pandora_logo.png" border="0"></a><br>';
echo "</div>";
echo '<div class="msg">'.$lang_label["help_error_msg"].'</div></div></div>';
}
?>
/* Show help */
echo '<div>';
echo '<p style="text-align: right"><strong>Pandora FMS Help System</strong></p>';
echo '</div>';
echo '<hr width="100%" size="1" />';
echo '<div style="font-family: verdana, arial; font-size: 11px; text-align:left">';
echo '<div style="font-size: 12px; margin-left: 30px; margin-right:25px;">';
require_once ($help_file);
echo '</div>';
echo '<br /><br /><hr width="100%" size="1" />';
echo '<div style="font-family: verdana, arial; font-size: 11px;">';
include ('footer.php');
?>

View File

@ -17,123 +17,119 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global vars
require("include/config.php");
// Load global vars
require("include/config.php");
if (comprueba_login() != 0) {
audit_db("Noauth",$REMOTE_ADDR, "No authenticated acces","Trying to access event viewer");
require ("general/noaccess.php");
exit;
}
check_login ();
$id_usuario =$_SESSION["id_usuario"];
if (give_acl($id_usuario, 0, "PM")!=1) {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access event viewer");
require ("general/noaccess.php");
exit;
}
if (! give_acl ($config['id_user'], 0, "PM")) {
audit_db($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access event viewer");
require ("general/noaccess.php");
exit;
}
echo "<h2>".$lang_label["audit_title"]." &gt ".$lang_label["logs"]."</h2>";
if (isset($_GET["offset"]))
$offset=$_GET["offset"];
else
$offset=0;
echo "<h2>".__('audit_title')." &gt ".__('logs')."</h2>";
if (isset ($_GET["offset"]))
$offset=$_GET["offset"];
else
$offset=0;
echo "<table width=100%>";
echo "<tr><td>";
echo "<table cellpadding='4' cellspacing='4' class='databox'>";
echo "<tr><td colspan='2' valign='top'>";
echo "<h3>".$lang_label["filter"]."</h3></td></tr>";
// Manage GET/POST parameter for subselect on action type. POST parameter are proccessed before GET parameter (if passed)
if (isset($_GET["tipo_log"])){
$tipo_log = $_GET["tipo_log"];
echo "<table width=100%>";
echo "<tr><td>";
echo "<table cellpadding='4' cellspacing='4' class='databox'>";
echo "<tr><td colspan='2' valign='top'>";
echo "<h3>".__('filter')."</h3></td></tr>";
// Manage GET/POST parameter for subselect on action type. POST parameter are proccessed before GET parameter (if passed)
if (isset ($_GET["tipo_log"])) {
$tipo_log = $_GET["tipo_log"];
$tipo_log_select = " WHERE accion='".$tipo_log."' ";
} elseif (isset ($_POST["tipo_log"])) {
$tipo_log = $_POST["tipo_log"];
if ($tipo_log == "-1"){
$tipo_log_select = "";
unset($tipo_log);
} else {
$tipo_log_select = " WHERE accion='".$tipo_log."' ";
} elseif (isset($_POST["tipo_log"])) {
$tipo_log = $_POST["tipo_log"];
if ($tipo_log == "-1"){
$tipo_log_select = "";
unset($tipo_log);
} else
$tipo_log_select = " WHERE accion='".$tipo_log."' ";
}
else
$tipo_log_select= "";
} else {
$tipo_log_select= "";
}
// generate select
// generate select
echo "<form name='query_sel' method='post' action='index.php?sec=godmode&sec2=godmode/admin_access_logs'>";
echo "<tr><td>".$lang_label["action"]."</td><td valign='middle'>";
echo "<select name='tipo_log' onChange='javascript:this.form.submit();'>";
echo "<form name='query_sel' method='post' action='index.php?sec=godmode&sec2=godmode/admin_access_logs'>";
echo "<tr><td>".__('action')."</td><td valign='middle'>";
echo "<select name='tipo_log' onChange='javascript:this.form.submit();'>";
if (isset($tipo_log)) {
echo "<option>".$tipo_log."</option>";
}
echo "<option value='-1'>".__('all')."</option>";
$sql3="SELECT DISTINCT (accion) FROM `tsesion`";
// Prepare index for pagination
$result3=mysql_query($sql3);
while ($row3=mysql_fetch_array($result3)){
if (isset($tipo_log)) {
echo "<option>".$tipo_log."</option>";
}
echo "<option value='-1'>".$lang_label["all"]."</option>";
$sql3="SELECT DISTINCT (accion) FROM `tsesion`";
// Prepare index for pagination
$result3=mysql_query($sql3);
while ($row3=mysql_fetch_array($result3)){
if (isset($tipo_log)) {
if ($tipo_log != $row3[0]) {
echo "<option value='".$row3[0]."'>".$row3[0]."</option>";
}
} else {
if ($tipo_log != $row3[0]) {
echo "<option value='".$row3[0]."'>".$row3[0]."</option>";
}
} else {
echo "<option value='".$row3[0]."'>".$row3[0]."</option>";
}
echo "</select>";
echo "<td valign='middle'><noscript><input name='uptbutton' type='submit' class='sub' value='".$lang_label["show"]."'></noscript>";
echo "</table></form>";
}
echo "</select>";
echo "<td valign='middle'><noscript><input name='uptbutton' type='submit' class='sub' value='".__('show')."'></noscript>";
echo "</table></form>";
echo "</td><td align='right'>";
echo "<img src='reporting/fgraph.php?tipo=user_activity&width=300&height=140'>";
echo "</table>";
echo "</td><td align='right'>";
echo "<img src='reporting/fgraph.php?tipo=user_activity&width=300&height=140'>";
echo "</table>";
$sql2="SELECT COUNT(*) FROM tsesion ".$tipo_log_select." ORDER BY fecha DESC";
$result2=mysql_query($sql2);
$row2=mysql_fetch_array($result2);
$counter = $row2[0];
if (isset ($tipo_log))
$url = "index.php?sec=godmode&sec2=godmode/admin_access_logs&tipo_log=".$tipo_log;
else
$url = "index.php?sec=godmode&sec2=godmode/admin_access_logs";
$sql2="SELECT COUNT(*) FROM tsesion ".$tipo_log_select." ORDER BY fecha DESC";
$result2=mysql_query($sql2);
$row2=mysql_fetch_array($result2);
$counter = $row2[0];
if (isset ($tipo_log))
$url = "index.php?sec=godmode&sec2=godmode/admin_access_logs&tipo_log=".$tipo_log;
else
$url = "index.php?sec=godmode&sec2=godmode/admin_access_logs";
// Prepare query and pagination
$query1 = "SELECT * FROM tsesion " . $tipo_log_select." ORDER BY fecha DESC";
if ( $counter > $config["block_size"]) {
pagination ($counter, $url, $offset);
$query1 .= " LIMIT $offset , ".$config["block_size"];
}
$result=mysql_query($query1);
// Prepare query and pagination
$query1 = "SELECT * FROM tsesion " . $tipo_log_select." ORDER BY fecha DESC";
if ( $counter > $config["block_size"]) {
pagination ($counter, $url, $offset);
$query1 .= " LIMIT $offset , ".$config["block_size"];
}
$result=mysql_query($query1);
// table header
echo '<table cellpadding="4" cellspacing="4" width="700" class="databox">';
echo '<tr>';
echo '<th width="80px">'.$lang_label["user"].'</th>';
echo '<th>'.$lang_label["action"].'</th>';
echo '<th width="130px">'.$lang_label["date"].'</th>';
echo '<th width="100px">'.$lang_label["src_address"].'</th>';
echo '<th width="200px">'.$lang_label["comments"].'</th>';
// table header
echo '<table cellpadding="4" cellspacing="4" width="700" class="databox">';
echo '<tr>';
echo '<th width="80px">'.__('user').'</th>';
echo '<th>'.__('action').'</th>';
echo '<th width="130px">'.__('date').'</th>';
echo '<th width="100px">'.__('src_address').'</th>';
echo '<th width="200px">'.__('comments').'</th>';
$color=1;
// Get data
while ($row=mysql_fetch_array($result)) {
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo '<tr><td class="'.$tdcolor.'_id">'.$row["ID_usuario"];
echo '<td class="'.$tdcolor.'">'.$row["accion"];
echo '<td class="'.$tdcolor.'f9">'.$row["fecha"];
echo '<td class="'.$tdcolor.'f9">'.$row["IP_origen"];
echo '<td class="'.$tdcolor.'">'.$row["descripcion"];
echo '</tr>';
$color=1;
// Get data
while ($row=mysql_fetch_array($result)) {
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo '<tr><td class="'.$tdcolor.'_id">'.$row["ID_usuario"];
echo '<td class="'.$tdcolor.'">'.$row["accion"];
echo '<td class="'.$tdcolor.'f9">'.$row["fecha"];
echo '<td class="'.$tdcolor.'f9">'.$row["IP_origen"];
echo '<td class="'.$tdcolor.'">'.$row["descripcion"];
echo '</tr>';
}
// end table
echo "</table>";
// end table
echo "</table>";
?>
?>

View File

@ -16,51 +16,13 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
///////////////////////////////////////////////////////////////////////////////
// General purpose functions
///////////////////////////////////////////////////////////////////////////////
// Displays the configuration in a textarea
function display_config () {
global $agent_md5, $config, $id_agente, $lang_label, $nombre_agente;
// Read configuration file
$file_name = $config["remote_config"] . "/" . $agent_md5 . ".conf";
$file = fopen($file_name, "rb");
$agent_config = fread($file, filesize($file_name));
fclose($file);
// Display it
echo '<form name="update" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente='.$id_agente.'&disk_conf='.$agent_md5.'">';
echo '<table width="650" cellpadding="4" cellspacing="4" class="databox_color">';
echo '<tr>';
echo '<td class="datos"><b>' . $lang_label["agent_name"] . '</b></td>';
echo '<td class="datos">';
echo '<input disabled type="text" name="agente" size=30 value="' . $nombre_agente . '">';
echo '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $id_agente . '">';
echo '<img src="images/lupa.png" border="0" align="middle" alt="">';
echo '</a>';
echo '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente=' . $id_agente . '">';
echo '<img src="images/cog.png" border="0" align="middle" alt="">';
echo '</a>';
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="datos2" colspan="2">';
echo '<textarea class="conf_editor" name="disk_conf">';
echo $agent_config;
echo '</textarea>';
echo '</td>';
echo '</tr>';
echo '</table>';
echo '<table width="650"><tr><td align="right">';
echo '<tr>';
echo '<td align="right">';
echo '<input name="updbutton" type="submit" class="sub upd" value="'.$lang_label["update"].'">';
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</form>';
// Load global vars
require("include/config.php");
if (! give_acl ($config['id_user'], 0, "AW")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access agent manager");
require ("general/noaccess.php");
return;
}
// Saves the configuration and the md5 hash
@ -69,36 +31,60 @@ function save_config ($agent_config) {
$agent_config = unsafe_string ($agent_config);
// Save configuration
$file = fopen($config["remote_config"] . "/" . $agent_md5 . ".conf", "wb");
fwrite($file, $agent_config);
fclose($file);
$file = fopen ($config["remote_config"]."/".$agent_md5.".conf", "wb");
fwrite ($file, $agent_config);
fclose ($file);
// Save configuration md5
$config_md5 = md5($agent_config);
$file = fopen($config["remote_config"] . "/" . $agent_md5 . ".md5", "wb");
fwrite($file, $config_md5);
fclose($file);
$config_md5 = md5 ($agent_config);
$file = fopen ($config["remote_config"]."/".$agent_md5.".md5", "wb");
fwrite ($file, $config_md5);
fclose ($file);
}
///////////////////////////////////////////////////////////////////////////////
// Main code
///////////////////////////////////////////////////////////////////////////////
// Load global vars
require("include/config.php");
if (give_acl($id_user, 0, "AW")!=1) {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access agent manager");
require ("general/noaccess.php");
exit;
};
// Update configuration
if (isset($_POST["disk_conf"])) {
save_config(str_replace("\r\n", "\n", $_POST["disk_conf"]));
echo "<h3 class='suc'>" . $lang_label["update_agent_ok"] . "</h3>";
if (isset ($_POST["disk_conf"])) {
save_config (str_replace ("\r\n", "\n", $_POST["disk_conf"]));
echo "<h3 class='suc'>".__('update_agent_ok')."</h3>";
}
display_config ();
// Read configuration file
$file_name = $config["remote_config"] . "/" . $agent_md5 . ".conf";
$file = fopen ($file_name, "rb");
$agent_config = fread ($file, filesize($file_name));
fclose ($file);
// Display it
echo '<form name="update" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente='.$id_agente.'&disk_conf='.$agent_md5.'">';
echo '<table width="650" cellpadding="4" cellspacing="4" class="databox_color">';
echo '<tr>';
echo '<td class="datos"><b>'.__('agent_name').'</b></td>';
echo '<td class="datos">';
echo '<input disabled type="text" name="agente" size=30 value="'.$nombre_agente.'">';
echo '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
echo '<img src="images/lupa.png" border="0" align="middle" alt="">';
echo '</a>';
echo '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente='.$id_agente.'">';
echo '<img src="images/cog.png" border="0" align="middle" alt="">';
echo '</a>';
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="datos2" colspan="2">';
echo '<textarea class="conf_editor" name="disk_conf">';
echo $agent_config;
echo '</textarea>';
echo '</td>';
echo '</tr>';
echo '</table>';
echo '<table width="650"><tr><td align="right">';
echo '<tr>';
echo '<td align="right">';
echo '<input name="updbutton" type="submit" class="sub upd" value="'.__('update').'">';
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</form>';
// Footer
echo "</div><div id='foot'>";

View File

@ -23,18 +23,21 @@
// Load global vars
require("include/config.php");
if (give_acl($id_user, 0, "AW")!=1) {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access agent manager");
check_login ();
if (! give_acl ($config['id_user'], 0, "AW")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access agent manager");
require ("general/noaccess.php");
exit;
return;
}
echo "<h2>".lang_string ("agent_conf");
echo "<h2>".__('agent_conf');
if (isset($_GET["create_agent"])){
$create_agent = 1;
echo " &gt; ".lang_string ("create_agent");
echo " &gt; ".__('create_agent');
} else {
echo " &gt; ".lang_string ("update_agent");
echo " &gt; ".__('update_agent');
}
echo "</h2>";
echo "<div style='height: 5px'> </div>";
@ -59,25 +62,25 @@ echo '<form name="conf_agent" method="post" action="index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente">';
echo '<table width="650" id="table-agent-configuration" cellpadding="4" cellspacing="4" class="databox_color">';
echo "<tr>";
echo '<td class="datos"><b>'.lang_string ("agent_name").'</b><a href="#" class="tip">&nbsp;<span>'.lang_string ("agent_name_help").'</span></a></td><td class="datos">';
echo '<td class="datos"><b>'.__('agent_name').'</b><a href="#" class="tip">&nbsp;<span>'.__('agent_name_help').'</span></a></td><td class="datos">';
print_input_text ('agente', $nombre_agente, '', 30, 100);
if (isset ($id_agente) && $id_agente != "") {
echo "
<a href='index.php?sec=estado&
sec2=operation/agentes/ver_agente&id_agente=".$id_agente."'>
<img src='images/lupa.png' border='0' align='middle' title='".lang_string ("agent_detail")."'></a>";
<img src='images/lupa.png' border='0' align='middle' title='".__('agent_detail')."'></a>";
}
// Remote configuration available
if (file_exists ($config["remote_config"] . "/" . $agent_md5 . ".md5")) {
echo "
<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente=".$id_agente."&disk_conf=" . $agent_md5 . "'>
<img src='images/application_edit.png' border='0' align='middle' title='".lang_string ("This agent can be remotely configured")."'></a>";
echo '<a href="#" class="tip">&nbsp;<span>'.lang_string ("You can remotely edit this agent configuration").'</span></a>';
<img src='images/application_edit.png' border='0' align='middle' title='".__('This agent can be remotely configured')."'></a>";
echo '<a href="#" class="tip">&nbsp;<span>'.__('You can remotely edit this agent configuration').'</span></a>';
}
echo '<tr><td class="datos2">';
echo '<b>'.lang_string ("ip_address").'</b>';
echo '<b>'.__('ip_address').'</b>';
echo '<td class="datos2">';
print_input_text ('direccion', $direccion_agente, '', 16, 100);
@ -94,48 +97,48 @@ if ($create_agent != 1) {
}
echo "</select>";
echo "<input name='delete_ip' type=checkbox value='1'> ".lang_string ("delete_sel");
echo "<input name='delete_ip' type=checkbox value='1'> ".__('delete_sel');
echo "</td>";
}
echo '<tr><td class="datos"><b>'.lang_string ("Parent").'</b>';
echo '<tr><td class="datos"><b>'.__('Parent').'</b>';
echo '<td class="datos">';
print_select_from_sql ('SELECT id_agente, nombre FROM tagente ORDER BY nombre',
'id_parent', $id_parent, '', 'None', '0');
echo '<tr><td class="datos"><b>'.lang_string ("group").'</b>';
echo '<tr><td class="datos"><b>'.__('group').'</b>';
echo '<td class="datos">';
print_select_from_sql ('SELECT id_grupo, nombre FROM tgrupo ORDER BY nombre',
'grupo', $grupo, '', '', '');
echo "<tr><td class='datos2'>";
echo "<b>".lang_string ("interval")."</b></td>";
echo "<b>".__('interval')."</b></td>";
echo '<td class="datos2">';
echo '<input type="text" name="intervalo" size="15" value="'.$intervalo.'"></td>';
echo '<tr><td class="datos"><b>'.lang_string ("os").'</b></td>';
echo '<tr><td class="datos"><b>'.__('os').'</b></td>';
echo '<td class="datos">';
print_select_from_sql ('SELECT id_os, name FROM tconfig_os ORDER BY name',
'id_os', $id_os, '', '', '');
// Network server
echo '<tr><td class="datos2"><b>'.lang_string ("network_server").'</b>';
echo '<a href="#" class="tip">&nbsp;<span>'.lang_string ("network_server_help").'</span></a>';
echo '<tr><td class="datos2"><b>'.__('network_server').'</b>';
echo '<a href="#" class="tip">&nbsp;<span>'.__('network_server_help').'</span></a>';
echo '</td><td class="datos2">';
$none = '';
$none_value = '';
if ($id_network_server == 0) {
$none = lang_string ('None');
$none = __('None');
$none_value = 0;
}
print_select_from_sql ('SELECT id_server, name FROM tserver WHERE network_server = 1 ORDER BY name',
'network_server', $id_network_server, '', $none, $none_value);
// Plugin Server
echo '<tr><td class="datos"><b>'.lang_string ("plugin_server").'</b>';
echo '<a href="#" class="tip">&nbsp;<span>'.lang_string ("plugin_server_help").'</span></a>';
echo '<tr><td class="datos"><b>'.__('plugin_server').'</b>';
echo '<a href="#" class="tip">&nbsp;<span>'.__('plugin_server_help').'</span></a>';
echo '</td><td class="datos">';
$none_str = lang_string ('None');
$none_str = __('None');
$none = '';
$none_value = '';
if ($id_plugin_server == 0) {
@ -146,8 +149,8 @@ print_select_from_sql ('SELECT id_server, name FROM tserver WHERE plugin_server
'plugin_server', $id_plugin_server, '', $none, $none_value);
// WMI Server
echo '<tr><td class="datos2"><b>'.lang_string ("wmi_server").'</b>';
echo '<a href="#" class="tip">&nbsp;<span>'.lang_string ("wmi_server_help").'</span></a>';
echo '<tr><td class="datos2"><b>'.__('wmi_server').'</b>';
echo '<a href="#" class="tip">&nbsp;<span>'.__('wmi_server_help').'</span></a>';
echo '</td><td class="datos2">';
$none = '';
$none_value = '';
@ -159,8 +162,8 @@ print_select_from_sql ('SELECT id_server, name FROM tserver WHERE wmi_server = 1
'wmi_server', $id_wmi_server, '', $none, $none_value);
// Prediction Server
echo '<tr><td class="datos"><b>'.lang_string ("prediction_server").'</b>';
echo '<a href="#" class="tip">&nbsp;<span>'.lang_string ("prediction_server_help").'</span></a>';
echo '<tr><td class="datos"><b>'.__('prediction_server').'</b>';
echo '<a href="#" class="tip">&nbsp;<span>'.__('prediction_server_help').'</span></a>';
echo '</td><td class="datos">';
$none = '';
$none_value = '';
@ -173,30 +176,30 @@ print_select_from_sql ('SELECT id_server, name FROM tserver WHERE prediction_ser
// Description
echo '<tr><td class="datos2"><b>';
echo lang_string ("description");
echo __('description');
echo '</b><td class="datos2">';
print_input_text ('comentarios', $comentarios, '', 45, 255);
// Learn mode / Normal mode
echo '<tr><td class="datos"><b>';
echo lang_string ("module_definition");
echo __('module_definition');
pandora_help("module_definition");
echo '</b><td class="datos">';
echo lang_string ("learning_mode");
echo __('learning_mode');
print_radio_button_extended ("modo", 1, '', $modo, false, '', 'style="margin-right: 40px;"');
echo lang_string ("normal_mode");
echo __('normal_mode');
print_radio_button_extended ("modo", 0, '', $modo, false, '', 'style="margin-right: 40px;"');
// Status (Disabled / Enabled)
echo '<tr><td class="datos2"><b>'.lang_string ("status").'</b>';
echo '<tr><td class="datos2"><b>'.__('status').'</b>';
echo '<td class="datos2">';
echo lang_string ("disabled");
echo __('disabled');
print_radio_button_extended ("disabled", 1, '', $disabled, false, '', 'style="margin-right: 40px;"');
echo lang_string ("active");
echo __('active');
print_radio_button_extended ("disabled", 0, '', $disabled, false, '', 'style="margin-right: 40px;"');
// Remote configuration
echo '<tr><td class="datos"><b>'.lang_string ("Remote configuration").'</b>';
echo '<tr><td class="datos"><b>'.__('Remote configuration').'</b>';
echo '<td class="datos">';
$filename = $config["remote_config"] . "/" . $agent_md5 . ".md5";
if (file_exists($filename)){
@ -204,15 +207,15 @@ if (file_exists($filename)){
// Delete remote configuration
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&disk_conf_delete=1&id_agente=$id_agente'><img src='images/cross.png'></A>";
} else {
echo '<i>'.lang_string ("Not available").'</i>';
echo '<i>'.__('Not available').'</i>';
}
echo '</table><table width="650"><tr><td align="right">';
if ($create_agent == 1) {
print_submit_button (lang_string ('create'), 'crtbutton', false, 'class="sub wand"');
print_submit_button (__('create'), 'crtbutton', false, 'class="sub wand"');
print_input_hidden ('create_agent', 1);
} else {
print_submit_button (lang_string ('update'), 'updbutton', false, 'class="sub upd"');
print_submit_button (__('update'), 'updbutton', false, 'class="sub upd"');
print_input_hidden ('update_agent', 1);
print_input_hidden ('id_agente', $id_agente);
}

View File

@ -16,26 +16,27 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global vars
require("include/config.php");
check_login ();
// Access control
if (give_acl($id_user, 0, "AW")!=1) {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access agent manager");
if (! give_acl ($config['id_user'], 0, "AW")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access agent manager");
require ("general/noaccess.php");
exit;
};
return;
}
// ==========================
// TEMPLATE ASSIGMENT LOGIC
// ==========================
if (isset($_POST["template_id"])){
if (isset($_POST["template_id"])) {
// Take agent data
$sql1="SELECT * FROM tagente WHERE id_agente = '.$id_agente.'";
$result=mysql_query($sql1);
if ($row=mysql_fetch_array($result)){
$sql = "SELECT * FROM tagente WHERE id_agente = '.$id_agente.'";
$result = mysql_query ($sql);
if ($row = mysql_fetch_array ($result)) {
$intervalo = $row["intervalo"];
$nombre_agente = $row["nombre"];
$direccion_agente =$row["direccion"];
@ -51,13 +52,13 @@ if (isset($_POST["template_id"])){
$id_np = $_POST["template_id"];
$sql1 = "SELECT * FROM tnetwork_profile_component
WHERE id_np = $id_np";
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
$sql2 = "SELECT * FROM tnetwork_component
WHERE id_np = $id_np";
$result = mysql_query ($sql1);
while ($row = mysql_fetch_array ($result)){
$sql = "SELECT * FROM tnetwork_component
WHERE id_nc = ".$row["id_nc"];
$result2=mysql_query($sql2);
while ($row2=mysql_fetch_array($result2)){
$result2 = mysql_query ($sql);
while ($row2 = mysql_fetch_array ($result2)) {
// Insert each module from tnetwork_component into agent
$module_sql = "INSERT INTO tagente_modulo
(id_agente, id_tipo_modulo, descripcion, nombre, max, min, module_interval, tcp_port, tcp_send, tcp_rcv, snmp_community, snmp_oid, ip_target, id_module_group, id_modulo, plugin_user, plugin_pass, plugin_parameter, max_timeout)
@ -86,78 +87,78 @@ if (isset($_POST["template_id"])){
// Create with different estado if proc type or data type
$id_tipo_modulo = $row2["type"];
if (
($id_tipo_modulo == 2) ||
if (($id_tipo_modulo == 2) ||
($id_tipo_modulo == 6) ||
($id_tipo_modulo == 9) ||
($id_tipo_modulo == 12) ||
($id_tipo_modulo == 18)
){
$sql_insert = "INSERT INTO tagente_estado
($id_tipo_modulo == 18)) {
$sql = "INSERT INTO tagente_estado
(id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp)
VALUES (
$id_agente_modulo, 0,'0000-00-00 00:00:00',0,0,'".$id_agente."',0
)";
} else {
$sql_insert = "INSERT INTO tagente_estado
$sql = "INSERT INTO tagente_estado
(id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp)
VALUES (
$id_agente_modulo, 0,'0000-00-00 00:00:00',0,100,'".$id_agente."',0
)";
}
mysql_query ($sql_insert);
$sql_insert = "";
mysql_query ($sql);
$sql = "";
}
}
echo "<h3 class='suc'>".$lang_label["add_mod_ok"]."</h3>";
echo "<h3 class='suc'>".__('add_mod_ok')."</h3>";
}
// Main header
echo "<h2>".$lang_label["agent_conf"]." &gt; ".$lang_label["network_templates"];
echo "<h2>".__('agent_conf')." &gt; ".__('network_templates');
echo "</h2>";
// ==========================
// TEMPLATE ASSIGMENT FORM
// ==========================
echo "<h3>".$lang_label["available_templates"]."</h3>";
echo "<h3>".__('available_templates')."</h3>";
echo "<form method=post action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente=$id_agente'>";
echo "<table width='300' class='databox' cellpadding='4' cellspacing='4'>";
echo "<tr><td>".$lang_label['template']."</td><td valign='middle'>";
echo "<tr><td>".__('template')."</td><td valign='middle'>";
echo "<select name='template_id' class='w130'>";
$sql1 = 'SELECT * FROM tnetwork_profile ORDER BY name';
$result=mysql_query($sql1);
if (mysql_num_rows($result))
while ($row=mysql_fetch_array($result))
$sql = 'SELECT * FROM tnetwork_profile ORDER BY name';
$result = mysql_query ($sql);
if (mysql_num_rows ($result))
while ($row = mysql_fetch_array($result))
echo "<option value='".$row["id_np"]."'>".$row["name"]."</option>";
echo "</select></td>";
echo "<td>";
echo "<input type='submit' class='sub next' name='crt' value='".$lang_label["assign"]."'>";
echo "<input type='submit' class='sub next' name='crt' value='".__('assign')."'>";
echo "</table>";
echo "</form>";
// ==========================
// MODULE VISUALIZATION TABLE
// ==========================
echo "<h3>".$lang_label["assigned_modules"]."</h3>";
echo "<h3>".__('assigned_modules')."</h3>";
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = "'.$id_agente.'"
ORDER BY id_module_group, nombre ';
$result=mysql_query($sql1);
if ($row=mysql_num_rows($result)){
$sql = 'SELECT * FROM tagente_modulo WHERE id_agente = "'.$id_agente.'"
ORDER BY id_module_group, nombre ';
$result = mysql_query($sql);
if ($row = mysql_num_rows ($result)) {
echo '<table width="700" cellpadding="4" cellspacing="4" class="databox">';
echo '<tr>';
echo "<th>".$lang_label["module_name"]."</th>";
echo "<th>".$lang_label["type"]."</th>";
echo "<th>".$lang_label["description"]."</th>";
echo "<th width=50>".$lang_label["action"]."</th>";
$color=1;$last_modulegroup = "0";
while ($row=mysql_fetch_array($result)){
if ($color == 1){
echo "<th>".__('module_name')."</th>";
echo "<th>".__('type')."</th>";
echo "<th>".__('description')."</th>";
echo "<th width=50>".__('action')."</th>";
$color=1;
$last_modulegroup = "0";
while ($row = mysql_fetch_array ($result)) {
if ($color == 1) {
$tdcolor="datos";
$color =0;
} else {
@ -169,30 +170,30 @@ if ($row=mysql_num_rows($result)){
$descripcion = $row["descripcion"];
echo "<tr><td class='".$tdcolor."_id'>".$nombre_modulo;
echo "<td class='".$tdcolor."f9'>";
if ($id_tipo > 0) {
if ($id_tipo) {
echo "<img src='images/".show_icon_type($id_tipo)."' border=0>";
}
echo "<td class='$tdcolor' title='$descripcion'>".substr($descripcion,0,30)."</td>";
echo "<td class='$tdcolor'>";
if ($id_tipo != -1)
echo "<a href='index.php?sec=gagente&
tab=module&
sec2=godmode/agentes/configurar_agente&tab=template&
id_agente=".$id_agente."&
delete_module=".$row["id_agente_modulo"]."'>
<img src='images/cross.png' border=0 alt='".$lang_label["delete"]."'>
</b></a> &nbsp; ";
echo "<a href='index.php?sec=gagente&
tab=module&
sec2=godmode/agentes/configurar_agente&tab=template&
id_agente=".$id_agente."&
delete_module=".$row["id_agente_modulo"]."'>
<img src='images/cross.png' border=0 alt='".__('delete')."'>
</b></a> &nbsp; ";
echo "<a href='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&
id_agente=".$id_agente."&
tab=module&
update_module=".$row["id_agente_modulo"]."#modules'>
<img src='images/config.png' border=0 alt='".$lang_label["update"]."' onLoad='type_change()'></b></a>";
<img src='images/config.png' border=0 alt='".__('update')."' onLoad='type_change()'></b></a>";
}
echo "</td></tr>";
echo "</table>";
} else
} else {
echo "<div class='nf'>No modules</div>";
}
?>
?>

View File

@ -15,22 +15,20 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ====================================================================================
// VIEW ALERTS
// ====================================================================================
// Load global vars
require("include/config.php");
check_login();
if (give_acl($config["id_user"], 0, "AW")!=1) {
audit_db($config["id_user"], $REMOTE_ADDR, "ACL Violation","Trying to access agent manager");
require ($config["homedir"]."/general/noaccess.php");
exit;
if (! give_acl ($config["id_user"], 0, "AW")) {
audit_db ($config["id_user"], $REMOTE_ADDR, "ACL Violation",
"Trying to access agent manager");
require ($config["homedir"]."/general/noaccess.php");
return;
};
echo "<h2>".$lang_label["agent_conf"]." &gt; ".$lang_label["alerts"]."</h2>";
echo "<h2>".__('agent_conf')." &gt; ".__('alerts')."</h2>";
// ==========================
// Create module/type combo
// ==========================
@ -40,11 +38,11 @@ echo '<form name="modulo" method="post" action="index.php?sec=gagente&sec2=godmo
echo "<tr><td class='datos'>";
echo '<select name="form_alerttype">';
echo "<option value='simple'>".lang_string("Create a simple alert");
echo "<option value='combined'>".lang_string("Create a new combined alert");
echo "<option value='simple'>".__('Create a simple alert');
echo "<option value='combined'>".__('Create a new combined alert');
echo "</select></td>";
echo '<td class="datos">';
echo '<input align="right" name="updbutton" type="submit" class="sub wand" value="'.$lang_label["create"].'">';
echo '<input align="right" name="updbutton" type="submit" class="sub wand" value="'.__('create').'">';
echo "</form>";
echo "</table>";
@ -52,148 +50,148 @@ echo "</table>";
// Simple alerts view
// ==========================
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = "'.$id_agente.'"';
$result=mysql_query($sql1);
if ($row=mysql_num_rows($result)){
$sql = 'SELECT * FROM tagente_modulo WHERE id_agente = "'.$id_agente.'"';
$result = mysql_query ($sql);
if ($row = mysql_num_rows( $result)) {
echo "<h3>".lang_string ("Simple alerts")."</h3>";
echo "<h3>".__('Simple alerts')."</h3>";
$color=1;
$string='';
while ($row=mysql_fetch_array($result)){ // All modules of this agent
$id_tipo = $row["id_tipo_modulo"];
$nombre_modulo = substr($row["nombre"],0,21);
//module type modulo is $row2["nombre"];
$sql3='SELECT *
FROM talerta_agente_modulo
WHERE id_agente_modulo = '.$row["id_agente_modulo"];
// From all the alerts give me which are from my agent
$result3=mysql_query($sql3);
while ($row3=mysql_fetch_array($result3)){
if ($color == 1){
$tdcolor="datos";
$color =0;
} else {
$tdcolor="datos2";
$color =1;
}
$sql4='SELECT nombre FROM talerta WHERE id_alerta = '.$row3["id_alerta"];
$result4=mysql_query($sql4);
$row4=mysql_fetch_array($result4);
// Alert name defined by $row4["nombre"];
$nombre_alerta = $row4["nombre"];
$string = $string."<tr style='color: #666;'><td class='$tdcolor'>".$nombre_modulo;
$string .= show_alert_row_edit ($row3, $tdcolor, $row["id_tipo_modulo"],0);
$string = $string."</td><td class='$tdcolor'>";
$id_grupo = dame_id_grupo($id_agente);
if (give_acl($id_user, $id_grupo, "LW")==1){
$string = $string."<a href='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&tab=alert&
id_agente=".$id_agente."&delete_alert=".$row3["id_aam"]."'>
<img src='images/cross.png' border=0 alt='".$lang_label["delete"]."'></a> &nbsp; ";
$string = $string."<a href='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&tab=alert&
id_agente=".$id_agente."&update_alert=".$row3["id_aam"]."'>
<img src='images/config.png' border=0 alt='".$lang_label["update"]."'></a>";
}
$string = $string."</td>";
$color=1;
$string='';
while ($row=mysql_fetch_array($result)){ // All modules of this agent
$id_tipo = $row["id_tipo_modulo"];
$nombre_modulo = substr($row["nombre"],0,21);
//module type modulo is $row2["nombre"];
$sql = 'SELECT *
FROM talerta_agente_modulo
WHERE id_agente_modulo = '.$row["id_agente_modulo"];
// From all the alerts give me which are from my agent
$result3=mysql_query($sql);
while ($row3=mysql_fetch_array($result3)){
if ($color == 1){
$tdcolor="datos";
$color =0;
} else {
$tdcolor="datos2";
$color =1;
}
$sql4='SELECT nombre FROM talerta WHERE id_alerta = '.$row3["id_alerta"];
$result4=mysql_query($sql4);
$row4=mysql_fetch_array($result4);
// Alert name defined by $row4["nombre"];
$nombre_alerta = $row4["nombre"];
$string = $string."<tr style='color: #666;'><td class='$tdcolor'>".$nombre_modulo;
$string .= show_alert_row_edit ($row3, $tdcolor, $row["id_tipo_modulo"],0);
$string = $string."</td><td class='$tdcolor'>";
$id_grupo = dame_id_grupo($id_agente);
if (give_acl ($config['id_user'], $id_grupo, "LW")) {
$string = $string."<a href='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&tab=alert&
id_agente=".$id_agente."&delete_alert=".$row3["id_aam"]."'>
<img src='images/cross.png' border=0 alt='".__('delete')."'></a> &nbsp; ";
$string = $string."<a href='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&tab=alert&
id_agente=".$id_agente."&update_alert=".$row3["id_aam"]."'>
<img src='images/config.png' border=0 alt='".__('update')."'></a>";
}
$string = $string."</td>";
}
if (isset($string) & $string!='') {
echo "<table cellpadding='4' cellspacing='4' width='750' class='databox'>
<tr><th>".$lang_label["name"]."</th>
<th>".$lang_label["type"]."</th>
<th>".$lang_label["alert"]."</th>
<th>".$lang_label["threshold"]."</th>
<th>".$lang_label["min."]."</th>
<th>".$lang_label["max."]."</th>
<th>".$lang_label["time"]."</th>
<th>".$lang_label["description"]."</th>
<th>".lang_string ("info")."</th>
<th width='50'>".$lang_label["action"]."</th></tr>";
echo $string;
echo "</table>";
} else {
echo "<div class='nf'>".$lang_label["no_alerts"]."</div>";
}
} else {
echo "<div class='nf'>".$lang_label["no_modules"]."</div>";
}
if (isset($string) & $string!='') {
echo "<table cellpadding='4' cellspacing='4' width='750' class='databox'>
<tr><th>".__('name')."</th>
<th>".__('type')."</th>
<th>".__('alert')."</th>
<th>".__('threshold')."</th>
<th>".__('min.')."</th>
<th>".__('max.')."</th>
<th>".__('time')."</th>
<th>".__('description')."</th>
<th>".__('info')."</th>
<th width='50'>".__('action')."</th></tr>";
echo $string;
echo "</table>";
} else {
echo "<div class='nf'>".__('no_alerts')."</div>";
}
} else {
echo "<div class='nf'>".__('no_modules')."</div>";
}
// ==========================
// Combined alerts view
// ==========================
echo "<h3>".lang_string("combined alerts")."</h3>";
echo "<h3>".__('combined alerts')."</h3>";
$sql1='SELECT * FROM talerta_agente_modulo WHERE id_agent = '.$id_agente;
$result=mysql_query($sql1);
if (mysql_num_rows($result) == 0){
echo "<div class='nf'>".$lang_label["no_modules"]."</div>";
$sql = 'SELECT * FROM talerta_agente_modulo WHERE id_agent = '.$id_agente;
$result = mysql_query ($sql);
if (mysql_num_rows($result) == 0) {
echo "<div class='nf'>".__('no_modules')."</div>";
} else {
$color = 1;
$string = "";
while ($row=mysql_fetch_array($result)){
// Show data for this combined alert
$string .= "<tr><td class='datos3'>";
$string .= lang_string("Combined")." #".$row["id_aam"];
$string .= show_alert_row_edit ($row, "datos3", 0, 1);
$string .= '<td class="datos3">'; // action
if (give_acl($id_user, $id_grupo, "LW")==1){
$string .= "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=".$id_agente."&delete_alert=".$row["id_aam"]."'> <img src='images/cross.png' border=0 alt='".$lang_label["delete"]."'></a> &nbsp; ";
$string .= "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=".$id_agente."&form_alerttype=combined&update_alert=".$row["id_aam"]."'>
<img src='images/config.png' border=0 alt='".$lang_label["update"]."'></a>";
}
$id_aam = $row["id_aam"];
$sql2 = "SELECT * FROM tcompound_alert, talerta_agente_modulo WHERE tcompound_alert.id = $id_aam AND talerta_agente_modulo.id_aam = tcompound_alert.id_aam";
$result2=mysql_query($sql2);
while ($row2=mysql_fetch_array($result2)){
// Show data for each component of this combined alert
if ($color == 1){
$tdcolor="datos";
$color =0;
} else {
$tdcolor="datos2";
$color =1;
}
$module = get_db_row ("tagente_modulo", "id_agente_modulo", $row2["id_agente_modulo"]);
$description = $row2["descripcion"];
$alert_mode = $row2["operation"];
$id_agente_name = get_db_value ("nombre", "tagente", "id_agente", $module["id_agente"]);
$string .= "<tr style='color: #666;'><td class='$tdcolor'><a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=".$module["id_agente"]."'><b>".$id_agente_name." </b>- ".substr($module["nombre"],0,15)."</A>";
$string .= show_alert_row_edit ($row2, $tdcolor, $module["id_tipo_modulo"],1);
$color = 1;
$string = "";
while ($row=mysql_fetch_array($result)){
// Show data for this combined alert
$string .= "<tr><td class='datos3'>";
$string .= __('Combined')." #".$row["id_aam"];
$string .= show_alert_row_edit ($row, "datos3", 0, 1);
$string .= '<td class="datos3">'; // action
if (give_acl($config['id_user'], $id_grupo, "LW")==1){
$string .= "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=".$id_agente."&delete_alert=".$row["id_aam"]."'> <img src='images/cross.png' border=0 alt='".__('delete')."'></a> &nbsp; ";
$string .= "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=".$id_agente."&form_alerttype=combined&update_alert=".$row["id_aam"]."'>
<img src='images/config.png' border=0 alt='".__('update')."'></a>";
}
$id_aam = $row["id_aam"];
$sql = "SELECT * FROM tcompound_alert, talerta_agente_modulo WHERE tcompound_alert.id = $id_aam AND talerta_agente_modulo.id_aam = tcompound_alert.id_aam";
$result2 = mysql_query ($sql);
while ($row2 = mysql_fetch_array($result2)) {
// Show data for each component of this combined alert
if ($color == 1){
$tdcolor="datos";
$color =0;
} else {
$tdcolor="datos2";
$color =1;
}
$module = get_db_row ("tagente_modulo", "id_agente_modulo", $row2["id_agente_modulo"]);
$description = $row2["descripcion"];
$alert_mode = $row2["operation"];
$id_agente_name = get_db_value ("nombre", "tagente", "id_agente", $module["id_agente"]);
$string .= "<tr style='color: #666;'><td class='$tdcolor'><a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=".$module["id_agente"]."'><b>".$id_agente_name." </b>- ".substr($module["nombre"],0,15)."</A>";
$string .= show_alert_row_edit ($row2, $tdcolor, $module["id_tipo_modulo"],1);
$string .= "</td><td class='$tdcolor'>";
$id_grupo = dame_id_grupo($id_agente);
if (give_acl($id_user, $id_grupo, "LW")==1){
$string .= "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=".$id_agente."&delete_alert_comp=".$row2["id_aam"]."'> <img src='images/cross.png' border=0 alt='".$lang_label["delete"]."'></a> &nbsp; ";
$string .= "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=".$id_agente."&update_alert=".$row2["id_aam"]."'>
<img src='images/config.png' border=0 alt='".$lang_label["update"]."'></a>";
}
$string .= "</td>";
}
}
if (isset($string) & $string != "") {
echo "<table cellpadding='4' cellspacing='4' width='750' class='databox'>
<tr><th>".$lang_label["name"]."</th>
<th>".$lang_label["type"]."</th>
<th>".lang_string ("Oper")."</th>
<th>".$lang_label["threshold"]."</th>
<th>".$lang_label["min."]."</th>
<th>".$lang_label["max."]."</th>
<th>".$lang_label["time"]."</th>
<th>".$lang_label["description"]."</th>
<th>".lang_string ("info")."</th>
<th width='50'>".$lang_label["action"]."</th></tr>";
echo $string;
echo "</table>";
} else {
echo "<div class='nf'>".$lang_label["no_alerts"]."</div>";
}
$string .= "</td><td class='$tdcolor'>";
$id_grupo = dame_id_grupo($id_agente);
if (give_acl($config['id_user'], $id_grupo, "LW")==1){
$string .= "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=".$id_agente."&delete_alert_comp=".$row2["id_aam"]."'> <img src='images/cross.png' border=0 alt='".__('delete')."'></a> &nbsp; ";
$string .= "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=".$id_agente."&update_alert=".$row2["id_aam"]."'>
<img src='images/config.png' border=0 alt='".__('update')."'></a>";
}
$string .= "</td>";
}
}
if (isset($string) & $string != "") {
echo "<table cellpadding='4' cellspacing='4' width='750' class='databox'>
<tr><th>".__('name')."</th>
<th>".__('type')."</th>
<th>".__('Oper')."</th>
<th>".__('threshold')."</th>
<th>".__('min.')."</th>
<th>".__('max.')."</th>
<th>".__('time')."</th>
<th>".__('description')."</th>
<th>".__('info')."</th>
<th width='50'>".__('action')."</th></tr>";
echo $string;
echo "</table>";
} else {
echo "<div class='nf'>".__('no_alerts')."</div>";
}
}
?>

View File

@ -20,7 +20,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
$add_component = get_parameter ("add_component",0);
echo "<h3>".$lang_label["alert_asociation_form"];
echo "<h3>".__('alert_asociation_form');
pandora_help ("alerts");
echo "</h3>";
@ -45,7 +45,7 @@ echo '<input type="hidden" name="id_agente" value="'.$id_agente.'">';
echo '<table width=600 cellpadding="4" cellspacing="4" class="databox_color" border=0>';
// AgentModule association
echo '<tr><td class="datos3">'.lang_string("assigned_module");
echo '<tr><td class="datos3">'.__('assigned_module');
echo '<td class="datos3">';
if ($form_alerttype != "combined"){
if ($update_alert != 1) {
@ -68,10 +68,10 @@ if ($form_alerttype != "combined"){
echo $agentmodule_name;
}
} else {
echo lang_string ("N/A");
echo __('N/A');
}
echo '<td class="datos3">';
echo lang_string ("Priority");
echo __('Priority');
echo '<td class="datos3">';
if (! isset($alert_priority)) {
@ -80,7 +80,7 @@ if (! isset($alert_priority)) {
print_select (get_priorities (), "alert_priority", $alert_priority, '', '', '');
// Alert type
echo '<tr><td class="datos">'. lang_string ("alert_type");
echo '<tr><td class="datos">'. __('alert_type');
pandora_help ("alert_type");
echo '</td>';
echo '<td class="datos"><select name="tipo_alerta">';
@ -96,45 +96,45 @@ echo "</select>";
// Alert disable / enable
echo "<td class='datos'>";
echo $lang_label["alert_status"];
echo __('alert_status');
echo "<td class='datos'>";
echo '<select name="disable_alert">';
if ((isset($alerta_disable)) AND ($alerta_disable == "1")) {
echo "<option value='1'>".$lang_label["disabled"];
echo "<option value='0'>".$lang_label["enabled"];
echo "<option value='1'>".__('disabled');
echo "<option value='0'>".__('enabled');
} else {
echo "<option value='0'>".$lang_label["enabled"];
echo "<option value='1'>".$lang_label["disabled"];
echo "<option value='0'>".__('enabled');
echo "<option value='1'>".__('disabled');
}
echo "</select>";
// Descripcion
echo '<tr><td class="datos2">'.$lang_label["description"];
echo '<tr><td class="datos2">'.__('description');
echo '<td class="datos2" colspan=4><input type="text" name="descripcion" size="60" value ="'.$alerta_descripcion.'">';
// Trigger values for alert
if ($form_alerttype != "combined"){
echo '<tr><td class="datos">'.$lang_label["min_value"];
echo "<a href='#' class='tip'>&nbsp;<span>";echo $lang_label["min_valid_value_help"]."</span></a>";
echo '<tr><td class="datos">'.__('min_value');
echo "<a href='#' class='tip'>&nbsp;<span>";echo __('min_valid_value_help')."</span></a>";
echo '<td class="datos"><input type="text" name="minimo" size="5" value="'.$alerta_dis_min.'" style="margin-right: 70px;">';
echo "<td class='datos'>";
echo $lang_label["max_value"];
echo __('max_value');
echo "<a href='#' class='tip'>&nbsp;<span>";
echo $lang_label["max_valid_value_help"];
echo __('max_valid_value_help');
echo "</span></a>";
echo "<td class='datos'>";
echo "<input type='text' name='maximo' size='5' value='$alerta_dis_max'>";
// <!-- FREE TEXT ALERT -->
echo '<tr><td class="datos2">'.$lang_label["alert_text"]."<a href='#' class='tip'>&nbsp;<span>NOTE: This field is for matching text on data. Regular Expression Supported </span></a>";
echo '<tr><td class="datos2">'.__('alert_text')."<a href='#' class='tip'>&nbsp;<span>NOTE: This field is for matching text on data. Regular Expression Supported </span></a>";
echo '<td class="datos2" colspan=4><input type="text" name="alert_text" size="60" value ="'.$alert_text.'">';
}
// Time Threshold (TT)
echo '<tr><td class="datos">'.$lang_label["time_threshold"];
echo "<a href='#' class='tip'>&nbsp;<span>".$lang_label["alert_time_threshold_help"]."</span></a>";
echo '<tr><td class="datos">'.__('time_threshold');
echo "<a href='#' class='tip'>&nbsp;<span>".__('alert_time_threshold_help')."</span></a>";
echo '<td class="datos">';
echo '<select name="time_threshold" style="margin-right: 60px;">';
if ($alerta_time_threshold != ""){
@ -156,12 +156,12 @@ echo '
// Other TT
echo '<td class="datos">';
echo $lang_label["other"];
echo __('other');
echo '<td class="datos">';
echo '<input type="text" name="other" size="5">';
// Max / Min alerts
echo "<tr><td class='datos2'>".$lang_label["min_alerts"];
echo "<tr><td class='datos2'>".__('min_alerts');
echo '<td class="datos2">';
echo '<input type="text" name="min_alerts" size="5" value="';
if (isset($alerta_min_alerts))
@ -171,7 +171,7 @@ else
echo '" style="margin-right: 10px;">';
echo '<td class="datos2">';
echo $lang_label["max_alerts"];
echo __('max_alerts');
echo '<td class="datos2">';
echo '<input type="text" name="max_alerts" size="5" value="';
if (isset($alerta_max_alerts))
@ -181,20 +181,20 @@ else
echo '" style="margin-right: 10px;">';
// Field1
echo '<tr><td class="datos">'.lang_string ("field1");
echo '<tr><td class="datos">'.__('field1');
echo '<td class="datos" colspan=4><input type="text" name="campo_1" size="39" value="'.$alerta_campo1.'">';
echo "<a href='#' class='tip'><span><b>Macros:</b><br>_agent_<br>";
echo '_timestamp_<br>_data_<br></span></a>';
// Field2
echo '<tr><td class="datos2">'.$lang_label["field2"];
echo '<tr><td class="datos2">'.__('field2');
echo '<td class="datos2" colspan=4>';
echo '<input type="text" name="campo_2" size="39" value="'.$alerta_campo2.'">';
echo "<a href='#' class='tip'><span>";
echo '<b>Macros:</b><br>_agent_<br>_timestamp_<br>_data_<br></span></a>';
//Field3
echo '<tr><td class="datos">'.lang_string ("field3");
echo '<tr><td class="datos">'.__('field3');
echo '<td class="datos" colspan=4>';
echo '<textarea name="campo_3" style="height:85px; width: 380px" rows="4">';
echo $alerta_campo3;
@ -202,7 +202,7 @@ echo '</textarea><a href="#" class="tip"><span><b>Macros:</b><br>_agent_<br>';
echo '_timestamp_<br>_data_<br></span></a>';
// Time for alerting
echo "<tr><td class='datos2'>".$lang_label["time_from"];
echo "<tr><td class='datos2'>".__('time_from');
echo "<td class='datos2'><select name='time_from'>";
if ($time_from != ""){
echo "<option value='$time_from'>".substr($time_from,0,5);
@ -217,7 +217,7 @@ for ($a=0; $a < 48; $a++){
echo "<option value='23:59'>23:59";
echo "</select>";
echo "<td class='datos2'>".$lang_label["time_to"];
echo "<td class='datos2'>".__('time_to');
echo "<td class='datos2'><select name='time_to'>";
if ($time_from != ""){
echo "<option value='$time_to'>".substr($time_to,0,5);
@ -233,52 +233,52 @@ echo "<option value='23:59'>23:59";
echo "</select>";
// Days of week
echo "<tr><td class='datos'>".lang_string ("Days of week");
echo "<tr><td class='datos'>".__('Days of week');
echo "<td class='datos' colspan=4>";
echo lang_string("Mon");
echo __('Mon');
print_checkbox ("alert_d1", 1, $alert_d1);
echo "&nbsp;&nbsp;";
echo lang_string("Tue");
echo __('Tue');
print_checkbox ("alert_d2", 1, $alert_d2);
echo "&nbsp;&nbsp;";
echo lang_string("Wed");
echo __('Wed');
print_checkbox ("alert_d3", 1, $alert_d3);
echo "&nbsp;&nbsp;";
echo lang_string("Thu");
echo __('Thu');
print_checkbox ("alert_d4", 1, $alert_d4);
echo "&nbsp;&nbsp;";
echo lang_string("Fri");
echo __('Fri');
print_checkbox ("alert_d5", 1, $alert_d5);
echo "&nbsp;&nbsp;";
echo lang_string("Sat");
echo __('Sat');
print_checkbox ("alert_d6", 1, $alert_d6);
echo "&nbsp;&nbsp;";
echo lang_string("Sun");
echo __('Sun');
print_checkbox ("alert_d7", 1, $alert_d7);
// Field2 Recovery
echo '<tr><td class="datos2">'.lang_string ("Field #2 (Rec)");
echo '<tr><td class="datos2">'.__('Field #2 (Rec)');
echo '<td class="datos2">';
echo '<input type="text" name="campo_2_rec" size="20" value="'.$alerta_campo2_rec.'">';
// Alert recovery disable / enable
echo '<td class="datos2">'. lang_string ("Alert recovery");
echo '<td class="datos2">'. __('Alert recovery');
pandora_help ("alert_recovery");
echo '</td>';
echo "<td class='datos2'>";
echo '<select name="alert_recovery">';
if ((isset($alert_recovery)) AND ($alert_recovery == "1")) {
echo "<option value='1'>".$lang_label["enabled"];
echo "<option value='0'>".$lang_label["disabled"];
echo "<option value='1'>".__('enabled');
echo "<option value='0'>".__('disabled');
} else {
echo "<option value='0'>".$lang_label["disabled"];
echo "<option value='1'>".$lang_label["enabled"];
echo "<option value='0'>".__('disabled');
echo "<option value='1'>".__('enabled');
}
echo "</select>";
//Field3 - Recovery
echo '<tr><td class="datos">'.lang_string ("Field #3 (Rec)");
echo '<tr><td class="datos">'.__('Field #3 (Rec)');
echo '<td class="datos" colspan=4>';
echo '<input type="text" name="campo_3_rec" size="60" value="'.$alerta_campo3_rec.'">';
@ -288,16 +288,16 @@ echo "</td></tr></table>";
echo '<table width=605>';
echo '<tr><td align="right">';
if ($update_alert== "1"){
echo '<input name="updbutton" type="submit" class="sub upd" value="'.$lang_label["update"].'">';
echo '<input name="updbutton" type="submit" class="sub upd" value="'.__('update').'">';
} else {
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.$lang_label["add"].'">';
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.__('add').'">';
}
echo '</form>';
echo '</td></tr></table>';
if (($form_alerttype == "combined") AND ($update_alert != -1)){
echo "<h3>".lang_string ("Combined alert components")."</h3>";
echo "<h3>".__('Combined alert components')."</h3>";
echo '<table width=605 class="databox" border=0 cellpadding=4 cellspacing=4>';
echo '<form method=POST action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente='.$id_agente.'&update_alert='.$alerta_id_aam.'&add_component=1&form_alerttype=combined">';
@ -310,7 +310,7 @@ if (($form_alerttype == "combined") AND ($update_alert != -1)){
echo '<input type="hidden" name="id_agente" value="'.$id_agente.'">';
echo "<tr><td>";
echo lang_string ("Source Agent/Alert");
echo __('Source Agent/Alert');
echo "<td>";
echo "<select name='component_item'>";
@ -339,7 +339,7 @@ $result_alert = mysql_query("SELECT tagente_modulo.id_agente_modulo, tagente.nom
$row=mysql_fetch_array($result);
if ($row[0] > 0){
echo "<td>";
echo lang_string ("Operation");
echo __('Operation');
echo "<td>";
echo "<select name='component_operation'>";
echo "<option>OR";
@ -353,23 +353,23 @@ $result_alert = mysql_query("SELECT tagente_modulo.id_agente_modulo, tagente.nom
echo "<input type=hidden name='component_operation' value='NOP'>";
}
echo "<td>";
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.$lang_label["add"].'">';
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.__('add').'">';
echo "</form>";
echo "</table>";
echo '<table width=750 cellpadding="4" cellspacing="4" class="databox" border=0>';
echo '<tr>';
echo '<th>'.lang_string ("agent");
echo '<th>'.lang_string ("module");
echo "<th>".$lang_label["type"]."</th>
<th>".lang_string ("Oper")."</th>
<th>".$lang_label["threshold"]."</th>
<th>".$lang_label["min."]."</th>
<th>".$lang_label["max."]."</th>
<th>".$lang_label["time"]."</th>
<th>".$lang_label["description"]."</th>
<th>".lang_string ("info")."</th>
<th width='50'>".$lang_label["action"]."</th></tr>";
echo '<th>'.__('agent');
echo '<th>'.__('module');
echo "<th>".__('type')."</th>
<th>".__('Oper')."</th>
<th>".__('threshold')."</th>
<th>".__('min.')."</th>
<th>".__('max.')."</th>
<th>".__('time')."</th>
<th>".__('description')."</th>
<th>".__('info')."</th>
<th width='50'>".__('action')."</th></tr>";
$id_aam = $alerta_id_aam;
$sql2 = "SELECT * FROM tcompound_alert, talerta_agente_modulo WHERE tcompound_alert.id = $id_aam AND talerta_agente_modulo.id_aam = tcompound_alert.id_aam";
@ -397,10 +397,10 @@ $result_alert = mysql_query("SELECT tagente_modulo.id_agente_modulo, tagente.nom
echo show_alert_row_edit ($row2, $tdcolor, $module["id_tipo_modulo"],1);
echo "</td><td class='$tdcolor'>";
$id_grupo = dame_id_grupo($id_agente);
if (give_acl($id_user, $id_grupo, "LW")==1){
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=".$id_agente."&delete_alert_comp=".$row2["id_aam"]."'> <img src='images/cross.png' border=0 alt='".$lang_label["delete"]."'></a> &nbsp; ";
if (give_acl ($config['id_user'], $id_grupo, "LW")) {
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=".$id_agente."&delete_alert_comp=".$row2["id_aam"]."'> <img src='images/cross.png' border=0 alt='".__('delete')."'></a> &nbsp; ";
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=".$id_agente."&update_alert=".$row2["id_aam"]."'>
<img src='images/config.png' border=0 alt='".$lang_label["update"]."'></a>";
<img src='images/config.png' border=0 alt='".__('update')."'></a>";
}
echo "</td>";
}

View File

@ -19,8 +19,12 @@
// Load global vars
require("include/config.php");
if (give_acl($config["id_user"], 0, "AW")!=1) {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access agent manager");
check_login ();
if (! give_acl($config["id_user"], 0, "AW")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access agent manager");
require ("general/noaccess.php");
exit;
};
@ -130,7 +134,7 @@ if ( isset ($_POST["create_agent"])) { // Create a new and shining agent
$sql1='SELECT nombre FROM tagente WHERE nombre = "'.$nombre_agente.'"';
$result=mysql_query($sql1);
if ($row=mysql_fetch_array($result)){
$agent_creation_error = lang_string("agent_exists");
$agent_creation_error = __('agent_exists');
$agent_created_ok = 0;
} else {
$sql_insert ="INSERT INTO tagente (nombre, direccion, id_grupo, intervalo, comentarios,modo, id_os, disabled, id_network_server, id_plugin_server, id_wmi_server, id_prediction_server, id_parent) VALUES ('$nombre_agente', '$direccion_agente', $grupo , $intervalo , '$comentarios',$modo, $id_os, $disabled, $id_network_server, $id_plugin_server, $id_wmi_server, $id_prediction_server, $id_parent)";
@ -166,42 +170,42 @@ echo "<div id='menu_tab_left'>
<ul class='mn'>";
echo "<li class='nomn'>";
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=$id_agente'>
<img src='images/setup.png' class='top' border='0'>&nbsp; ".substr(dame_nombre_agente($id_agente),0,15)." - ".$lang_label["setup_mode"]."</a>";
<img src='images/setup.png' class='top' border='0'>&nbsp; ".substr(dame_nombre_agente($id_agente),0,15)." - ".__('setup_mode')."</a>";
echo "</li>";
echo "</ul></div>";
echo "<div id='menu_tab'><ul class='mn'>";
echo "<li class='nomn'>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='images/zoom.png' width='16' class='top' border='0'>&nbsp;".$lang_label["view"]."</a>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='images/zoom.png' width='16' class='top' border='0'>&nbsp;".__('view')."</a>";
echo "</li>";
if ($tab == "main")
echo "<li class='nomn_high'>";
else
echo "<li class='nomn'>";
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente=$id_agente'><img src='images/cog.png' width='16' class='top' border='0'>&nbsp; ".$lang_label["setup_agent"]."</a>";
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente=$id_agente'><img src='images/cog.png' width='16' class='top' border='0'>&nbsp; ".__('setup_agent')."</a>";
echo "</li>";
if ($tab == "module")
echo "<li class='nomn_high'>";
else
echo "<li class='nomn'>";
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente=$id_agente'><img src='images/lightbulb.png' width='16' class='top' border='0'>&nbsp;".$lang_label["modules"]."</a>";
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente=$id_agente'><img src='images/lightbulb.png' width='16' class='top' border='0'>&nbsp;".__('modules')."</a>";
echo "</li>";
if ($tab == "alert")
echo "<li class='nomn_high'>";
else
echo "<li class='nomn'>";
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=$id_agente'><img src='images/bell.png' width='16' class='top' border='0'>&nbsp;". $lang_label["Alerts"]."</a>";
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=$id_agente'><img src='images/bell.png' width='16' class='top' border='0'>&nbsp;". __('Alerts')."</a>";
echo "</li>";
if ($tab == "template")
echo "<li class='nomn_high'>";
else
echo "<li class='nomn'>";
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente=$id_agente'><img src='images/network.png' width='16' class='top' border=0>&nbsp;".$lang_label["ntemplates"]."</a>";
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente=$id_agente'><img src='images/network.png' width='16' class='top' border=0>&nbsp;".__('ntemplates')."</a>";
echo "</li>";
echo "</ul>";
@ -215,10 +219,10 @@ echo "<div style='height: 25px'> </div>";
// Show agent creation results
if (isset($_POST["create_agent"])){
if ($agent_created_ok == 0){
echo "<h3 class='error'>".$lang_label["create_agent_no"]."</h3>";
echo "<h3 class='error'>".__('create_agent_no')."</h3>";
echo $agent_creation_error;
} else {
echo "<h3 class='suc'>".$lang_label["create_agent_ok"]."</h3>";
echo "<h3 class='suc'>".__('create_agent_ok')."</h3>";
}
}
@ -236,7 +240,7 @@ if (isset($_GET["fix_module"])){
$media = $media * 1.3;
$sql1 = "DELETE FROM tagente_datos WHERE datos > $media AND id_agente_modulo = $id_module AND id_agente = $id_agent";
$result=mysql_query($sql1);
echo "<h3 class='suc'>".$lang_label["delete_data_above"]." $media</h3>";
echo "<h3 class='suc'>".__('delete_data_above')." $media</h3>";
}
}
@ -249,9 +253,9 @@ if (isset($_GET["delete_alert"])){ // if modified some parameter
$sql1='DELETE FROM talerta_agente_modulo WHERE id_aam = '.$id_borrar_modulo;
$result=mysql_query($sql1);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_alert_no"]."</h3>";
echo "<h3 class='error'>".__('delete_alert_no')."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_alert_ok"]."</h3>";
echo "<h3 class='suc'>".__('delete_alert_ok')."</h3>";
}
@ -263,9 +267,9 @@ if (isset($_GET["delete_alert_comp"])){ // if modified some parameter
$sql1='DELETE FROM tcompound_alert WHERE id_aam = '.$id_borrar_modulo;
$result=mysql_query($sql1);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_alert_no"]."</h3>";
echo "<h3 class='error'>".__('delete_alert_no')."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_alert_ok"]."</h3>";
echo "<h3 class='suc'>".__('delete_alert_ok')."</h3>";
}
// Create alert
@ -338,10 +342,10 @@ if (isset($_POST["insert_alert"])){ // if created alert
'$campo2_rec' )";
$result=mysql_query($sql_insert);
if (! $result) {
echo "<h3 class='error'>".$lang_label["create_alert_no"]."</h3>";
echo "<h3 class='error'>".__('create_alert_no')."</h3>";
} else {
$id_alerta_agente_modulo = mysql_insert_id();
echo "<h3 class='suc'>".$lang_label["create_alert_ok"]."</h3>";
echo "<h3 class='suc'>".__('create_alert_ok')."</h3>";
}
}
@ -356,9 +360,9 @@ if (isset($_POST["add_alert_combined"])){ // Update an existing alert
VALUES ($alerta_id_aam, $component_item, '$component_operation')";
$result=mysql_query($sql_insert);
if (! $result) {
echo "<h3 class='error'>".lang_string ("Problem adding component alert")."</h3>";
echo "<h3 class='error'>".__('Problem adding component alert')."</h3>";
} else {
echo "<h3 class='suc'>".lang_string ("Alert component added ok")."</h3>";
echo "<h3 class='suc'>".__('Alert component added ok')."</h3>";
}
}
@ -439,10 +443,10 @@ if (isset($_POST["update_alert"])){ // Update an existing alert
WHERE id_aam = ".$id_aam;
$result=mysql_query($sql_insert);
if (! $result) {
echo "<h3 class='error'>".$lang_label["update_alert_no"]."</h3>";
echo "<h3 class='error'>".__('update_alert_no')."</h3>";
}
else
echo "<h3 class='suc'>".$lang_label["update_agent_ok"]."</h3>";
echo "<h3 class='suc'>".__('update_agent_ok')."</h3>";
}
// ================
@ -481,9 +485,9 @@ if (isset($_POST["update_agent"])) { // if modified some agent paramenter
$result=mysql_query($sql_update);
if (! $result) {
echo "<h3 class='error'>".$lang_label["update_agent_no"]."</h3>";
echo "<h3 class='error'>".__('update_agent_no')."</h3>";
} else {
echo "<h3 class='suc'>".$lang_label["update_agent_ok"]."</h3>";
echo "<h3 class='suc'>".__('update_agent_ok')."</h3>";
}
}
@ -515,7 +519,7 @@ if (isset($_GET["id_agente"])) {
$disabled=$row["disabled"];
$id_parent = $row["id_parent"];
} else {
echo "<h3 class='error'>".$lang_label["agent_error"]."</h3>";
echo "<h3 class='error'>".__('agent_error')."</h3>";
echo "</table>";
echo "</div><div id='foot'>";
include ("general/footer.php");
@ -687,9 +691,9 @@ if ((isset($_POST["update_module"])) && (!isset($_POST["oid"]))){ // if modified
WHERE id_agente_modulo = '$id_agente_modulo'";
$result=mysql_query($sql_update);
if (! $result) {
echo "<h3 class='error'>".$lang_label["update_module_no"]."</h3>";
echo "<h3 class='error'>".__('update_module_no')."</h3>";
} else {
echo "<h3 class='suc'>".$lang_label["update_module_ok"]."</h3>";
echo "<h3 class='suc'>".__('update_module_ok')."</h3>";
}
}
@ -700,9 +704,9 @@ if ((isset($_POST["update_module"])) && (!isset($_POST["oid"]))){ // if modified
if (isset($_POST["oid"])){
snmp_set_quick_print(1);
if (! ($snmpwalk = snmprealwalk($form_ip_target, $form_snmp_community, ""))) {
echo "<h3 class='error'>".$lang_label["cannot_read_snmp"]."</h3>";
echo "<h3 class='error'>".__('cannot_read_snmp')."</h3>";
} else {
echo "<h3 class='suc'>".$lang_label["ok_read_snmp"]."</h3>";
echo "<h3 class='suc'>".__('ok_read_snmp')."</h3>";
}
}
@ -730,10 +734,10 @@ if (((!isset($_POST["nc"]) OR ($_POST["nc"]==-1))) && (!isset($_POST["oid"])) &&
VALUES ($id_agente, $form_id_tipo_modulo, '$form_name', '$form_description', $form_maxvalue, $form_minvalue, '$form_snmp_oid', '$form_snmp_community', $form_id_module_group, $form_interval, '$form_ip_target', $form_tcp_port, '$form_tcp_rcv', '$form_tcp_send', $form_id_export, '$form_plugin_user', '$form_plugin_pass', '$form_plugin_parameter', $form_id_plugin, $form_post_process, $form_id_prediction_module, $form_max_timeout, $form_disabled, $form_id_modulo)";
$result=mysql_query($sql_insert);
if (! $result){
echo "<h3 class='error'>".$lang_label["add_module_no"]."</h3>";
echo "<h3 class='error'>".__('add_module_no')."</h3>";
echo "<i>DEBUG: $sql_insert</i>";
} else {
echo "<h3 class='suc'>".$lang_label["add_module_ok"]."</h3>";
echo "<h3 class='suc'>".__('add_module_ok')."</h3>";
$id_agente_modulo = mysql_insert_id();
// Create with different estado if proc type or data type
if (($form_id_tipo_modulo == 2) || // data_proc
@ -774,9 +778,9 @@ if (isset($_GET["delete_module"])){ // DELETE agent module !
WHERE id_agente_modulo = ".$id_borrar_modulo;
$result=mysql_query($sql_delete);
if (! $result) {
echo "<h3 class='error'>".$lang_label["delete_module_no"]."</h3>";
echo "<h3 class='error'>".__('delete_module_no')."</h3>";
} else {
echo "<h3 class='suc'>".$lang_label["delete_module_ok"]."</h3>";
echo "<h3 class='suc'>".__('delete_module_ok')."</h3>";
}
// Then delete all staus
$sql_delete = "DELETE FROM tagente_estado

View File

@ -22,38 +22,39 @@ require ("include/config.php");
check_login ();
$id_user = $_SESSION["id_usuario"];
$id_group = get_parameter ("id_group",0);
if (! give_acl ($config['id_user'], 0, "LM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Config Management Admin section");
require ("general/noaccess.php");
return;
}
$id_group = get_parameter ("id_group", 0);
$origen = get_parameter ("origen", -1);
$update_agent = get_parameter ("update_agent", -1);
$update_group = get_parameter ("update_group", -1);
if ( (give_acl($id_user, 0, "LM")==0) AND (give_acl($id_user, 0, "AW")==0) ){
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Agent Config Management Admin section");
require ("general/noaccess.php");
}
// Operations
// ---------------
if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group == -1) ) {
if ((isset($_GET["operacion"])) && ($update_agent == -1) && ($update_group == -1)) {
// DATA COPY
// ---------
if (isset($_POST["copy"])) {
echo "<h2>".$lang_label["datacopy"]."</h2>";
echo "<h2>".__('datacopy')."</h2>";
// Initial checkings
// if selected more than 0 agents
$destino = $_POST["destino"];
if (count($destino) <= 0){
echo "<h3 class='error'>ERROR: ".$lang_label["noagents_cp"]."</h3>";
echo "<h3 class='error'>ERROR: ".__('noagents_cp')."</h3>";
echo "</table>";
include ("general/footer.php");
exit;
}
$origen_modulo = $_POST["origen_modulo"];
if (count($origen_modulo) <= 0){
echo "<h3 class='error'>ERROR: ".$lang_label["nomodules_selected"]."</h3>";
echo "<h3 class='error'>ERROR: ".__('nomodules_selected')."</h3>";
echo "</table>";
include ("general/footer.php");
exit;
@ -74,7 +75,7 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
else
$alertas = 0;
if (($alertas + $modulos) == 0){
echo "<h3 class='error'>ERROR: ".$lang_label["you_must_select_modules"]."</h3>";;
echo "<h3 class='error'>ERROR: ".__('you_must_select_modules')."</h3>";;
echo "</table>";
include ("general/footer.php");
exit;
@ -86,14 +87,14 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
// For every agent in destination
$id_agente = $destino[$a];
echo "<br><br>".$lang_label["copyage"]."<b> [".dame_nombre_agente($id_origen)."] -> [".dame_nombre_agente($id_agente)."]</b>";
echo "<br><br>".__('copyage')."<b> [".dame_nombre_agente($id_origen)."] -> [".dame_nombre_agente($id_agente)."]</b>";
if ($multiple == 0)
$b=-1;
$b = -1;
else
$b=0;
$b = 0;
// Module read
if ($modulos == 1){
if ($modulos == 1) {
for ($b=$b; $b < count($origen_modulo); $b++){
if ($multiple == 0)
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_origen;
@ -149,7 +150,7 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
)";
$result2=mysql_query($sql);
if (! $result2)
echo "<h3 class=error>".lang_string("Problem updating database")."</h3>";
echo "<h3 class=error>".__('Problem updating database')."</h3>";
$o_id_agente_modulo = mysql_insert_id();
// Create with different estado if proc type or data type
@ -174,7 +175,7 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
)";
}
$result_status=mysql_query($sql_status_insert);
echo "<br>&nbsp;&nbsp;".$lang_label["copymod"]." ->".$o_nombre;
echo "<br>&nbsp;&nbsp;".__('copymod')." ->".$o_nombre;
}
}
}
@ -251,10 +252,10 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
$o_recovery_notify, $o_priority, '$o_al_f2_recovery',
'$o_al_f3_recovery' )";
$result_al=mysql_query($sql_al);
echo "<br>&nbsp;&nbsp;".$lang_label["copyale"]." ->".$o_descripcion;
echo "<br>&nbsp;&nbsp;".__('copyale')." ->".$o_descripcion;
}
} else
echo "<br><h3 class='error'>ERROR: ".$lang_label["notfoundmod"].$o_nombre.$lang_label["inagent"].dame_nombre_agente($d_id_agente)."</h3>";
echo "<br><h3 class='error'>ERROR: ".__('notfoundmod').$o_nombre.__('inagent').dame_nombre_agente($d_id_agente)."</h3>";
} //while
} // for
} // Alerts
@ -267,13 +268,13 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
// -----------
elseif (isset($_POST["delete"])) {
echo "<h2>".$lang_label["deletedata"]."</h2>";
echo "<h2>".__('deletedata')."</h2>";
// Initial checkings
// if selected more than 0 agents
$destino = $_POST["destino"];
if (count($destino) <= 0){
echo "<h3 class='error'>ERROR: ".$lang_label["noagents_del"]."</h3>";
echo "<h3 class='error'>ERROR: ".__('noagents_del')."</h3>";
break;
}
@ -291,7 +292,7 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
for ($a=0;$a <count($destino); $a++){ // for each agent
$id_agente = $destino[$a];
if ($modulos == 1){
echo "<br>".$lang_label["deleting_data"]." -> ".dame_nombre_agente($id_agente);
echo "<br>".__('deleting_data')." -> ".dame_nombre_agente($id_agente);
// Deleting data
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_agente;
@ -324,13 +325,13 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
}// for
}//delete
elseif (isset($_POST["delete_agent"])) {
echo "<h2>".lang_string("delete_agents")."</h2>";
echo "<h2>".__('delete_agents')."</h2>";
// Initial checkings
// if selected more than 0 agents
$destino = $_POST["destino"];
if (count($destino) <= 0){
echo "<h3 class='error'>ERROR: ".$lang_label["noagents_del"]."</h3>";
echo "<h3 class='error'>ERROR: ".__('noagents_del')."</h3>";
break;
}
@ -338,7 +339,7 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
for ($a=0;$a <count($destino); $a++){ // for each agent
$id_agente = $destino[$a];
echo "<br>".$lang_label["deleting_data"]." -> ".dame_nombre_agente($id_agente);
echo "<br>".__('deleting_data')." -> ".dame_nombre_agente($id_agente);
// Deleting data
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_agente;
@ -368,8 +369,8 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
$result = mysql_query($sql_delete1);
} // while
// delete agent
$sql1='DELETE FROM tagente WHERE id_agente = '.$id_agente;
// delete agent
$sql1='DELETE FROM tagente WHERE id_agente = '.$id_agente;
$result1=mysql_query($sql1);
}// for
}//delete
@ -380,24 +381,24 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
} else {
// title
echo '<h2>'.lang_string ("agent_conf"). '&gt;'. lang_string ("config_manage").'</h2>';
echo '<h2>'.__('agent_conf'). '&gt;'. __('config_manage').'</h2>';
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/manage_config&operacion=1">';
echo "<table width='650' border='0' cellspacing='4' cellpadding='4' class='databox'>";
// Source group
echo '<tr><td class="datost"><b>'. lang_string ("Source group"). '</b><br><br>';
echo '<tr><td class="datost"><b>'. __('Source group'). '</b><br><br>';
echo '<select name="id_group" style="width:200px">';
if ($id_group != 0)
echo "<option value=$id_group>".dame_nombre_grupo ($id_group);
echo "<option value=0>".lang_string ("All");
echo "<option value=0>".__('All');
list_group ($config["id_user"]);
echo '</select>';
echo '&nbsp;&nbsp;';
echo '<input type=submit name="update_group" class="sub upd" value="'.lang_string("Filter").'">';
echo '<input type=submit name="update_group" class="sub upd" value="'.__('Filter').'">';
echo '<br><br>';
// Source agent
echo '<b>'. lang_string ("source_agent").'</b><br><br>';
echo '<b>'. __('source_agent').'</b><br><br>';
// Show combo with SOURCE agents
if ($id_group != 0)
@ -417,11 +418,11 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
echo '</select>';
echo '&nbsp;&nbsp;';
echo '<input type=submit name="update_agent" class="sub upd" value="'.lang_string ("get_info").'">';
echo '<input type=submit name="update_agent" class="sub upd" value="'.__('get_info').'">';
echo '<br><br>';
// Source Module(s)
echo "<b>".$lang_label["modules"]."</b><br><br>";
echo "<b>".__('modules')."</b><br><br>";
echo "<select name='origen_modulo[]' size=10 multiple=yes style='width: 250px;'>";
if ( (isset($_POST["update_agent"])) AND (isset($_POST["origen"])) ) {
// Populate Module/Agent combo
@ -435,18 +436,18 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
echo "</select>";
echo '<td class="datost">';
echo '<b>'.lang_string ("copy_conf"). '</b><br><br>';
echo '<b>'.__('copy_conf'). '</b><br><br>';
echo '<table>';
echo '<tr class=datos><td>'.lang_string ("modules");
echo '<tr class=datos><td>'.__('modules');
echo '<td><input type="checkbox" name="modules" value="1" class="chk">';
echo '<tr class=datos><td>'.lang_string ("alerts");
echo '<tr class=datos><td>'.__('alerts');
echo '<td><input type="checkbox" name="alerts" value="1" class="chk">';
echo '</table>';
// Destination agent
echo '<tr><td class="datost">';
echo '<b>'.$lang_label["toagent"].'</b><br><br>';
echo '<b>'.__('toagent').'</b><br><br>';
echo "<select name=destino[] size=10 multiple=yes style='width: 250px;'>";
$sql1='SELECT * FROM tagente ORDER BY nombre';
$result=mysql_query($sql1);
@ -458,12 +459,12 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
// Form buttons
echo '<td align="left" class="datosb">';
echo "<br><br>";
echo '<input type="submit" name="copy" class="sub copy" value="'.lang_string ("copy").'" onClick="if (!confirm("'.lang_string ("are_you_sure").'")) return false;>';
echo "<br><br>";
echo '<input type="submit" name="delete" class="sub delete" value="'. lang_string("delete").'" onClick="if (!confirm("'.lang_string ("are_you_sure").'")) return false;>';
echo "<br><br>";
echo '<input type="submit" name="delete_agent" class="sub delete" value="'. lang_string("Delete Agents").'" onClick="if (!confirm("'.lang_string ("are_you_sure").'")) return false;>';
echo "<br><br>";
echo '<input type="submit" name="copy" class="sub copy" value="'.__('copy').'" onClick="if (!confirm("'.__('are_you_sure').'")) return false;>';
echo "<br><br>";
echo '<input type="submit" name="delete" class="sub delete" value="'. __('delete').'" onClick="if (!confirm("'.__('are_you_sure').'")) return false;>';
echo "<br><br>";
echo '<input type="submit" name="delete_agent" class="sub delete" value="'. __('Delete Agents').'" onClick="if (!confirm("'.__('are_you_sure').'")) return false;>';
echo '<tr><td colspan=2>';
echo '</div></td></tr>';

View File

@ -21,31 +21,31 @@ require ("include/config.php");
check_login();
$id_user = $_SESSION["id_usuario"];
$origen = get_parameter ("origen", -1);
$id_group = get_parameter ("id_group", -1);
$update_agent = get_parameter ("update_agent", -1);
$update_group = get_parameter ("update_group", -1);
if ( (give_acl($id_user, 0, "LM")==0) AND (give_acl($id_user, 0, "AW")==0) ){
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Agent Config Management Admin section");
if (! give_acl ($config['id_user'], 0, "LM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Config Management Admin section");
require ("general/noaccess.php");
return;
}
// Operations
// ---------------
if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group == -1) ) {
// DATA COPY
// ---------
if (isset($_POST["copy"])) {
echo "<h2>".$lang_label["datacopy"]."</h2>";
echo "<h2>".__('datacopy')."</h2>";
// Initial checkings
// if selected more than 0 agents
$destino = $_POST["destino"];
if (count($destino) <= 0){
echo "<h3 class='error'>ERROR: ".$lang_label["noagents_cp"]."</h3>";
echo "<h3 class='error'>ERROR: ".__('noagents_cp')."</h3>";
echo "</table>";
include ("general/footer.php");
exit;
@ -61,7 +61,7 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
$id_agente = $destino[$a];
$agent_name_src = dame_nombre_agente($id_origen);
$agent_name_dst = dame_nombre_agente($id_agente);
echo "<br><br>".$lang_label["copyage"]."<b> [".$agent_name_src."] -> [".$agent_name_dst."]</b>";
echo "<br><br>".__('copyage')."<b> [".$agent_name_src."] -> [".$agent_name_dst."]</b>";
$source = $config["remote_config"]."/".md5($agent_name_src);
$destination = $config["remote_config"]."/".md5($agent_name_dst);
@ -77,24 +77,24 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
} else {
// title
echo '<h2>'.lang_string ("agent_conf"). '&gt;'. lang_string ("config_manage").'</h2>';
echo '<h2>'.__('agent_conf'). '&gt;'. __('config_manage').'</h2>';
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/manage_config_remote&operacion=1">';
echo "<table width='650' border='0' cellspacing='4' cellpadding='4' class='databox'>";
// Source group
echo '<tr><td class="datost"><b>'. lang_string ("Source group"). '</b><br><br>';
echo '<tr><td class="datost"><b>'. __('Source group'). '</b><br><br>';
echo '<select name="id_group" style="width:200px">';
if ($id_group != 0)
echo "<option value=$id_group>".dame_nombre_grupo ($id_group);
echo "<option value=0>".lang_string ("All");
echo "<option value=0>".__('All');
list_group ($config["id_user"]);
echo '</select>';
echo '&nbsp;&nbsp;';
echo '<input type=submit name="update_group" class="sub upd" value="'.lang_string("Filter").'">';
echo '<input type=submit name="update_group" class="sub upd" value="'.__('Filter').'">';
echo '<br><br>';
// Source agent
echo '<b>'. lang_string ("source_agent").'</b><br><br>';
echo '<b>'. __('source_agent').'</b><br><br>';
// Show combo with SOURCE agents
if ($id_group != 0)
@ -121,12 +121,12 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
echo '</select>';
echo '&nbsp;&nbsp;';
echo '<input type=submit name="update_agent" class="sub upd" value="'.lang_string ("get_info").'">';
echo '<input type=submit name="update_agent" class="sub upd" value="'.__('get_info').'">';
echo '<br><br>';
// Destination agent
echo '<tr><td class="datost">';
echo '<b>'.$lang_label["toagent"].'</b><br><br>';
echo '<b>'.__('toagent').'</b><br><br>';
echo "<select name=destino[] size=10 multiple=yes style='width: 250px;'>";
$sql1='SELECT * FROM tagente ORDER BY nombre';
$result=mysql_query($sql1);
@ -138,7 +138,7 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group ==
// Form buttons
echo '<td align="right" class="datosb">';
echo '<input type="submit" name="copy" class="sub next" value="'.lang_string ("Replicate configuration").'" onClick="if (!confirm("'.lang_string ("are_you_sure").'")) return false;>';
echo '<input type="submit" name="copy" class="sub next" value="'.__('Replicate configuration').'" onClick="if (!confirm("'.__('are_you_sure').'")) return false;>';
echo '<tr><td colspan=2>';
echo '</div></td></tr>';
echo '</table>';

View File

@ -46,9 +46,9 @@ if (isset($_GET["borrar_agente"])){ // if delete agent
WHERE id_agente = ".$id_agente;
$result=mysql_query($sql_delete);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_agent_no"]."</h3>";
echo "<h3 class='error'>".__('delete_agent_no')."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_agent_ok"]."</h3>";
echo "<h3 class='suc'>".__('delete_agent_ok')."</h3>";
// Delete agent access table
$sql_delete = "DELETE FROM tagent_access
WHERE id_agent = ".$id_agente;
@ -105,7 +105,7 @@ if (isset($_GET["borrar_agente"])){ // if delete agent
exit;
}
}
echo "<h2>".$lang_label["agent_conf"]." &gt; ".$lang_label["agent_defined2"]."</h2>";
echo "<h2>".__('agent_conf')." &gt; ".__('agent_defined2')."</h2>";
// Show group selector
if (isset($_POST["ag_group"])){
@ -118,7 +118,7 @@ if (isset($_POST["ag_group"])){
}
echo "<table cellpadding='4' cellspacing='4' class='databox' width=700><tr>";
echo "<td valign='top'>".$lang_label["group"]."</td>";
echo "<td valign='top'>".__('group')."</td>";
echo "<td valign='top'>";
echo "<select name='ag_group' onChange='javascript:this.form.submit();'
class='w130'>";
@ -133,13 +133,13 @@ echo "</select>";
echo "<td valign='top'>
<noscript>
<input name='uptbutton' type='submit' class='sub upd'
value='".$lang_label["show"]."'>
value='".__('show')."'>
</noscript>
</td>
</form>
<td valign='top'>";
echo $lang_label["free_text_search"];
echo __('free_text_search');
echo "</td><td>";
// Show group selector
@ -153,7 +153,7 @@ echo "<form method='post' action='index.php?sec=gagente&sec2=godmode/agentes/mod
echo "<input type=text name='search' size='15' >";
echo "</td><td valign='top'>";
echo "<input name='srcbutton' type='submit' class='sub'
value='".$lang_label["search"]."'>";
value='".__('search')."'>";
echo "</form>";
echo "</td></table>";
@ -192,12 +192,12 @@ echo "<div style='height: 20px'> </div>";
if (mysql_num_rows($result)){
echo "<table cellpadding='4' cellspacing='4' width='750' class='databox'>";
echo "<th>".$lang_label["agent_name"]."</th>";
echo "<th title='".lang_string("Remote agent configuration")."'>".lang_string ("R")."</th>";
echo "<th>".$lang_label["os"]."</th>";
echo "<th>".$lang_label["group"]."</th>";
echo "<th>".$lang_label["description"]."</th>";
echo "<th>".$lang_label["delete"]."</th>";
echo "<th>".__('agent_name')."</th>";
echo "<th title='".__('Remote agent configuration')."'>".__('R')."</th>";
echo "<th>".__('os')."</th>";
echo "<th>".__('group')."</th>";
echo "<th>".__('description')."</th>";
echo "<th>".__('delete')."</th>";
$color=1;
while ($row=mysql_fetch_array($result)){
$id_grupo = $row["id_grupo"];
@ -229,7 +229,7 @@ if (mysql_num_rows($result)){
if (file_exists($config["remote_config"] . "/" . $agent_md5 . ".md5")){
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente=".$row["id_agente"]."&disk_conf=" . $agent_md5 . "'>";
echo "<img src='images/application_edit.png' border='0' align='middle' title='".lang_string("Edit remote config")."'>";
echo "<img src='images/application_edit.png' border='0' align='middle' title='".__('Edit remote config')."'>";
echo "</A>";
}
echo "</td>";
@ -247,14 +247,14 @@ if (mysql_num_rows($result)){
// Action
echo "<td class='$tdcolor' align='center'><a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&
borrar_agente=".$row["id_agente"]."'";
echo ' onClick="if (!confirm(\' '.$lang_label["are_you_sure"].'\')) return false;">';
echo ' onClick="if (!confirm(\' '.__('are_you_sure').'\')) return false;">';
echo "<img border='0' src='images/cross.png'></a></td>";
}
}
echo "</table>";
echo "<table width='750'><tr><td align='right'>";
} else {
echo "<div class='nf'>".$lang_label["no_agent_def"]."</div>";
echo "<div class='nf'>".__('no_agent_def')."</div>";
echo "&nbsp;</td></tr><tr><td>";
}
@ -262,6 +262,6 @@ if (mysql_num_rows($result)){
echo "<form method='post' action='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&create_agent=1'>";
echo "<input type='submit' class='sub next' name='crt'
value='".$lang_label["create_agent"]."'>";
value='".__('create_agent')."'>";
echo "</form></td></tr></table>";
?>

View File

@ -19,7 +19,7 @@ if (give_acl($config["id_user"], 0, "AW")!=1) {
};
echo "<h2>".$lang_label["agent_conf"]." &gt; ".$lang_label["modules"]."</h2>";
echo "<h2>".__('agent_conf')." &gt; ".__('modules')."</h2>";
// ==========================
// Create module/type combo
@ -45,18 +45,18 @@ if (1 == $develop_bypass) {
$prediction_available = 1;
}
echo "<option value='dataserver'>".lang_string("Create a new data server module");
echo "<option value='dataserver'>".__('Create a new data server module');
if ($network_available == 1)
echo "<option value='networkserver'>".lang_string("Create a new network server module");
echo "<option value='networkserver'>".__('Create a new network server module');
if ($plugin_available == 1)
echo "<option value='pluginserver'>".lang_string("Create a new plugin Server module");
echo "<option value='pluginserver'>".__('Create a new plugin Server module');
if ($wmi_available == 1)
echo "<option value='wmiserver'>".lang_string("Create a new WMI Server module");
echo "<option value='wmiserver'>".__('Create a new WMI Server module');
if ($prediction_available == 1)
echo "<option value='predictionserver'>".lang_string("Create a new prediction Server module");
echo "<option value='predictionserver'>".__('Create a new prediction Server module');
echo "</select></td>";
echo '<td class="datos">';
echo '<input align="right" name="updbutton" type="submit" class="sub wand" value="'.$lang_label["create"].'">';
echo '<input align="right" name="updbutton" type="submit" class="sub wand" value="'.__('create').'">';
echo "</form>";
echo "</table>";
@ -64,20 +64,20 @@ echo "</table>";
// MODULE VISUALIZATION TABLE
// ==========================
echo "<h3>".lang_string ("assigned_modules")."</h3>";
echo "<h3>".__('assigned_modules')."</h3>";
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = "'.$id_agente.'"
ORDER BY id_module_group, nombre ';
$result=mysql_query($sql1);
if ($row=mysql_num_rows($result)){
echo '<table width="750" cellpadding="4" cellspacing="4" class="databox">';
echo '<tr>';
echo "<th>".$lang_label["module_name"]."</th>";
echo '<th>'.lang_string('S').'</th>';
echo '<th>'.lang_string('type').'</th>';
echo "<th>".$lang_label["interval"]."</th>";
echo "<th>".$lang_label["description"]."</th>";
echo "<th>".$lang_label["max_min"]."</th>";
echo "<th width=65>".$lang_label["action"]."</th>";
echo "<th>".__('module_name')."</th>";
echo '<th>'.__('S').'</th>';
echo '<th>'.__('type').'</th>';
echo "<th>".__('interval')."</th>";
echo "<th>".__('description')."</th>";
echo "<th>".__('max_min')."</th>";
echo "<th width=65>".__('action')."</th>";
$color=1; $last_modulegroup = "0";
while ($row = mysql_fetch_array($result)){
if ($color == 1){
@ -140,22 +140,22 @@ if ($row=mysql_num_rows($result)){
// Delete module
echo "<td class='$tdcolor'>";
echo "<a href='index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente=$id_agente&delete_module=".$row["id_agente_modulo"]."'".' onClick="if (!confirm(\' '.$lang_label["are_you_sure"].'\')) return false;">';
echo "<img src='images/cross.png' border=0 title='".$lang_label["delete"]."'>";
echo "<a href='index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente=$id_agente&delete_module=".$row["id_agente_modulo"]."'".' onClick="if (!confirm(\' '.__('are_you_sure').'\')) return false;">';
echo "<img src='images/cross.png' border=0 title='".__('delete')."'>";
echo "</b></a>&nbsp;";
// Update module
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=$id_agente&tab=module&update_module=".$row["id_agente_modulo"]."&moduletype=$id_module#modules'>";
echo "<img src='images/config.png' border=0 title='".$lang_label["update"]."' onLoad='type_change()'></b></a>";
echo "<img src='images/config.png' border=0 title='".__('update')."' onLoad='type_change()'></b></a>";
// Make a data normalization
if (($id_tipo == 22 ) OR ($id_tipo == 1 ) OR ($id_tipo == 4 ) OR ($id_tipo == 7 ) OR
($id_tipo == 8 ) OR ($id_tipo == 11 ) OR ($id_tipo == 16) OR ($id_tipo == 22 )) {
echo "&nbsp;";
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=$id_agente&tab=module&fix_module=".$row["id_agente_modulo"]."'".' onClick="if (!confirm(\' '.$lang_label["are_you_sure"].'\')) return false;">';
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=$id_agente&tab=module&fix_module=".$row["id_agente_modulo"]."'".' onClick="if (!confirm(\' '.__('are_you_sure').'\')) return false;">';
echo "<img src='images/chart_curve.png' border=0 title='Normalize'></b></a>";
}
}
echo "</table>";
} else
echo "<div class='nf'>".lang_string("No available data to show")."</div>";
echo "<div class='nf'>".__('No available data to show')."</div>";

View File

@ -76,7 +76,7 @@ if ($update_module_id != NULL){
}
}
echo "<h3>". lang_string ("module_assignment")." - ". lang_string("data server module")."</h3>";
echo "<h3>". __('module_assignment')." - ". __('data server module')."</h3>";
echo '<form name="modulo" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente.'&form_moduletype='.$form_moduletype.'">';
// Whether in update or insert mode
if ($update_module_id == NULL){
@ -92,15 +92,15 @@ echo "<input type='hidden' name='id_agente_modulo'' value='".$update_module_id."
echo "<input type='hidden' name='form_id_modulo' value='1'>";
echo '<table width="600" cellpadding="4" cellspacing="4" class="databox_color">';
echo '<tr>';
echo '<td class="datos2">'. lang_string ("module_name")."</td>";
echo '<td class="datos2">'. __('module_name')."</td>";
echo '<td class="datos2"><input type="text" name="form_name" size="35" value="'.$form_name.'"></td>';
echo '<td class="datos2">'. lang_string ("disabled")."</td>";
echo '<td class="datos2">'. __('disabled')."</td>";
echo '<td class="datos2"><input type="checkbox" name="form_disabled" value="1" "'.$disabled_status.'"></td>';
echo '</tr><tr>';
// module type / max timeout
echo '</tr><tr>';
echo '<td class="datos2">'.lang_string ("module_type");
echo '<td class="datos2">'.__('module_type');
pandora_help("module_type");
echo '</td>';
echo '<td class="datos2" colspan="3">';
@ -121,16 +121,16 @@ echo '</tr>';
// Post process / Export server
echo '<tr>';
echo '<td class="datos2">'.lang_string ("post_process");
echo '<td class="datos2">'.__('post_process');
pandora_help("postprocess");
echo '</td>';
echo '<td class="datos2"><input type="text" name="form_post_process" size="5" value="'.$form_post_process.'"></td>';
echo '<td class="datos2">'.lang_string ("export_server")."</td>";
echo '<td class="datos2">'.__('export_server')."</td>";
echo '<td class="datos2"><select name="form_id_export">';
if ($form_id_export != 0){
echo "<option value='".$form_id_export."'>".dame_nombre_servidorexportacion($form_id_export)."</option>";
}
echo "<option value='0'>".lang_string("None")."</option>";
echo "<option value='0'>".__('None')."</option>";
$sql1='SELECT id, name FROM tserver_export ORDER BY name;';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
@ -141,17 +141,17 @@ echo '</tr>';
// Max / min value
echo '<tr>';
echo '<td class="datos">'.lang_string ("min_value")."</td>";
echo '<td class="datos">'.__('min_value')."</td>";
echo '<td class="datos"><input type="text" name="form_minvalue" size="5" value="'.$form_minvalue.'"></td>';
echo '<td class="datos">'.lang_string ("max_value")."</td>";
echo '<td class="datos">'.__('max_value')."</td>";
echo '<td class="datos"><input type="text" name="form_maxvalue" size="5" value="'.$form_maxvalue.'"></td>';
echo '</tr>';
// Interval & id_module_group
echo '<tr>';
echo '<td class="datos2">'.lang_string ("interval")."</td>";
echo '<td class="datos2">'.__('interval')."</td>";
echo '<td class="datos2"><input type="text" name="form_interval" size="5" value="'.$form_interval.'"></td>';
echo '<td class="datos2">'.lang_string ("module_group")."</td>";
echo '<td class="datos2">'.__('module_group')."</td>";
echo '<td class="datos2">';
echo '<select name="form_id_module_group">';
if ($form_id_module_group != 0){
@ -167,7 +167,7 @@ echo '</tr>';
// Description
echo '<tr>';
echo '<td valign="top" class="datos">'.lang_string ("description")."</td>";
echo '<td valign="top" class="datos">'.__('description')."</td>";
echo '<td valign="top" class="datos" colspan="3"><textarea name="form_description" cols="65" rows="2">'.$form_description.'</textarea>';
echo '</tr>';
echo '</table>';
@ -176,9 +176,9 @@ echo '</table>';
echo '<table width="600" cellpadding="4" cellspacing="4">';
echo '<td valign="top" align="right">';
if ($update_module_id == NULL){
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.lang_string ("create").'">';
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.__('create').'">';
} else {
echo '<input name="updbutton" type="submit" class="sub wand" value="'.lang_string ("update").'">';
echo '<input name="updbutton" type="submit" class="sub wand" value="'.__('update').'">';
}
echo '</table>';

View File

@ -78,7 +78,7 @@ if ($update_module_id != NULL){
}
}
echo "<h3>".lang_string ("module_assignment")." - ".lang_string("network server module")."</h3>";
echo "<h3>".__('module_assignment')." - ".__('network server module')."</h3>";
echo '<table width="680" cellpadding="4" cellspacing="4" class="databox_color">';
// Create from Network Component
echo '<form name="modulo" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente.'&form_moduletype='.$form_moduletype.'">';
@ -97,7 +97,7 @@ echo "<input type='hidden' name='form_id_modulo' value='2'>";
// Network component usage
echo "<tr><td class='datos3'>";
echo lang_string ("using_network_component");
echo __('using_network_component');
pandora_help ("network_component");
echo "</td><td class='datos3' colspan=2>";
@ -106,7 +106,7 @@ if ($update_module_id != NULL){
echo "<input type='hidden' name='form_id_tipo_modulo' value='".$form_id_tipo_modulo."'>";
} else {
echo '<select name="form_network_component">';
echo '<option>---'.$lang_label["manual_config"].'---</option>';
echo '<option>---'.__('manual_config').'---</option>';
$sql1='SELECT * FROM tnetwork_component WHERE id_modulo = 2 ORDER BY name';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
@ -122,28 +122,28 @@ echo '</td>';
echo '<td class="datos3">';
echo '<input type="hidden" name="form_moduletype" value="'.$form_moduletype.'">';
if ($update_module_id == NULL){
echo '<input align="right" name="updbutton" type="submit" class="sub next" value="'.$lang_label["get_data"].'">';
echo '<input align="right" name="updbutton" type="submit" class="sub next" value="'.__('get_data').'">';
}
// Name / IP_target
echo '<tr>';
echo '<td class="datos2">'.lang_string ("module_name")."</td>";
echo '<td class="datos2">'.__('module_name')."</td>";
echo '<td class="datos2"><input type="text" name="form_name" size="20" value="'.$form_name.'"></td>';
echo '<td class="datos2">'.lang_string ("disabled")."</td>";
echo '<td class="datos2">'.__('disabled')."</td>";
echo '<td class="datos2"><input type="checkbox" name="form_disabled" value="1" "'.$disabled_status.'"></td>';
echo '</tr>';
// Ip target, tcp port
echo '<tr>';
echo '<td class="datos">'.lang_string ("ip_target")."</td>";
echo '<td class="datos">'.__('ip_target')."</td>";
echo '<td class="datos"><input type="text" name="form_ip_target" size="25" value="'.$form_ip_target.'"></td>';
echo '<td class="datos">'.lang_string ("tcp_port")."</td>";
echo '<td class="datos">'.__('tcp_port')."</td>";
echo '<td class="datos"><input type="text" name="form_tcp_port" size="5" value="'.$form_tcp_port.'"></td>';
echo '</tr>';
// module type / max timeout
echo '</tr><tr>';
echo '<td class="datos2">'.lang_string ("module_type");
echo '<td class="datos2">'.__('module_type');
pandora_help ("module_type");
echo '</td>';
@ -164,14 +164,14 @@ if ($update_module_id != NULL){
echo '</select>';
}
echo '<td class="datos2">'.lang_string ("max_timeout")."</td>";
echo '<td class="datos2">'.__('max_timeout')."</td>";
echo '<td class="datos2"><input type="text" name="form_max_timeout" size="4" value="'.$form_max_timeout.'"></td></tr>';
// Interval & id_module_group
echo '<tr>';
echo '<td class="datos">'.lang_string ("interval")."</td>";
echo '<td class="datos">'.__('interval')."</td>";
echo '<td class="datos"><input type="text" name="form_interval" size="5" value="'.$form_interval.'"></td>';
echo '<td class="datos">'.lang_string ("module_group")."</td>";
echo '<td class="datos">'.__('module_group')."</td>";
echo '<td class="datos">';
echo '<select name="form_id_module_group">';
if ($form_id_module_group != 0){
@ -186,7 +186,7 @@ echo '</select>';
// Snmp walk
echo '<tr>';
echo '<td class="datos2">'.lang_string ("snmp_walk");
echo '<td class="datos2">'.__('snmp_walk');
pandora_help ("snmpwalk");
echo '</td>';
echo '<td class="datos2" colspan=2>';
@ -207,34 +207,34 @@ echo '<input type="submit" class="sub next" name="oid" value="SNMP Walk">';
// Snmp Oid / community
echo '<tr>';
echo '<td class="datos">'.lang_string ("snmp_oid");
echo '<td class="datos">'.__('snmp_oid');
pandora_help ("snmpoid");
echo '</td>';
echo '<td class="datos"><input type="text" name="form_snmp_oid" size="25" value="'.$form_snmp_oid.'"></td>';
echo '<td class="datos">'.lang_string ("snmp_community")."</td>";
echo '<td class="datos">'.__('snmp_community')."</td>";
echo '<td class="datos"><input type="text" name="form_snmp_community" size="12" value="'.$form_snmp_community.'"></td>';
echo '</tr>';
// Max / min value
echo '<tr>';
echo '<td class="datos2">'.lang_string ("min_value")."</td>";
echo '<td class="datos2">'.__('min_value')."</td>";
echo '<td class="datos2"><input type="text" name="form_minvalue" size="5" value="'.$form_minvalue.'"></td>';
echo '<td class="datos2">'.lang_string ("max_value")."</td>";
echo '<td class="datos2">'.__('max_value')."</td>";
echo '<td class="datos2"><input type="text" name="form_maxvalue" size="5" value="'.$form_maxvalue.'"></td>';
echo '</tr>';
// Post process / Export server
echo '<tr>';
echo '<td class="datos">'.lang_string ("post_process");
echo '<td class="datos">'.__('post_process');
pandora_help ("postprocess");
echo '</td>';
echo '<td class="datos"><input type="text" name="form_post_process" size="5" value="'.$form_post_process.'"></td>';
echo '<td class="datos">'.lang_string ("export_server")."</td>";
echo '<td class="datos">'.__('export_server')."</td>";
echo '<td class="datos"><select name="form_id_export">';
if ($form_id_export != 0){
echo "<option value='".$form_id_export."'>".dame_nombre_servidorexportacion($form_id_export)."</option>";
}
echo "<option value='0'>".lang_string("None")."</option>";
echo "<option value='0'>".__('None')."</option>";
$sql1='SELECT id, name FROM tserver_export ORDER BY name;';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
@ -245,17 +245,17 @@ echo '</tr>';
// tcp send / rcv value
echo '<tr>';
echo '<td class="datos2" valign="top">'.lang_string ("tcp_send");
echo '<td class="datos2" valign="top">'.__('tcp_send');
pandora_help ("tcp_send");
echo "</td>";
echo '<td class="datos2"><textarea cols=20 style="height:55px;" name="form_tcp_send">'.$form_tcp_send.'</textarea>';
echo '<td class="datos2" valign="top">'.lang_string ("tcp_rcv")."</td>";
echo '<td class="datos2" valign="top">'.__('tcp_rcv')."</td>";
echo '<td class="datos2"><textarea cols=20 style="height:55px;" name="form_tcp_rcv">'.$form_tcp_rcv.'</textarea>';
echo '</tr>';
// Description
echo '<tr>';
echo '<td valign="top" class="datos">'.lang_string ("description")."</td>";
echo '<td valign="top" class="datos">'.__('description')."</td>";
echo '<td valign="top" class="datos" colspan="3"><textarea name="form_description" cols="65" rows="2">'.$form_description.'</textarea>';
echo '</tr>';
echo '</table>';
@ -264,9 +264,9 @@ echo '</table>';
echo '<table width="680" cellpadding="4" cellspacing="4">';
echo '<td valign="top" align="right">';
if ($update_module_id == NULL){
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.lang_string ("create").'">';
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.__('create').'">';
} else {
echo '<input name="updbutton" type="submit" class="sub wand" value="'.lang_string ("update").'">';
echo '<input name="updbutton" type="submit" class="sub wand" value="'.__('update').'">';
}
echo '</table>';

View File

@ -76,7 +76,7 @@ if ($update_module_id != NULL){
}
}
echo "<h3>".lang_string ("module_assignment")." - ".lang_string("Plugin server module")."</h3>";
echo "<h3>".__('module_assignment')." - ".__('Plugin server module')."</h3>";
echo '<table width="680" cellpadding="4" cellspacing="4" class="databox_color">';
echo '<form name="modulo" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente.'&form_moduletype='.$form_moduletype.'">';
// Whether in update or insert mode
@ -94,24 +94,24 @@ echo "<input type='hidden' name='form_id_modulo' value='4'>";
// Name / IP_target
echo '<tr>';
echo '<td class="datos2">'.lang_string ("module_name")."</td>";
echo '<td class="datos2">'.__('module_name')."</td>";
echo '<td class="datos2"><input type="text" name="form_name" size="20" value="'.$form_name.'"></td>';
echo '<td class="datos2">'.lang_string ("disabled")."</td>";
echo '<td class="datos2">'.__('disabled')."</td>";
echo '<td class="datos2"><input type="checkbox" name="form_disabled" value="1" "'.$disabled_status.'"></td>';
echo '</tr>';
// Ip target, Plugin Parameter
echo "<tr>";
echo '<td class="datos">'.lang_string ("ip_target")."</td>";
echo '<td class="datos">'.__('ip_target')."</td>";
echo '<td class="datos"><input type="text" name="form_ip_target" size="20" value="'.$form_ip_target.'"></td>';
echo '<td class="datos">'.lang_string ("plugin")."</td>";
echo '<td class="datos">'.__('plugin')."</td>";
echo '<td class="datos">';
// Get actual plugin ID and nicename
echo '<select name="form_id_plugin">';
if ($form_id_plugin != 0){
echo "<option value='".$form_id_plugin."'>".dame_nombre_pluginid($form_id_plugin)."</option>";
}
echo "<option value='0'>".lang_string("None")."</option>";
echo "<option value='0'>".__('None')."</option>";
$sql1='SELECT id, name FROM tplugin ORDER BY name;';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
@ -121,25 +121,25 @@ echo '</select>';
echo '</tr>';
echo '</tr><tr>';
echo '<td class="datos2">'.lang_string ("Plugin parameters");
echo '<td class="datos2">'.__('Plugin parameters');
pandora_help ("plugin_parameters");
echo '</td>';
echo '<td class="datos2"><input type="text" name="form_plugin_parameter" size="30" value="'.$form_plugin_parameter.'"></td>';
echo '<td class="datos2">'.lang_string ("Port")."</td>";
echo '<td class="datos2">'.__('Port')."</td>";
echo '<td class="datos2"><input type="text" name="form_tcp_port" size="4" value="'.$form_tcp_port.'"></td>';
// username / password
echo '<tr>';
echo '<td class="datos">'.lang_string ("Username")."</td>";
echo '<td class="datos">'.__('Username')."</td>";
echo '<td class="datos"><input type="text" name="form_plugin_user" size="10" value="'.$form_plugin_user.'"></td>';
echo '<td class="datos">'.lang_string ("Password")."</td>";
echo '<td class="datos">'.__('Password')."</td>";
echo '<td class="datos"><input type="password" name="form_plugin_pass" size="10" value="'.$form_plugin_pass.'"></td>';
echo '</tr>';
// module type / max timeout
echo '</tr><tr>';
echo '<td class="datos2">'.lang_string ("module_type");
echo '<td class="datos2">'.__('module_type');
pandora_help ("module_type");
echo '</td>';
echo '<td class="datos2">';
@ -157,14 +157,14 @@ if ($update_module_id != NULL){
echo '</select>';
}
echo '<td class="datos2">'.lang_string ("max_timeout")."</td>";
echo '<td class="datos2">'.__('max_timeout')."</td>";
echo '<td class="datos2"><input type="text" name="form_max_timeout" size="5" value="'.$form_max_timeout.'"></td></tr>';
// Interval & id_module_group
echo '<tr>';
echo '<td class="datos">'.lang_string ("interval")."</td>";
echo '<td class="datos">'.__('interval')."</td>";
echo '<td class="datos"><input type="text" name="form_interval" size="5" value="'.$form_interval.'"></td>';
echo '<td class="datos">'.lang_string ("module_group")."</td>";
echo '<td class="datos">'.__('module_group')."</td>";
echo '<td class="datos">';
echo '<select name="form_id_module_group">';
if ($form_id_module_group != 0){
@ -179,24 +179,24 @@ echo '</select>';
// Max / min value
echo '<tr>';
echo '<td class="datos2">'.lang_string ("min_value")."</td>";
echo '<td class="datos2">'.__('min_value')."</td>";
echo '<td class="datos2"><input type="text" name="form_minvalue" size="5" value="'.$form_minvalue.'"></td>';
echo '<td class="datos2">'.lang_string ("max_value")."</td>";
echo '<td class="datos2">'.__('max_value')."</td>";
echo '<td class="datos2"><input type="text" name="form_maxvalue" size="5" value="'.$form_maxvalue.'"></td>';
echo '</tr>';
// Post process / Export server
echo '<tr>';
echo '<td class="datos">'.lang_string ("post_process");
echo '<td class="datos">'.__('post_process');
pandora_help ("postprocess");
echo '</td>';
echo '<td class="datos"><input type="text" name="form_post_process" size="5" value="'.$form_post_process.'"></td>';
echo '<td class="datos">'.lang_string ("export_server")."</td>";
echo '<td class="datos">'.__('export_server')."</td>";
echo '<td class="datos"><select name="form_id_export">';
if ($form_id_export != 0){
echo "<option value='".$form_id_export."'>".dame_nombre_servidorexportacion($form_id_export)."</option>";
}
echo "<option value='0'>".lang_string("None")."</option>";
echo "<option value='0'>".__('None')."</option>";
$sql1='SELECT id, name FROM tserver_export ORDER BY name;';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
@ -207,7 +207,7 @@ echo '</tr>';
// Description
echo '<tr>';
echo '<td valign="top" class="datos">'.lang_string ("description")."</td>";
echo '<td valign="top" class="datos">'.__('description')."</td>";
echo '<td valign="top" class="datos" colspan="3"><textarea name="form_description" cols="65" rows="2">'.$form_description.'</textarea>';
echo '</tr>';
echo '</table>';
@ -216,9 +216,9 @@ echo '</table>';
echo '<table width="680" cellpadding="4" cellspacing="4">';
echo '<td valign="top" align="right">';
if ($update_module_id == NULL){
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.lang_string ("create").'">';
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.__('create').'">';
} else {
echo '<input name="updbutton" type="submit" class="sub wand" value="'.lang_string ("update").'">';
echo '<input name="updbutton" type="submit" class="sub wand" value="'.__('update').'">';
}
echo '</table>';

View File

@ -76,7 +76,7 @@ if ($update_module_id != NULL){
}
}
echo "<h3>".lang_string ("module_assignment")." - ".lang_string("Prediction server module")."</h3>";
echo "<h3>".__('module_assignment')." - ".__('Prediction server module')."</h3>";
echo '<form name="modulo" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente.'">';
// Whether in update or insert mode
if ($update_module_id == NULL){
@ -94,15 +94,15 @@ echo "<input type='hidden' name='form_id_modulo' value='5'>";
// name / disabled
echo '<table width="600" cellpadding="4" cellspacing="4" class="databox_color">';
echo '<tr>';
echo '<td class="datos2">'.lang_string ("module_name")."</td>";
echo '<td class="datos2">'.__('module_name')."</td>";
echo '<td class="datos2"><input type="text" name="form_name" size="35" value="'.$form_name.'"></td>';
echo '<td class="datos2">'.lang_string ("disabled")."</td>";
echo '<td class="datos2">'.__('disabled')."</td>";
echo '<td class="datos2"><input type="checkbox" name="form_disabled" value="1" "'.$disabled_status.'"></td>';
echo '</tr>';
echo '<tr>';
echo '<td class="datos">'.lang_string ("source_module");
echo '<td class="datos">'.__('source_module');
pandora_help ("prediction_source_module");
echo '</td>';
echo '<td class="datos" colspan="3">';
@ -118,7 +118,7 @@ echo "</tr>";
// module type
echo '</tr><tr>';
echo '<td class="datos2">'. lang_string ("module_type") .'</td>';
echo '<td class="datos2">'. __('module_type') .'</td>';
echo '<td class="datos2">';
if ($update_module_id != NULL){
echo "<span class='redi'>Not available in edition mode</span>";
@ -133,12 +133,12 @@ if ($update_module_id != NULL){
echo '</select>';
}
echo '<td class="datos2">'.lang_string ("interval")."</td>";
echo '<td class="datos2">'.__('interval')."</td>";
echo '<td class="datos2"><input type="text" name="form_interval" size="5" value="'.$form_interval.'"></td></tr>';
// Post process / Export server
echo '<tr>';
echo '<td class="datos">'.lang_string ("module_group")."</td>";
echo '<td class="datos">'.__('module_group')."</td>";
echo '<td class="datos"><select name="form_id_module_group">';
if ($form_id_module_group != 0){
echo "<option value='".$form_id_module_group."'>".dame_nombre_grupomodulo($form_id_module_group)."</option>";
@ -150,12 +150,12 @@ while ($row=mysql_fetch_array($result)){
}
echo '</select>';
echo '<td class="datos">'.lang_string ("export_server")."</td>";
echo '<td class="datos">'.__('export_server')."</td>";
echo '<td class="datos"><select name="form_id_export">';
if ($form_id_export != 0){
echo "<option value='".$form_id_export."'>".dame_nombre_servidorexportacion($form_id_export)."</option>";
}
echo "<option value='0'>".lang_string("None")."</option>";
echo "<option value='0'>".__('None')."</option>";
$sql1='SELECT id, name FROM tserver_export ORDER BY name;';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
@ -166,7 +166,7 @@ echo '</tr>';
// Description
echo '<tr>';
echo '<td valign="top" class="datos">'.lang_string ("description")."</td>";
echo '<td valign="top" class="datos">'.__('description')."</td>";
echo '<td valign="top" class="datos" colspan="3"><textarea name="form_description" cols="65" rows="2">'.$form_description.'</textarea>';
echo '</tr>';
echo '</table>';
@ -175,9 +175,9 @@ echo '</table>';
echo '<table width="680" cellpadding="4" cellspacing="4">';
echo '<td valign="top" align="right">';
if ($update_module_id == NULL){
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.lang_string ("create").'">';
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.__('create').'">';
} else {
echo '<input name="updbutton" type="submit" class="sub wand" value="'.lang_string ("update").'">';
echo '<input name="updbutton" type="submit" class="sub wand" value="'.__('update').'">';
}
echo '</table>';

View File

@ -76,7 +76,7 @@ if ($update_module_id != NULL){
}
}
echo "<h3>".lang_string ("module_assignment")." - ".lang_string("WMI server module")."</h3>";
echo "<h3>".__('module_assignment')." - ".__('WMI server module')."</h3>";
echo '<table width="680" cellpadding="4" cellspacing="4" class="databox_color">';
echo '<form name="modulo" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente.'&form_moduletype='.$form_moduletype.'">';
// Whether in update or insert mode
@ -94,7 +94,7 @@ echo "<input type='hidden' name='form_id_modulo' value='6'>";
// WMI component usage
echo "<tr><td class='datos3'>";
echo lang_string ("using_network_component");
echo __('using_network_component');
pandora_help ("network_component");
echo "</td><td class='datos3' colspan=2>";
@ -103,7 +103,7 @@ if ($update_module_id != NULL){
echo "<input type='hidden' name='form_id_tipo_modulo' value='".$form_id_tipo_modulo."'>";
} else {
echo '<select name="form_network_component">';
echo '<option>---'.$lang_label["manual_config"].'---</option>';
echo '<option>---'.__('manual_config').'---</option>';
$result=mysql_query('SELECT * FROM tnetwork_component WHERE id_modulo = 6 ORDER BY name');
while ($row=mysql_fetch_array($result)){
echo "<option value='".$row["id_nc"]."'>";
@ -119,22 +119,22 @@ echo '</td>';
echo '<td class="datos3">';
echo '<input type="hidden" name="form_moduletype" value="'.$form_moduletype.'">';
if ($update_module_id == NULL){
echo '<input align="right" name="updbutton" type="submit" class="sub next" value="'.$lang_label["get_data"].'">';
echo '<input align="right" name="updbutton" type="submit" class="sub next" value="'.__('get_data').'">';
}
// Name / IP_target
echo '<tr>';
echo '<td class="datos2">'.lang_string ("module_name")."</td>";
echo '<td class="datos2">'.__('module_name')."</td>";
echo '<td class="datos2"><input type="text" name="form_name" size="20" value="'.$form_name.'"></td>';
echo '<td class="datos2">'.lang_string ("disabled")."</td>";
echo '<td class="datos2">'.__('disabled')."</td>";
echo '<td class="datos2"><input type="checkbox" name="form_disabled" value="1" "'.$disabled_status.'"></td>';
echo '</tr>';
// Ip target, WMI query
echo '<tr>';
echo '<td class="datos">'.lang_string ("ip_target")."</td>";
echo '<td class="datos">'.__('ip_target')."</td>";
echo '<td class="datos"><input type="text" name="form_ip_target" size="20" value="'.$form_ip_target.'"></td>';
echo '<td class="datos">'.lang_string ("WMI Query");
echo '<td class="datos">'.__('WMI Query');
pandora_help("wmiquery");
echo "</td>";
echo '<td class="datos"><input type="text" name="form_snmp_oid" size="25" value="'.$form_snmp_oid.'"></td>';
@ -142,11 +142,11 @@ echo '</tr>';
// Specific string and field number
echo '<tr>';
echo '<td class="datos2">'.lang_string ("Key string");
echo '<td class="datos2">'.__('Key string');
pandora_help("wmikey");
echo "</td>";
echo '<td class="datos2"><input type="text" name="form_snmp_community" size="20" value="'.$form_snmp_community.'"></td>';
echo '<td class="datos2">'.lang_string ("Field number");
echo '<td class="datos2">'.__('Field number');
pandora_help("wmifield");
echo "</td>";
echo '<td class="datos2"><input type="text" name="form_tcp_port" size="3" value="'.$form_tcp_port.'"></td>';
@ -154,16 +154,16 @@ echo '</tr>';
// username / password
echo '<tr>';
echo '<td class="datos2">'.lang_string ("Username")."</td>";
echo '<td class="datos2">'.__('Username')."</td>";
echo '<td class="datos2"><input type="text" name="form_plugin_user" size="10" value="'.$form_plugin_user.'"></td>';
echo '<td class="datos2">'.lang_string ("Password")."</td>";
echo '<td class="datos2">'.__('Password')."</td>";
echo '<td class="datos2"><input type="password" name="form_plugin_pass" size="10" value="'.$form_plugin_pass.'"></td>';
echo '</tr>';
// module type / max timeout
echo '</tr><tr>';
echo '<td class="datos">'.$lang_label["module_type"];
echo '<td class="datos">'.__('module_type');
pandora_help("module_type");
echo '</td>';
echo '<td class="datos">';
@ -183,14 +183,14 @@ if ($update_module_id != NULL){
echo '</select>';
}
echo '<td class="datos">'.lang_string ("max_timeout")."</td>";
echo '<td class="datos">'.__('max_timeout')."</td>";
echo '<td class="datos"><input type="text" name="form_max_timeout" size="5" value="'.$form_max_timeout.'"></td></tr>';
// Interval & id_module_group
echo '<tr>';
echo '<td class="datos2">'.lang_string ("interval")."</td>";
echo '<td class="datos2">'.__('interval')."</td>";
echo '<td class="datos2"><input type="text" name="form_interval" size="5" value="'.$form_interval.'"></td>';
echo '<td class="datos2">'.lang_string ("module_group")."</td>";
echo '<td class="datos2">'.__('module_group')."</td>";
echo '<td class="datos2">';
echo '<select name="form_id_module_group">';
if ($form_id_module_group != 0){
@ -205,24 +205,24 @@ echo '</select>';
// Max / min value
echo '<tr>';
echo '<td class="datos">'.lang_string ("min_value")."</td>";
echo '<td class="datos">'.__('min_value')."</td>";
echo '<td class="datos"><input type="text" name="form_minvalue" size="5" value="'.$form_minvalue.'"></td>';
echo '<td class="datos">'.lang_string ("max_value")."</td>";
echo '<td class="datos">'.__('max_value')."</td>";
echo '<td class="datos"><input type="text" name="form_maxvalue" size="5" value="'.$form_maxvalue.'"></td>';
echo '</tr>';
// Post process / Export server
echo '<tr>';
echo '<td class="datos2">'.lang_string ("post_process");
echo '<td class="datos2">'.__('post_process');
pandora_help("postprocess");
echo '</td>';
echo '<td class="datos2"><input type="text" name="form_post_process" size="5" value="'.$form_post_process.'"></td>';
echo '<td class="datos2">'.lang_string ("export_server")."</td>";
echo '<td class="datos2">'.__('export_server')."</td>";
echo '<td class="datos2"><select name="form_id_export">';
if ($form_id_export != 0){
echo "<option value='".$form_id_export."'>".dame_nombre_servidorexportacion($form_id_export)."</option>";
}
echo "<option value='0'>".lang_string("None")."</option>";
echo "<option value='0'>".__('None')."</option>";
$sql1='SELECT id, name FROM tserver_export ORDER BY name;';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
@ -233,7 +233,7 @@ echo '</tr>';
// Description
echo '<tr>';
echo '<td valign="top" class="datos">'.lang_string ("description")."</td>";
echo '<td valign="top" class="datos">'.__('description')."</td>";
echo '<td valign="top" class="datos" colspan="3"><textarea name="form_description" cols="65" rows="2">'.$form_description.'</textarea>';
echo '</tr>';
echo '</table>';
@ -242,9 +242,9 @@ echo '</table>';
echo '<table width="680" cellpadding="4" cellspacing="4">';
echo '<td valign="top" align="right">';
if ($update_module_id == NULL){
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.lang_string ("create").'">';
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.__('create').'">';
} else {
echo '<input name="updbutton" type="submit" class="sub wand" value="'.lang_string ("update").'">';
echo '<input name="updbutton" type="submit" class="sub wand" value="'.__('update').'">';
}
echo '</table>';

View File

@ -2,6 +2,7 @@
// Pandora FMS - the Flexible Monitoring System
// ========================================
// Copyright (c) 2008 Evi Vanoost <vanooste@rcbi.rochester.edu>
// Copyright (c) 2008 Esteban Sanchez <estebans@artica.es>
// Please see http://pandora.sourceforge.net for full contribution list
// This program is free software; you can redistribute it and/or
@ -15,201 +16,186 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/*
Database schema:
CREATE TABLE `pandora`.`tplanned_downtime` (
`id` MEDIUMINT( 8 ) NOT NULL AUTO_INCREMENT ,
`name` VARCHAR( 100 ) NOT NULL ,
`description` TEXT NOT NULL ,
`start` INT NOT NULL ,
`end` INT NOT NULL ,
`module_id` BIGINT( 14 ) NOT NULL ,
PRIMARY KEY ( `id` ) ,
INDEX ( `start` , `end` , `module_id` ) ,
UNIQUE (
`id`
)
) ENGINE = INNODB
*/
//ACL
// Load global vars
require("include/config.php");
if (give_acl($id_user, 0, "AW")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access downtime scheduler");
require ("general/noaccess.php");
exit;
};
function generate_options ($start, $number, $default = false) {
for($i=$start; $i<$start+$number; $i++) {
$val = str_pad($i,2,0,STR_PAD_LEFT);
echo '<option value="'.$val.'"';
if($val == $default) {
echo ' selected="selected"';
}
echo '>'.$val.'</option>';
}
check_login();
if (! give_acl ($config['id_user'], 0, "AW")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access downtime scheduler");
require ("general/noaccess.php");
return;
}
//Initialize data
$id_agente = get_parameter ("id_agente");
$modules = get_modules_in_agent ($id_agente);
$from_year = date("Y");
$from_month = date("m");
$from_day = date("d");
$to_year = date("Y");
$to_month = date("m");
$to_day = date("d");
$id_agent = get_parameter ("id_agent");
$modules = get_modules_in_agent ($id_agent);
$name = '';
$description = '';
$date_from = (string) get_parameter ('date_from', date ('Y-m-j'));
$time_from = (string) get_parameter ('time_from', date ('h:iA'));
$date_to = (string) get_parameter ('date_to', date ('Y-m-j'));
$time_to = (string) get_parameter ('time_to', date ('h:iA'));
$create_downtime = (int) get_parameter ('create_downtime');
$delete_downtime = (int) get_parameter ('delete_downtime');
$edit_downtime = (int) get_parameter ('edit_downtime');
$update_downtime = (int) get_parameter ('update_downtime');
$id_downtime = (int) get_parameter ('id_downtime');
//Here cometh the parsing of the entered form
if(isset ($_GET["delete"])) {
$sql = sprintf ("DELETE FROM tplanned_downtime WHERE id = %d",$_GET["delete"]);
if ($delete_downtime) {
$sql = sprintf ("DELETE FROM tplanned_downtime WHERE id = %d",
$id_downtime);
echo $sql;
$result = process_sql ($sql);
if ($result === false) {
echo '<h3 class="error">'.lang_string ("delete_no").'</h3>';
echo '<h3 class="error">'.__('delete_no').'</h3>';
} else {
echo '<h3 class="suc">'.lang_string ("delete_ok").'</h3>';
}
} elseif(isset ($_POST["crtbutton"])) {
$post_name = get_parameter_post ("downtime_name");
$post_description = get_parameter_post ("downtime_description");
$post_module_id = (int) get_parameter_post ("downtime_module_id");
$post_from_year = (int) get_parameter_post ("from_year");
$post_from_month = (int) get_parameter_post ("from_month");
$post_from_day = (int) get_parameter_post ("from_day");
$post_time_from = explode (":",get_parameter_post ("time_from"));
$post_to_year = (int) get_parameter_post ("to_year");
$post_to_month = (int) get_parameter_post ("to_month");
$post_to_day = (int) get_parameter_post ("to_day");
$post_time_to = explode (":",get_parameter_post ("time_to"));
$start = mktime ($post_time_from[0],$post_time_from[1],00,$post_from_month,$post_from_day,$post_from_year);
$end = mktime ($post_time_to[0],$post_time_to[1],00,$post_to_month,$post_to_day,$post_to_year);
//make it a unixtime for easy storing/retrieving (int)
if($start > $end) {
echo '<h3 class="error">'.lang_string ("create_no").': START &gt; END</h3>';
} else {
if($_POST["crtbutton"] == "Add") {
$sql = sprintf ("INSERT INTO tplanned_downtime (`name`, `description`, `start`, `end`, `module_id`)
VALUES ('%s','%s',%d,%d,%d)",$post_name,$post_description,$start,$end,$post_module_id);
} elseif ($_POST["crtbutton"] == "Update") {
$upd_id = (int) get_parameter_post ("update_id");
$sql = sprintf ("UPDATE tplanned_downtime
SET `name`='%s', `description`='%s', `start`=%d, `end`=%d, `module_id`=%d
WHERE `id` = '%d'",$post_name,$post_description,$start,$end,$post_module_id,$upd_id);
} else {
die("Unspecified crtbutton");
}
echo '<h3 class="suc">'.__('delete_ok').'</h3>';
}
}
if ($create_downtime || $update_downtime) {
$description = (string) get_parameter ('description');
$name = (string) get_parameter ('name');
$id_module = (int) get_parameter ('id_agent_module');
$datetime_from = strtotime ($date_from.' '.$time_from);
$datetime_to = strtotime ($date_to.' '.$time_to);
echo $datetime_from.' > '.$datetime_to;
if ($datetime_from > $datetime_to) {
echo '<h3 class="error">'.__('create_no').': START &gt; END</h3>';
} else {
$sql = '';
if ($create_downtime) {
$sql = sprintf ("INSERT INTO tplanned_downtime (`name`,
`description`, `date_from`, `date_to`, `id_agent_module`)
VALUES ('%s','%s',%d,%d,%d)",
$name, $description, $datetime_from,
$datetime_to, $id_module);
} else if ($update_downtime) {
$sql = sprintf ("UPDATE tplanned_downtime
SET `name`='%s', `description`='%s', `date_from`=%d,
`date_to`=%d, `id_agent_module`=%d
WHERE `id` = '%d'",
$name, $description, $datetime_from,
$datetime_to, $id_module, $id_downtime);
}
$result = process_sql ($sql);
if ($result === false) {
echo '<h3 class="error">'.lang_string ("create_no").'</h3>';
echo '<h3 class="error">'.__('create_no').'</h3>';
} else {
echo '<h3 class="suc">'.lang_string ("create_ok").'</h3>';
echo '<h3 class="suc">'.__('create_ok').'</h3>';
}
}
} elseif (isset ($_GET["update"])) {
$sql = sprintf ("SELECT `id`, `name`, `description`, `start`, `end`, `module_id` FROM `tplanned_downtime` WHERE `id` = %d",$_GET["update"]);
}
if ($id_downtime) {
$sql = sprintf ("SELECT `id`, `name`, `description`, `date_from`, `date_to`, `id_agent_module`
FROM `tplanned_downtime` WHERE `id` = %d",
$id_downtime);
$result = get_db_row_sql ($sql);
$name = $result["name"];
$description = $result["description"];
$module_id = $result["module_id"];
$start = $result["start"];
$end = $result["end"];
$from_year = date("Y",$start);
$from_month = date("m",$start);
$from_day = date("d",$start);
$to_year = date("Y",$end);
$to_month = date("m",$end);
$to_day = date("d",$end);
$time_from = date("H:i",$start);
$time_to = date("H:i",$end);
$id_agent_module = $result["id_agent_module"];
$date_from = strftime ('%Y-%m-%d', $result["date_from"]);
$date_to = strftime ('%Y-%m-%d', $result["date_to"]);
}
//---
//Page header
echo '<h3>'.lang_string ("Planned Downtime Form").' <img class="img_help" src="images/help.png" onClick="pandora_help(\'planned_downtime\')" /></h3>';
echo '<h3>'.__('Planned Downtime Form').' <img class="img_help" src="images/help.png" onClick="pandora_help(\'planned_downtime\')" /></h3>';
//Table header
echo '<form name="planned_downtime" method="POST" action="index.php?sec=gagente&sec2=godmode/agentes/planned_downtime&id_agente='.$id_agente.'">
<table width="650" cellpadding="4" cellspacing="4" class="databox_color" border="0">
<tr><td class="datos3">'.lang_string ("name").':</td><td class="datos3"><input type="text" name="downtime_name" value="'.(isset($name) ? $name : '').'" /></td>
<td class="datos3">'.lang_string ("modules").'</td><td class="datos3">';
$table->class = 'databox_color';
$table->width = '90%';
$table->data = array ();
$table->data[0][0] = __('Name');
$table->data[0][1] = print_input_text ('name', $name, '', 25, 40, true);
$table->data[1][0] = __('Module');
$table->data[1][1] = print_input_text ('name', $name, '', 25, 40, true);
$table->data[2][0] = __('Description');
$table->data[2][1] = print_textarea ('description', 2, 60, $description, '', true);
$table->data[3][0] = __('Time from');
$table->data[3][1] = print_input_text ('date_from', $date_from, '', 10, 10, true);
$table->data[3][1] .= print_input_text ('time_from', $time_from, '', 7, 7, true);
$table->data[4][0] = __('Time to');
$table->data[4][1] = print_input_text ('date_from', $date_from, '', 10, 10, true);
$table->data[4][1] .= print_input_text ('time_to', $time_to, '', 7, 7, true);
//Select modules
echo '<select name="downtime_module_id">';
if (isset ($module_id)) {
echo '<option value="'.$module_id.'">'.dame_nombre_modulo_agentemodulo ($module_id).'</option>';
}
foreach ($modules as $module) {
echo '<option value="'.$module["id_agente_modulo"].'">'.$module["nombre"].'</option>';
}
echo '</select></td></tr>';
//Description
echo '<tr><td class="datos">'.lang_string ("description").':</td>
<td colspan="3" class="datos"><textarea name="downtime_description" rows="2" cols="60">'.(isset($description) ? $description : '').'</textarea></td></tr>
<tr><td class="datos">'.lang_string ("time_from").':</td><td class="datos"><select name="from_year">';
generate_options ($from_year, 5);
echo '</select><select name="from_month">';
generate_options (1, 12, $from_month);
echo '</select><select name="from_day">';
generate_options (1, 31, $from_day);
echo '</select><select name="time_from">';
if(isset ($time_from)) {
echo '<option value="'.$time_from.'">'.$time_from.'</option>';
}
for ($a=0; $a < 48; $a++){
echo '<option value="'.render_time ($a).'">'.render_time ($a).'</option>';
}
echo '<option value="23:59">23:59</select>
</td>
<td class="datos">'.lang_string ("time_to").':</td><td class="datos"><select name="to_year">';
generate_options ($to_year, 5);
echo '</select><select name="to_month">';
generate_options (1, 12, $to_month);
echo '</select><select name="to_day">';
generate_options (1, 31, $to_day);
echo '</select><select name="time_to">';
if(isset ($time_to)) {
echo '<option value="'.$time_to.'">'.$time_to.'</option>';
}
echo '<option value="23:59">23:59</option>';
for ($a=0; $a < 48; $a++){
echo '<option value="'.render_time ($a).'">'.render_time ($a).'</option>';
}
echo '</select></td></tr><tr><td colspan="4" align="right">';
if (!isset ($_GET["update"])) {
echo '<input name="crtbutton" type="submit" value="Add" class="sub wand" />';
echo '<form method="POST" action="index.php?sec=gagente&sec2=godmode/agentes/planned_downtime">';
print_table ($table);
print_input_hidden ('id_agent', $id_agent);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
if ($id_downtime) {
print_input_hidden ('update_downtime', 1);
print_input_hidden ('id_downtime', $id_downtime);
print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"');
} else {
echo '<input name="crtbutton" type="submit" value="Update" class="sub upd" />
<input name="update_id" type="hidden" value="'.$_GET["update"].'" />';
print_input_hidden ('create_downtime', 1);
print_submit_button (__('Add'), 'crtbutton', false, 'class="sub wand"');
}
//Finish form table
echo '</td></tr></table></form>';
echo '</div>';
echo '</form>';
//Start Overview of existing planned downtime
echo '<h3>'.lang_string ("Planned Downtime").':</h3>';
echo '<table width="650" cellpadding="4" cellspacing="4" class="databox" border="0">
<tr><th>'.lang_string ("name").':</th><th>'.lang_string ("module").':</th>
<th>'.lang_string ("time_from").':</th><th>'.lang_string ("time_to").':</th><th></th></tr>';
$sql = sprintf ("SELECT tplanned_downtime.id, tplanned_downtime.name, tplanned_downtime.module_id, tplanned_downtime.start, tplanned_downtime.end
FROM tplanned_downtime, tagente_modulo WHERE tplanned_downtime.module_id = tagente_modulo.id_agente_modulo
AND tagente_modulo.id_agente = %d AND end > UNIX_TIMESTAMP(NOW())",$id_agente);
$result = get_db_all_rows_sql ($sql);
if ($result === false) {
echo '<tr><td colspan="5">'.lang_string ("No planned downtime").'</td></tr>';
$result = array();
echo '<h3>'.__('Planned Downtime').':</h3>';
$table->width = '90%';
$table->data = array ();
$table->head = array ();
$table->head[0] = __('name');
$table->head[1] = __('module');
$table->head[2] = __('time_from');
$table->head[3] = __('time_to');
$sql = sprintf ("SELECT tplanned_downtime.id, tplanned_downtime.name, tplanned_downtime.id_agent_module, tplanned_downtime.date_from, tplanned_downtime.date_to
FROM tplanned_downtime, tagente_modulo WHERE tplanned_downtime.id_agent_module = tagente_modulo.id_agente_modulo
AND tagente_modulo.id_agente = %d AND date_to > UNIX_TIMESTAMP(NOW())", $id_agent);
$downtimes = get_db_all_rows_sql ($sql);
if ($downtimes === false) {
$table->colspan[0][0] = 5;
$table->data[0][0] = __('No planned downtime');
$downtimes = array();
}
foreach($result as $row) {
echo '<tr><td>'.$row['name'].'</td><td>'.dame_nombre_modulo_agentemodulo ($row['module_id']).'</td>
<td>'.date ("Y-m-d H:i",$row['start']).'</td><td>'.date ("Y-m-d H:i",$row['end']).'</td>
<td><a href="index.php?sec=gagente&sec2=godmode/agentes/planned_downtime&id_agente='.$id_agente.'&delete='.$row['id'].'">
<img src="images/cross.png" border="0" alt="'.lang_string ("delete").'"></a>
<a href="index.php?sec=gagente&sec2=godmode/agentes/planned_downtime&id_agente='.$id_agente.'&update='.$row['id'].'">
<img src="images/config.png" border="0" alt="Update"></a></td></tr>';
foreach ($downtimes as $downtime) {
$data = array ();
$data[0] = $downtime['name'];
$data[1] = dame_nombre_modulo_agentemodulo ($downtime['id_agent_module']);
$data[2] = date ("Y-m-d H:i", $downtime['date_from']);
$data[3] = date ("Y-m-d H:i", $downtime['date_to']);
$data[4] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/planned_downtime&id_agent='.
$id_agent.'&delete_downtime=1&id_downtime='.$downtime['id'].'">
<img src="images/cross.png" border="0" alt="'.__('delete').'"></a>';
$data[4] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/planned_downtime&id_agent='.
$id_agent.'&edit_downtime=1&id_downtime='.$downtime['id'].'">
<img src="images/config.png" border="0" alt="'.__('Update').'"></a>';
array_push ($table->data, $data);
}
echo '</table>';
print_table ($table);
?>
<link rel="stylesheet" href="include/styles/datepicker.css" type="text/css" media="screen">
<link rel="stylesheet" href="include/styles/timeentry.css" type="text/css" media="screen">
<script type="text/javascript" src="include/javascript/jquery.js"></script>
<script src="include/javascript/jquery.ui.core.js"></script>
<script src="include/javascript/jquery.ui.datepicker.js"></script>
<script src="include/languages/date_<?= $config['language'] ?>.js"></script>
<script src="include/languages/time_<?= $config['language'] ?>.js"></script>
<script src="include/javascript/jquery.timeentry.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready (function () {
$("#text-time_from, #text-time_to").timeEntry ({
spinnerImage: 'images/time-entry.png',
spinnerSize: [20, 20, 0]
});
$("#text-date_from, #text-date_to").datepicker ();
$.datepicker.regional["<?= $config['language'] ?>"];
});
</script>

View File

@ -22,9 +22,18 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global vars
require("include/config.php");
if ( (give_acl($id_user, 0, "LM")==1)){
require ("include/config.php");
check_login ();
if (! give_acl ($config['id_user'], 0, "LM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Alert Management");
require ("general/noaccess.php");
return;
}
// Var init
$descripcion = "";
$nombre = "";
@ -40,7 +49,7 @@ if ( (give_acl($id_user, 0, "LM")==1)){
$comando = $row["comando"];
} else
{
echo "<h3 class='error'>".$lang_label["alert_error"]."</h3>";
echo "<h3 class='error'>".__('alert_error')."</h3>";
echo "</table>";
include ("general/footer.php");
exit;
@ -52,12 +61,12 @@ if ( (give_acl($id_user, 0, "LM")==1)){
$creacion_alerta = 1;
}
echo "<h2>".$lang_label["alert_config"]." &gt; ";
echo "<h2>".__('alert_config')." &gt; ";
if (isset($_GET["creacion"])){
echo $lang_label["create_alert"];
echo __('create_alert');
}
if (isset($_GET["id_alerta"])){
echo $lang_label["mod_alert"];
echo __('mod_alert');
}
pandora_help ("manage_alerts");
echo "</h2>";
@ -73,16 +82,16 @@ echo "</h2>";
}
?>
<table width="500" cellspacing="4" cellpadding="4" class="databox_color">
<tr><td class="datos"><?php echo $lang_label["alertname"] ?></td>
<tr><td class="datos"><?php echo __('alertname') ?></td>
<td class="datos">
<input type="text" name="nombre" size=30 value="<?php echo $nombre ?>"></td>
</tr>
<tr>
<td class="datos2"><?php echo $lang_label["command"] ?></td>
<td class="datos2"><?php echo __('command') ?></td>
<td class="datos2">
<input type="text" name="comando" size="50" value="<?php echo $comando ?>">
</td></tr>
<tr><td class="datos"><?php echo $lang_label["description"] ?></td>
<tr><td class="datos"><?php echo __('description') ?></td>
<td class="datos"><textarea name="descripcion" cols="50" rows="7">
<?php echo $descripcion ?>
</textarea>
@ -92,18 +101,10 @@ echo "</h2>";
<tr><td align="right">
<?php
if (isset($_GET["creacion"])){
echo "<input name='crtbutton' type='submit' class='sub wand' value='".$lang_label["create"]."'>";
echo "<input name='crtbutton' type='submit' class='sub wand' value='".__('create')."'>";
} else {
echo "<input name='uptbutton' type='submit' class='sub upd' value='".$lang_label["update"]."'>";
echo "<input name='uptbutton' type='submit' class='sub upd' value='".__('update')."'>";
} ?>
</form>
</table>
<?php
} // end page
else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Alert Management");
require ("general/noaccess.php");
}
?>

View File

@ -6,95 +6,96 @@
// Raul Mateos <raulofpandora@gmail.com>, 2005-2007
// Load global vars
require("include/config.php");
require ("include/config.php");
if ( (give_acl($id_user, 0, "LM")==1)){
if (isset($_POST["update_alerta"])){ // if modified any parameter
$id_alerta = entrada_limpia($_POST["id_alerta"]);
if ($id_alerta < 4){
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Alert Management");
require ("general/noaccess.php");
}
$nombre = entrada_limpia($_POST["nombre"]);
$comando = entrada_limpia($_POST["comando"]);
$descripcion= entrada_limpia($_POST["descripcion"]);
$sql_update ="UPDATE talerta SET nombre = '".$nombre."', comando = '".$comando."', descripcion = '".$descripcion."' WHERE id_alerta= '".$id_alerta."'";
$result=mysql_query($sql_update);
if (! $result) {
echo "<h3 class='error'>".$lang_label["update_alert_no"]."</h3>";
} else {
echo "<h3 class='suc'>".$lang_label["update_alert_ok"]."</h3>";
}
}
check_login ();
if (isset($_POST["crear_alerta"])){ // if create alert
$nombre = entrada_limpia($_POST["nombre"]);
$comando = entrada_limpia($_POST["comando"]);
$descripcion= entrada_limpia($_POST["descripcion"]);
$sql_update ="INSERT talerta (nombre, comando, descripcion) VALUES ('".$nombre."', '".$comando."', '".$descripcion."')";
$result=mysql_query($sql_update);
if (! $result)
echo "<h3 class='error'>".$lang_label["create_alert_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["create_alert_ok"]."</h3>";
}
if (isset($_GET["borrar_alerta"])){ // if delete alert
$id_alerta = entrada_limpia($_GET["borrar_alerta"]);
if ($id_alerta < 4){
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Alert Management");
require ("general/noaccess.php");
}
$sql_delete= "DELETE FROM talerta WHERE id_alerta = ".$id_alerta;
$result=mysql_query($sql_delete);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_alert_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_alert_ok"]."</h3>";
$sql_delete2 ="DELETE FROM talerta_agente_modulo WHERE id_alerta = ".$id_alerta;
$result=mysql_query($sql_delete2);
}
echo "<h2>".$lang_label["alert_config"]." &gt; ";
echo $lang_label["alert_defined2"]."</h2>";
echo "<table width='500' cellpadding='4' cellspacing='4' class='databox'>";
echo "<th width='100px'>".$lang_label["alertname"]."</th>";
echo "<th>".$lang_label["description"]."</th>";
echo "<th>".$lang_label["delete"]."</th>";
$color=1;
$sql1='SELECT * FROM talerta';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
if ($row[0] > 4){
echo "<tr><td class='$tdcolor'><b><a href='index.php?sec=galertas&sec2=godmode/alerts/configure_alert&id_alerta=".$row["id_alerta"]."'>".$row["nombre"]."</a></b></td>";
echo "<td class='$tdcolor'>".$row["descripcion"]."</td>";
echo "<td class='$tdcolor' align='center'><a href='index.php?sec=gagente&sec2=godmode/alerts/modify_alert&borrar_alerta=".$row["id_alerta"]."' onClick='if (!confirm(\' ".$lang_label["are_you_sure"]."\')) return false;'><img border='0' src='images/cross.png'></a></td>";
} else {
echo "<tr><td class='$tdcolor'><b>".$row["nombre"]."</b></td>";
echo "<td class='$tdcolor'>".$row["descripcion"]."</td>";
}
}
echo "</tr></table>";
echo "<table width=500>";
echo "<tr><td align='right'>";
echo "<form method=post action='index.php?sec=galertas&sec2=godmode/alerts/configure_alert&creacion=1'>";
echo "<input type='submit' class='sub next' name='crt' value='".$lang_label["create_alert"]."'>";
echo "</form>";
echo "</td></tr></table>";
} // End page
else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Alert Management");
if (! give_acl ($config['id_user'], 0, "LM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Alert Management");
require ("general/noaccess.php");
return;
}
if (isset($_POST["update_alerta"])){ // if modified any parameter
$id_alerta = entrada_limpia($_POST["id_alerta"]);
if ($id_alerta < 4){
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access Alert Management");
require ("general/noaccess.php");
}
$nombre = entrada_limpia($_POST["nombre"]);
$comando = entrada_limpia($_POST["comando"]);
$descripcion= entrada_limpia($_POST["descripcion"]);
$sql_update ="UPDATE talerta SET nombre = '".$nombre."', comando = '".$comando."', descripcion = '".$descripcion."' WHERE id_alerta= '".$id_alerta."'";
$result=mysql_query($sql_update);
if (! $result) {
echo "<h3 class='error'>".__('update_alert_no')."</h3>";
} else {
echo "<h3 class='suc'>".__('update_alert_ok')."</h3>";
}
}
if (isset($_POST["crear_alerta"])){ // if create alert
$nombre = entrada_limpia($_POST["nombre"]);
$comando = entrada_limpia($_POST["comando"]);
$descripcion= entrada_limpia($_POST["descripcion"]);
$sql_update ="INSERT talerta (nombre, comando, descripcion) VALUES ('".$nombre."', '".$comando."', '".$descripcion."')";
$result=mysql_query($sql_update);
if (! $result)
echo "<h3 class='error'>".__('create_alert_no')."</h3>";
else
echo "<h3 class='suc'>".__('create_alert_ok')."</h3>";
}
if (isset($_GET["borrar_alerta"])){ // if delete alert
$id_alerta = entrada_limpia($_GET["borrar_alerta"]);
if ($id_alerta < 4) {
audit_db ($config['id_user'],$REMOTE_ADDR, "ACL Violation","Trying to access Alert Management");
require ("general/noaccess.php");
}
$sql_delete= "DELETE FROM talerta WHERE id_alerta = ".$id_alerta;
$result=mysql_query($sql_delete);
if (! $result)
echo "<h3 class='error'>".__('delete_alert_no')."</h3>";
else
echo "<h3 class='suc'>".__('delete_alert_ok')."</h3>";
$sql_delete2 ="DELETE FROM talerta_agente_modulo WHERE id_alerta = ".$id_alerta;
$result=mysql_query($sql_delete2);
}
echo "<h2>".__('alert_config')." &gt; ";
echo __('alert_defined2')."</h2>";
echo "<table width='500' cellpadding='4' cellspacing='4' class='databox'>";
echo "<th width='100px'>".__('alertname')."</th>";
echo "<th>".__('description')."</th>";
echo "<th>".__('delete')."</th>";
$color=1;
$sql1='SELECT * FROM talerta';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
if ($row[0] > 4){
echo "<tr><td class='$tdcolor'><b><a href='index.php?sec=galertas&sec2=godmode/alerts/configure_alert&id_alerta=".$row["id_alerta"]."'>".$row["nombre"]."</a></b></td>";
echo "<td class='$tdcolor'>".$row["descripcion"]."</td>";
echo "<td class='$tdcolor' align='center'><a href='index.php?sec=gagente&sec2=godmode/alerts/modify_alert&borrar_alerta=".$row["id_alerta"]."' onClick='if (!confirm(\' ".__('are_you_sure')."\')) return false;'><img border='0' src='images/cross.png'></a></td>";
} else {
echo "<tr><td class='$tdcolor'><b>".$row["nombre"]."</b></td>";
echo "<td class='$tdcolor'>".$row["descripcion"]."</td>";
}
}
echo "</tr></table>";
echo "<table width=500>";
echo "<tr><td align='right'>";
echo "<form method=post action='index.php?sec=galertas&sec2=godmode/alerts/configure_alert&creacion=1'>";
echo "<input type='submit' class='sub next' name='crt' value='".__('create_alert')."'>";
echo "</form>";
echo "</td></tr></table>";
?>

View File

@ -19,79 +19,78 @@
// Load global vars
require_once ("include/config.php");
check_login ();
if ((give_acl ($id_user, 0, "DM")==1) or (dame_admin ($id_user)==1)) {
// Todo for a good DB maintenance
/*
- Delete too on datos_string and and datos_inc tables
- A function to "compress" data, and interpolate big chunks of data (1 month - 60000 registers)
onto a small chunk of interpolated data (1 month - 600 registers)
- A more powerful selection (by Agent, by Module, etc).
*/
require("godmode/db/times_incl.php");
$datos_rango3=0;
$datos_rango2=0;
$datos_rango1=0;
# ADQUIRE DATA PASSED AS FORM PARAMETERS
# ======================================
# Purge data using dates
# Purge data using dates
if (isset($_POST["purgedb"])){ # Fixed 2005-1-13, nil
$from_date = get_parameter_post("date_purge");
$query = sprintf("DELETE FROM `tsesion` WHERE `fecha` < '%s';",$from_date);
(int) $deleted = process_sql($query);
}
# End of get parameters block
echo "<h2>".$lang_label["dbmain_title"]." &gt; ";
echo $lang_label["db_purge_audit"]."</h2>";
echo "<table cellpadding='4' cellspacing='4' class='databox'>";
echo "<tr><td class='datos'>";
$result = get_db_row_sql ("SELECT COUNT(*) AS total, MIN(fecha) AS first_date, MAX(fecha) AS latest_date FROM tsesion");
echo "<b>".$lang_label["total"]."</b></td>";
echo "<td class='datos'>".$result["total"]." ".$lang_label["records"]."</td>";
echo "<tr>";
echo "<td class='datos2'><b>".$lang_label["first_date"]."</b></td>";
echo "<td class='datos2'>".$result["first_date"]."</td></tr>";
echo "<tr><td class='datos'>";
echo "<b>".$lang_label["latest_date"]."</b></td>";
echo "<td class='datos'>".$result["latest_date"]."</td>";
echo "</tr></table>";
?>
<h3><?php echo $lang_label["purge_data"] ?></h3>
<form name="db_audit" method="post" action="index.php?sec=gdbman&sec2=godmode/db/db_audit">
<table width='300' cellpadding='4' cellspacing='4' class='databox'>
<tr><td class='datos'>
<select name="date_purge" width="255px">
<option value="<?php echo $month3 ?>"><?php echo $lang_label["purge_audit_90day"] ?>
<option value="<?php echo $month ?>"><?php echo $lang_label["purge_audit_30day"] ?>
<option value="<?php echo $week2 ?>"><?php echo $lang_label["purge_audit_14day"] ?>
<option value="<?php echo $week ?>"><?php echo $lang_label["purge_audit_7day"] ?>
<option value="<?php echo $d3 ?>"><?php echo $lang_label["purge_audit_3day"] ?>
<option value="<?php echo $d1 ?>"><?php echo $lang_label["purge_audit_1day"] ?>
<option value="<?php echo $all_data ?>"><?php echo $lang_label["purge_audit_all"] ?>
</select>
<td class="datos">
<input class="sub wand" type="submit" name="purgedb" value="<?php echo $lang_label["doit"] ?>" onClick="if (!confirm('<?php echo $lang_label["are_you_sure"] ?>')) return false;">
</table>
</form>
<?php
} else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Database Management Audit");
if (! give_acl ($config['id_user'], 0, "DM")) {
audit_db ($config['id_user'],$REMOTE_ADDR, "ACL Violation",
"Trying to access Database Management Audit");
require ("general/noaccess.php");
return;
}
// Todo for a good DB maintenance
/*
- Delete too on datos_string and and datos_inc tables
- A function to "compress" data, and interpolate big chunks of data (1 month - 60000 registers)
onto a small chunk of interpolated data (1 month - 600 registers)
- A more powerful selection (by Agent, by Module, etc).
*/
require("godmode/db/times_incl.php");
$datos_rango3=0;
$datos_rango2=0;
$datos_rango1=0;
# ADQUIRE DATA PASSED AS FORM PARAMETERS
# ======================================
# Purge data using dates
# Purge data using dates
if (isset($_POST["purgedb"])){ # Fixed 2005-1-13, nil
$from_date = get_parameter_post("date_purge");
$query = sprintf("DELETE FROM `tsesion` WHERE `fecha` < '%s';",$from_date);
(int) $deleted = process_sql($query);
}
# End of get parameters block
echo "<h2>".__('dbmain_title')." &gt; ";
echo __('db_purge_audit')."</h2>";
echo "<table cellpadding='4' cellspacing='4' class='databox'>";
echo "<tr><td class='datos'>";
$result = get_db_row_sql ("SELECT COUNT(*) AS total, MIN(fecha) AS first_date, MAX(fecha) AS latest_date FROM tsesion");
echo "<b>".__('total')."</b></td>";
echo "<td class='datos'>".$result["total"]." ".__('records')."</td>";
echo "<tr>";
echo "<td class='datos2'><b>".__('first_date')."</b></td>";
echo "<td class='datos2'>".$result["first_date"]."</td></tr>";
echo "<tr><td class='datos'>";
echo "<b>".__('latest_date')."</b></td>";
echo "<td class='datos'>".$result["latest_date"]."</td>";
echo "</tr></table>";
?>
<h3><?php echo __('purge_data') ?></h3>
<form name="db_audit" method="post" action="index.php?sec=gdbman&sec2=godmode/db/db_audit">
<table width='300' cellpadding='4' cellspacing='4' class='databox'>
<tr><td class='datos'>
<select name="date_purge" width="255px">
<option value="<?php echo $month3 ?>"><?php echo __('purge_audit_90day') ?>
<option value="<?php echo $month ?>"><?php echo __('purge_audit_30day') ?>
<option value="<?php echo $week2 ?>"><?php echo __('purge_audit_14day') ?>
<option value="<?php echo $week ?>"><?php echo __('purge_audit_7day') ?>
<option value="<?php echo $d3 ?>"><?php echo __('purge_audit_3day') ?>
<option value="<?php echo $d1 ?>"><?php echo __('purge_audit_1day') ?>
<option value="<?php echo $all_data ?>"><?php echo __('purge_audit_all') ?>
</select>
<td class="datos">
<input class="sub wand" type="submit" name="purgedb" value="<?php echo __('doit') ?>" onClick="if (!confirm('<?php echo __('are_you_sure') ?>')) return false;">
</table>
</form>

View File

@ -8,71 +8,69 @@
// Load global vars
require_once ("include/config.php");
check_login ();
if ((give_acl ($id_user, 0, "DM")==1) or (dame_admin ($id_user)==1)) {
require ("godmode/db/times_incl.php");
$datos_rango3=0;
$datos_rango2=0;
$datos_rango1=0;
# ADQUIRE DATA PASSED AS FORM PARAMETERS
# ======================================
# Purge data using dates
# Purge data using dates
if (isset ($_POST["date_purge"])){
$from_date = get_parameter_post ("date_purge");
$query = sprintf ("DELETE FROM `tevento` WHERE `timestamp` < '%s'",$from_date);
(int) $deleted = process_sql ($query);
}
# End of get parameters block
echo "<h2>".$lang_label["dbmain_title"]." &gt; ";
echo $lang_label["db_purge_event"]."</h2>";
echo "<table cellpadding='4' cellspacing='4' class='databox'>";
echo "<tr><td class='datos'>";
$row = get_db_row_sql ("SELECT COUNT(*) AS total, MIN(timestamp) AS first_date, MAX(timestamp) AS latest_date FROM tevento");
echo "<b>".$lang_label["total"]."</b>";
echo "<td class='datos'>".$row["total"]." ".$lang_label["records"]."</td>";
echo "<tr>";
echo "<td class='datos2'><b>".$lang_label["first_date"]."</b></td>";
echo "<td class='datos2'>".$row["first_date"]."</td></tr>";
echo "<tr><td class='datos'>";
echo "<b>".$lang_label["latest_date"]."</b>";
echo "<td class='datos'>".$row["latest_date"]."</td>";
echo "</table>";
?>
<h3><?php echo $lang_label["purge_data"] ?></h3>
<form name="db_audit" method="post" action="index.php?sec=gdbman&sec2=godmode/db/db_event">
<table width='300' cellpadding='4' cellspacing='4' class='databox'>
<tr><td class='datos'>
<select name="date_purge" width="255px">
<option value="<?php echo $month3 ?>"><?php echo $lang_label["purge_event_90day"] ?>
<option value="<?php echo $month ?>"><?php echo $lang_label["purge_event_30day"] ?>
<option value="<?php echo $week2 ?>"><?php echo $lang_label["purge_event_14day"] ?>
<option value="<?php echo $week ?>"><?php echo $lang_label["purge_event_7day"] ?>
<option value="<?php echo $d3 ?>"><?php echo $lang_label["purge_event_3day"] ?>
<option value="<?php echo $d1 ?>"><?php echo $lang_label["purge_event_1day"] ?>
<option value="<?php echo $all_data ?>"><?php echo $lang_label["purge_event_all"] ?>
</select>
<td class="datos">
<input class="sub wand" type="submit" name="purgedb" value="<?php echo $lang_label["doit"] ?>" onClick="if (!confirm('<?php echo $lang_label["are_you_sure"] ?>')) return false;">
</table>
</form>
<?php
} else {
audit_db ($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Database Management Event");
require ("general/noaccess.php");
if (! give_acl ($config['id_user'], 0, "DM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access Database Management Event");
require ("general/noaccess.php");
return;
}
require ("godmode/db/times_incl.php");
$datos_rango3 = 0;
$datos_rango2 = 0;
$datos_rango1 = 0;
# ADQUIRE DATA PASSED AS FORM PARAMETERS
# ======================================
# Purge data using dates
# Purge data using dates
if (isset ($_POST["date_purge"])){
$from_date = get_parameter_post ("date_purge");
$query = sprintf ("DELETE FROM `tevento` WHERE `timestamp` < '%s'",$from_date);
(int) $deleted = process_sql ($query);
}
# End of get parameters block
echo "<h2>".__('dbmain_title')." &gt; ";
echo __('db_purge_event')."</h2>";
echo "<table cellpadding='4' cellspacing='4' class='databox'>";
echo "<tr><td class='datos'>";
$row = get_db_row_sql ("SELECT COUNT(*) AS total, MIN(timestamp) AS first_date, MAX(timestamp) AS latest_date FROM tevento");
echo "<b>".__('total')."</b>";
echo "<td class='datos'>".$row["total"]." ".__('records')."</td>";
echo "<tr>";
echo "<td class='datos2'><b>".__('first_date')."</b></td>";
echo "<td class='datos2'>".$row["first_date"]."</td></tr>";
echo "<tr><td class='datos'>";
echo "<b>".__('latest_date')."</b>";
echo "<td class='datos'>".$row["latest_date"]."</td>";
echo "</table>";
?>
<h3><?php echo __('purge_data') ?></h3>
<form name="db_audit" method="post" action="index.php?sec=gdbman&sec2=godmode/db/db_event">
<table width='300' cellpadding='4' cellspacing='4' class='databox'>
<tr><td class='datos'>
<select name="date_purge" width="255px">
<option value="<?php echo $month3 ?>"><?php echo __('purge_event_90day') ?>
<option value="<?php echo $month ?>"><?php echo __('purge_event_30day') ?>
<option value="<?php echo $week2 ?>"><?php echo __('purge_event_14day') ?>
<option value="<?php echo $week ?>"><?php echo __('purge_event_7day') ?>
<option value="<?php echo $d3 ?>"><?php echo __('purge_event_3day') ?>
<option value="<?php echo $d1 ?>"><?php echo __('purge_event_1day') ?>
<option value="<?php echo $all_data ?>"><?php echo __('purge_event_all') ?>
</select>
<td class="datos">
<input class="sub wand" type="submit" name="purgedb" value="<?php echo __('doit') ?>" onClick="if (!confirm('<?php echo __('are_you_sure') ?>')) return false;">
</table>
</form>

View File

@ -8,9 +8,15 @@
// Load global vars
require_once ("include/config.php");
check_login ();
if ((give_acl ($id_user, 0, "DM")==1) or (dame_admin ($id_user)==1)) {
if (! give_acl ($config['id_user'], 0, "DM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Database Management Info");
require ("general/noaccess.php");
return;
}
// Todo for a good DB maintenance
/*
- Delete too on datos_string and and datos_inc tables
@ -20,21 +26,17 @@ if ((give_acl ($id_user, 0, "DM")==1) or (dame_admin ($id_user)==1)) {
- A more powerful selection (by Agent, by Module, etc).
*/
echo "<h2>".$lang_label["dbmain_title"]." &gt; ";
echo $lang_label["db_info2"]."</h2>";
echo "<h2>".__('dbmain_title')." &gt; ";
echo __('db_info2')."</h2>";
echo "<table border=0>";
echo "<tr><td>";
echo '<h3>'.$lang_label["db_agente_modulo"].'</h3>';
echo '<h3>'.__('db_agente_modulo').'</h3>';
echo "<img src='reporting/fgraph.php?tipo=db_agente_modulo&width=600&height=200'><br>";
echo "<tr><td><br>";
echo "<tr><td>";
echo '<h3>'.$lang_label["db_agente_paquetes"].'</h3>';
echo '<h3>'.__('db_agente_paquetes').'</h3>';
echo "<img src='reporting/fgraph.php?tipo=db_agente_paquetes&width=600&height=200'><br>";
echo "<br><br><a href='index.php?sec=gdbman&sec2=godmode/db/db_info_data'>".$lang_label["press_db_info"]."</a>";
echo "<br><br><a href='index.php?sec=gdbman&sec2=godmode/db/db_info_data'>".__('press_db_info')."</a>";
echo "</table>";
} else {
audit_db ($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Database Management Info");
require ("general/noaccess.php");
}
?>

View File

@ -20,54 +20,55 @@
require_once ("include/config.php");
check_login ();
if ((give_acl ($id_user, 0, "DM")==1) or (dame_admin ($id_user)==1)) {
// Todo for a good DB maintenance
/*
- Delete too on datos_string and and datos_inc tables
- A function to "compress" data, and interpolate big chunks of data (1 month - 60000 registers)
onto a small chunk of interpolated data (1 month - 600 registers)
- A more powerful selection (by Agent, by Module, etc).
*/
echo "<h2>".$lang_label["dbmain_title"]." &gt; ";
echo $lang_label["db_stat_agent"]."</h2>";
echo "<table cellspacing='4' cellpadding='4' class='databox'>";
echo "<tr>
<th>".$lang_label["agent_name"]."</th>";
echo "<th>".$lang_label["assigned_module"]."</th>";
echo "<th>".$lang_label["total_data"]."</th>";
$color=0;
$sql = "SELECT `id_agente`, `nombre` FROM `tagente`";
$result = get_db_all_rows_sql($sql);
foreach($result as $row2) {
$sql = sprintf("SELECT COUNT(`id_agente_modulo`) FROM `tagente_modulo` WHERE `id_agente` = '%d'",$row2["id_agente"]);
$row3c = get_db_sql($sql);
// for all data_modules belongs to an agent -- simplified, made
// faster
$sql=sprintf("SELECT COUNT(`id_agente_datos`) FROM `tagente_datos` WHERE `id_agente` = '%d'",$row2["id_agente"]);
$total_agente = get_db_sql($sql);
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo "<tr>
<td class='$tdcolor'>
<b><a href='index.php?sec=gagente&sec2=operation/agentes/ver_agente&id_agente=".$row2["id_agente"]."'>".$row2["nombre"]."</a></b></td>";
echo "<td class='$tdcolor'>".$row3c."</td>";
echo "<td class='$tdcolor'>".$total_agente."</td></tr>";
flush ();
//ob_flush();
}
echo "</table>";
} else {
audit_db ($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Database Management Info data");
if (! give_acl ($config['id_user'], 0, "DM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Database Management Info data");
require ("general/noaccess.php");
return;
}
// Todo for a good DB maintenance
/*
- Delete too on datos_string and and datos_inc tables
- A function to "compress" data, and interpolate big chunks of data (1 month - 60000 registers)
onto a small chunk of interpolated data (1 month - 600 registers)
- A more powerful selection (by Agent, by Module, etc).
*/
echo "<h2>".__('dbmain_title')." &gt; ";
echo __('db_stat_agent')."</h2>";
$table->data = array ();
$table->head = array ();
$table->head[0] = __('agent_name');
$table->head[1] = __('assigned_module');
$table->head[2] = __('total_data');
$sql = "SELECT `id_agente`, `nombre` FROM `tagente`";
$result = get_db_all_rows_sql ($sql);
foreach ($result as $agent) {
$data = array ();
$sql = sprintf("SELECT COUNT(`id_agente_modulo`)
FROM `tagente_modulo` WHERE `id_agente` = '%d'",
$agent["id_agente"]);
$assigned = get_db_sql ($sql);
// for all data_modules belongs to an agent -- simplified, made
// faster
$sql = sprintf ("SELECT COUNT(`id_agente_datos`)
FROM `tagente_datos` WHERE `id_agente` = '%d'",
$agent["id_agente"]);
$total_agente = get_db_sql ($sql);
$data[0] = '<strong><a href="index.php?sec=gagente&sec2=operation/agentes/ver_agente&id_agente='.
$agent["id_agente"].'">'.$agent["nombre"].'</a></strong>';
$data[1] = $assigned;
$data[2] = $total_agente;
array_push ($table->data, $data);
}
print_table ($table);
?>

View File

@ -17,35 +17,35 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, U
// Load global vars
global $config;
require_once ("include/config.php");
check_login ();
if ((give_acl ($id_user, 0, "DM")==1) or (dame_admin ($id_user)==1)) {
// Todo for a good DB maintenance
/*
- Delete too on datos_string and and datos_inc tables
- A function to "compress" data, and interpolate big chunks of data (1 month - 60000 registers)
onto a small chunk of interpolated data (1 month - 600 registers)
- A more powerful selection (by Agent, by Module, etc).
*/
?>
<h2><?php echo $lang_label["dbmain_title"] ?> &gt;
<?php echo $lang_label["current_dbsetup"] ?></h2>
<table width=550 cellspacing=3 cellpadding=3 border=0>
<tr><td>
<i><?php echo $lang_label["days_compact"]; ?>:</i>&nbsp;<b><?php echo $config["days_compact"]; ?></b><br><br>
<i><?php echo $lang_label["days_purge"]; ?>:</i>&nbsp;<b><?php echo $config["days_purge"]; ?></b><br><br>
<tr><td>
<div align='justify'>
<?php echo $lang_label["dbsetup_info"]; ?>
</div><br>
<img src="reporting/fgraph.php?tipo=db_agente_purge&id=-1">
</table>
<?php
} else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Database Management");
if (! give_acl ($config['id_user'], 0, "DM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Database Management");
require ("general/noaccess.php");
return;
}
// Todo for a good DB maintenance
/*
- Delete too on datos_string and and datos_inc tables
- A function to "compress" data, and interpolate big chunks of data (1 month - 60000 registers)
onto a small chunk of interpolated data (1 month - 600 registers)
- A more powerful selection (by Agent, by Module, etc).
*/
?>
<h2><?php echo __('dbmain_title') ?> &gt;
<?php echo __('current_dbsetup') ?></h2>
<table width=550 cellspacing=3 cellpadding=3 border=0>
<tr><td>
<i><?php echo __('days_compact'); ?>:</i>&nbsp;<b><?php echo __('days_compact'); ?></b><br><br>
<i><?php echo __('days_purge'); ?>:</i>&nbsp;<b><?php echo __('days_purge'); ?></b><br><br>
<tr><td>
<div align='justify'>
<?php echo __('dbsetup_info'); ?>
</div><br>
<img src="reporting/fgraph.php?tipo=db_agente_purge&id=-1">
</table>

View File

@ -16,205 +16,199 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, U
// Load global vars
global $config;
require("include/config.php");
check_login ();
$id_usuario= $_SESSION["id_usuario"];
if (! give_acl ($config['id_user'], 0, "DM")) {
audit_db($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access to Database Purge Section");
include ("general/noaccess.php");
return;
}
if (give_acl ($id_usuario, 0, "DM")==1){
if (isset ($_POST["agent"])){
$id_agent = get_parameter_post ("agent");
} else
$id_agent = -1;
if (isset ($_POST["agent"])){
$id_agent = get_parameter_post ("agent");
} else
$id_agent = -1;
echo '<h2>'.__('dbmain_title').' &gt;'.__('db_purge')."</h2>";
echo "<img src='reporting/fgraph.php?tipo=db_agente_purge&id=$id_agent'>";
echo "<br><br>";
echo '<h3>'.__('get_data_agent').'</h3>';
// All data (now)
$purge_all = date ("Y-m-d H:i:s", time ());
echo '<h2>'.$lang_label["dbmain_title"].' &gt;'.$lang_label["db_purge"]."</h2>";
echo "<img src='reporting/fgraph.php?tipo=db_agente_purge&id=$id_agent'>";
echo "<br><br>";
echo '<h3>'.$lang_label["get_data_agent"].'</h3>';
require("godmode/db/times_incl.php");
// All data (now)
$purge_all=date("Y-m-d H:i:s",time());
require("godmode/db/times_incl.php");
$datos_rango3=0;
$datos_rango2=0;
$datos_rango1=0;
$datos_rango0=0;
$datos_rango00=0;
$datos_rango11=0;
$datos_total=0;
# ADQUIRE DATA PASSED AS FORM PARAMETERS
# ======================================
# Purge data using dates
$datos_rango3=0;
$datos_rango2=0;
$datos_rango1=0;
$datos_rango0=0;
$datos_rango00=0;
$datos_rango11=0;
$datos_total=0;
# ADQUIRE DATA PASSED AS FORM PARAMETERS
# ======================================
# Purge data using dates
# Purge data using dates
if (isset($_POST["purgedb"])){
$from_date = get_parameter_post ("date_purge");
if (isset($id_agent)){
if ($id_agent != -1) {
echo $lang_label["purge_task"].$id_agent." / ".$from_date;
echo "<h3>".$lang_label["please_wait"]."<br>",$lang_label["while_delete_data"].$lang_label["agent"]."</h3>";
if ($id_agent == 0) {
$sql="SELECT * FROM tagente_modulo";
} else {
$sql=sprintf("SELECT * FROM tagente_modulo WHERE id_agente = %d",$id_agent);
}
$result=get_db_all_rows_sql($sql);
foreach ($result as $row) {
echo $lang_label["deleting_records"].dame_nombre_modulo_agentemodulo($row["id_agente_modulo"]);
flush();
//ob_flush();
echo "<br>";
$sql = sprintf("DELETE FROM `tagente_datos` WHERE `id_agente_modulo` = '%d' AND `timestamp` < '%s'",$row["id_agente_modulo"],$from_date);
process_sql ($sql);
$sql = sprintf("DELETE FROM `tagente_datos_inc` WHERE `id_agente_modulo` = '%d' AND `timestamp` < '%s'",$row["id_agente_modulo"],$from_date);
process_sql ($sql);
$sql = sprintf("DELETE FROM `tagente_datos_string` WHERE `id_agente_modulo` = '%d' AND `timestamp` < '%s'",$row["id_agente_modulo"],$from_date);
process_sql ($sql);
}
# Purge data using dates
if (isset($_POST["purgedb"])) {
$from_date = get_parameter_post ("date_purge");
if (isset($id_agent)){
if ($id_agent != -1) {
echo __('purge_task').$id_agent." / ".$from_date;
echo "<h3>".__('please_wait')."<br>",__('while_delete_data').__('agent')."</h3>";
if ($id_agent == 0) {
$sql="SELECT * FROM tagente_modulo";
} else {
echo $lang_label["deleting_records"].$lang_label["all_agents"];
$sql=sprintf("SELECT * FROM tagente_modulo WHERE id_agente = %d",$id_agent);
}
$result=get_db_all_rows_sql($sql);
foreach ($result as $row) {
echo __('deleting_records').dame_nombre_modulo_agentemodulo($row["id_agente_modulo"]);
flush();
//ob_flush();
$query = sprintf("DELETE FROM `tagente_datos` WHERE `timestamp` < '%s'",$from_date);
process_sql ($query);
$query = sprintf("DELETE FROM `tagente_datos_inc` WHERE `timestamp` < '%s'",$from_date);
process_sql ($query);
$query = sprintf("DELETE FROM `tagente_datos_string` WHERE `timestamp` < '%s'",$from_date);
process_sql ($query);
echo "<br>";
$sql = sprintf("DELETE FROM `tagente_datos` WHERE `id_agente_modulo` = '%d' AND `timestamp` < '%s'",$row["id_agente_modulo"],$from_date);
process_sql ($sql);
$sql = sprintf("DELETE FROM `tagente_datos_inc` WHERE `id_agente_modulo` = '%d' AND `timestamp` < '%s'",$row["id_agente_modulo"],$from_date);
process_sql ($sql);
$sql = sprintf("DELETE FROM `tagente_datos_string` WHERE `id_agente_modulo` = '%d' AND `timestamp` < '%s'",$row["id_agente_modulo"],$from_date);
process_sql ($sql);
}
echo "<br><br>";
} else {
echo __('deleting_records').__('all_agents');
flush();
//ob_flush();
$query = sprintf("DELETE FROM `tagente_datos` WHERE `timestamp` < '%s'",$from_date);
process_sql ($query);
$query = sprintf("DELETE FROM `tagente_datos_inc` WHERE `timestamp` < '%s'",$from_date);
process_sql ($query);
$query = sprintf("DELETE FROM `tagente_datos_string` WHERE `timestamp` < '%s'",$from_date);
process_sql ($query);
}
echo "<br><br>";
}
# Select Agent for further operations.
?>
<form action='index.php?sec=gdbman&sec2=godmode/db/db_purge' method='post'>
<table class='databox'>
<tr><td class='datos'>
<select name='agent' class='w130'>
<?php
if (isset($_POST["agent"]) and ($id_agent > 0))
echo "<option value='".$_POST["agent"]."'>".dame_nombre_agente($_POST["agent"]);
if (isset($_POST["agent"]) and ($id_agent == 0)){
echo "<option value=0>".$lang_label["all_agents"];
echo "<option value=-1>".$lang_label["choose_agent"];
} else {
echo "<option value=-1>".$lang_label["choose_agent"];
echo "<option value=0>".$lang_label["all_agents"];
}
$result_t=mysql_query("SELECT * FROM tagente");
while ($row=mysql_fetch_array($result_t)){
echo "<option value='".$row["id_agente"]."'>".$row["nombre"];
}
?>
</select>
<a href="#" class="tip">&nbsp;<span><?php echo $help_label["db_purge0"] ?></span></a>
<td><input class='sub upd' type='submit' name='purgedb_ag' value='<?php echo $lang_label["get_data"] ?>'>
<a href="#" class="tip">&nbsp;<span><?php echo $help_label["db_purge1"] ?></span></a>
</table><br>
<?php
# End of get parameters block
if (isset($_POST["agent"]) and ($id_agent !=-1)){
echo "<h3>".$lang_label["db_agent_bra"].dame_nombre_agente($id_agent).$lang_label["db_agent_ket"]."</h3>";
$sql = "SELECT id_agente_modulo FROM tagente_modulo";
if ($id_agent != 0) {
$sql .= sprintf(" WHERE id_agente = '%d'",$id_agent);
}
/*
flush();
ob_flush();
*/
$datos_rango00 += get_db_sql (sprintf("SELECT COUNT(*) FROM `tagente_datos` WHERE `id_agente_modulo` = ANY(%s) AND `timestamp` > '%s'",$sql,$d1));
$datos_rango0 += get_db_sql (sprintf("SELECT COUNT(*) FROM `tagente_datos` WHERE `id_agente_modulo` = ANY(%s) AND `timestamp` > '%s'",$sql,$d3));
$datos_rango1 += get_db_sql (sprintf("SELECT COUNT(*) FROM `tagente_datos` WHERE `id_agente_modulo` = ANY(%s) AND `timestamp` > '%s'",$sql,$week));
$datos_rango11 += get_db_sql (sprintf("SELECT COUNT(*) FROM `tagente_datos` WHERE `id_agente_modulo` = ANY(%s) AND `timestamp` > '%s'",$sql,$week2));
$datos_rango2 += get_db_sql (sprintf("SELECT COUNT(*) FROM `tagente_datos` WHERE `id_agente_modulo` = ANY(%s) AND `timestamp` > '%s'",$sql,$month));
$datos_rango3 += get_db_sql (sprintf("SELECT COUNT(*) FROM `tagente_datos` WHERE `id_agente_modulo` = ANY(%s) AND `timestamp` > '%s'",$sql,$month3));
$datos_total += get_db_sql (sprintf("SELECT COUNT(*) FROM `tagente_datos` WHERE `id_agente_modulo` = ANY(%s)",$sql));
}
?>
}
# Select Agent for further operations.
?>
<form action='index.php?sec=gdbman&sec2=godmode/db/db_purge' method='post'>
<table class='databox'>
<tr><td class='datos'>
<select name='agent' class='w130'>
<table width='300' border='0' class='databox' cellspacing='4' cellpadding='4'>
<tr><td class=datos>
<?php echo $lang_label["rango3"]?>
</td>
<td class=datos>
<?php echo $datos_rango3; ?>
</td>
<tr><td class=datos2>
<?php echo $lang_label["rango2"]?>
</td>
<td class=datos2>
<?php echo $datos_rango2; ?>
</td>
<tr><td class=datos>
<?php echo $lang_label["rango11"]?>
</td>
<td class=datos>
<?php echo $datos_rango11; ?>
</td>
<tr><td class=datos2>
<?php echo $lang_label["rango1"]?>
</td>
<td class=datos2>
<?php echo $datos_rango1; ?>
</td>
<tr><td class=datos>
<?php echo $lang_label["rango0"]?>
</td>
<td class=datos>
<?php echo $datos_rango0; ?>
</td>
<tr><td class=datos2>
<?php echo $lang_label["rango00"]?>
</td>
<td class=datos2>
<?php echo $datos_rango00; ?>
</td>
<tr><td class=datos>
<b><?php echo $lang_label["total_packets"]?></b>
</td>
<td class=datos>
<b><?php echo $datos_total; ?></b>
</td>
</tr>
</table>
<br>
<h3><?php echo $lang_label["purge_data"] ?></h3>
<table width='300' border='0' class='databox' cellspacing='4' cellpadding='4'>
<tr><td>
<select name="date_purge" width="255px">
<option value="<?php echo $month3 ?>"><?php echo $lang_label["purge_90day"] ?>
<option value="<?php echo $month ?>"><?php echo $lang_label["purge_30day"] ?>
<option value="<?php echo $week2 ?>"><?php echo $lang_label["purge_14day"] ?>
<option value="<?php echo $week ?>"><?php echo $lang_label["purge_7day"] ?>
<option value="<?php echo $d3 ?>"><?php echo $lang_label["purge_3day"] ?>
<option value="<?php echo $d1 ?>"><?php echo $lang_label["purge_1day"] ?>
</select>
<td><input class="sub wand" type="submit" name="purgedb" value="<?php echo $lang_label["doit"] ?>" onClick="if (!confirm('<?php echo $lang_label["are_you_sure"] ?>')) return false;">
</table>
</form>
<?php
if (isset($_POST["agent"]) and ($id_agent > 0))
echo "<option value='".$_POST["agent"]."'>".dame_nombre_agente($_POST["agent"]);
if (isset($_POST["agent"]) and ($id_agent == 0)){
echo "<option value=0>".__('all_agents');
echo "<option value=-1>".__('choose_agent');
} else {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access to Database Purge Section");
include ("general/noaccess.php");
echo "<option value=-1>".__('choose_agent');
echo "<option value=0>".__('all_agents');
}
$result_t=mysql_query("SELECT * FROM tagente");
while ($row=mysql_fetch_array($result_t)){
echo "<option value='".$row["id_agente"]."'>".$row["nombre"];
}
?>
</select>
<a href="#" class="tip">&nbsp;<span><?php echo $help_label["db_purge0"] ?></span></a>
<td><input class='sub upd' type='submit' name='purgedb_ag' value='<?php echo __('get_data') ?>'>
<a href="#" class="tip">&nbsp;<span><?php echo $help_label["db_purge1"] ?></span></a>
</table><br>
<?php
# End of get parameters block
if (isset($_POST["agent"]) and ($id_agent !=-1)){
echo "<h3>".__('db_agent_bra').dame_nombre_agente($id_agent).__('db_agent_ket')."</h3>";
$sql = "SELECT id_agente_modulo FROM tagente_modulo";
if ($id_agent != 0) {
$sql .= sprintf(" WHERE id_agente = '%d'",$id_agent);
}
$datos_rango00 += get_db_sql (sprintf("SELECT COUNT(*) FROM `tagente_datos` WHERE `id_agente_modulo` = ANY(%s) AND `timestamp` > '%s'",$sql,$d1));
$datos_rango0 += get_db_sql (sprintf("SELECT COUNT(*) FROM `tagente_datos` WHERE `id_agente_modulo` = ANY(%s) AND `timestamp` > '%s'",$sql,$d3));
$datos_rango1 += get_db_sql (sprintf("SELECT COUNT(*) FROM `tagente_datos` WHERE `id_agente_modulo` = ANY(%s) AND `timestamp` > '%s'",$sql,$week));
$datos_rango11 += get_db_sql (sprintf("SELECT COUNT(*) FROM `tagente_datos` WHERE `id_agente_modulo` = ANY(%s) AND `timestamp` > '%s'",$sql,$week2));
$datos_rango2 += get_db_sql (sprintf("SELECT COUNT(*) FROM `tagente_datos` WHERE `id_agente_modulo` = ANY(%s) AND `timestamp` > '%s'",$sql,$month));
$datos_rango3 += get_db_sql (sprintf("SELECT COUNT(*) FROM `tagente_datos` WHERE `id_agente_modulo` = ANY(%s) AND `timestamp` > '%s'",$sql,$month3));
$datos_total += get_db_sql (sprintf("SELECT COUNT(*) FROM `tagente_datos` WHERE `id_agente_modulo` = ANY(%s)",$sql));
}
?>
<table width='300' border='0' class='databox' cellspacing='4' cellpadding='4'>
<tr><td class=datos>
<?php echo __('rango3')?>
</td>
<td class=datos>
<?php echo $datos_rango3; ?>
</td>
<tr><td class=datos2>
<?php echo __('rango2')?>
</td>
<td class=datos2>
<?php echo $datos_rango2; ?>
</td>
<tr><td class=datos>
<?php echo __('rango11')?>
</td>
<td class=datos>
<?php echo $datos_rango11; ?>
</td>
<tr><td class=datos2>
<?php echo __('rango1')?>
</td>
<td class=datos2>
<?php echo $datos_rango1; ?>
</td>
<tr><td class=datos>
<?php echo __('rango0')?>
</td>
<td class=datos>
<?php echo $datos_rango0; ?>
</td>
<tr><td class=datos2>
<?php echo __('rango00')?>
</td>
<td class=datos2>
<?php echo $datos_rango00; ?>
</td>
<tr><td class=datos>
<b><?php echo __('total_packets')?></b>
</td>
<td class=datos>
<b><?php echo $datos_total; ?></b>
</td>
</tr>
</table>
<br>
<h3><?php echo __('purge_data') ?></h3>
<table width='300' border='0' class='databox' cellspacing='4' cellpadding='4'>
<tr><td>
<select name="date_purge" width="255px">
<option value="<?php echo $month3 ?>"><?php echo __('purge_90day') ?>
<option value="<?php echo $month ?>"><?php echo __('purge_30day') ?>
<option value="<?php echo $week2 ?>"><?php echo __('purge_14day') ?>
<option value="<?php echo $week ?>"><?php echo __('purge_7day') ?>
<option value="<?php echo $d3 ?>"><?php echo __('purge_3day') ?>
<option value="<?php echo $d1 ?>"><?php echo __('purge_1day') ?>
</select>
<td><input class="sub wand" type="submit" name="purgedb" value="<?php echo __('doit') ?>" onClick="if (!confirm('<?php echo __('are_you_sure') ?>')) return false;">
</table>
</form>

View File

@ -20,98 +20,99 @@
// Load global vars
require_once ("include/config.php");
check_login ();
$id_user = $_SESSION["id_usuario"];
if ((give_acl ($id_user, 0, "DM")==1) or (dame_admin ($id_user)==1)) {
if ((isset ($_GET["operacion"])) AND (!isset ($_POST["update_agent"]))){
// DATA COPY
if (isset ($_POST["eliminar"])) {
echo "<h2>".$lang_label["deletedata"]."</h2>";
// First checkings
$max = $_POST["max"];
$min = $_POST["min"];
if ($max == $min){
echo "<h3 class='error'>ERROR ".$lang_label["max_eq_min"]."</h3>";
echo "</table>";
include ("general/footer.php");
exit;
}
$origen_modulo = mysql_real_esape_string($_POST["origen_modulo"]);
if (count($origen_modulo) <= 0){
echo "<h3 class='error'>ERROR: ".$lang_label["nomodules_selected"]."</h3>";
echo "</table>";
include ("general/footer.php");
exit;
}
// Source (agent)
$id_origen = $_POST["origen"];
// Copy
for ($a=0;$a <count($origen_modulo); $a++){ // For every agent selected
$id_agentemodulo = $origen_modulo[$a];
echo "<br><br>".$lang_label["filtering_datamodule"]."<b> [".dame_nombre_modulo_agentemodulo($id_agentemodulo)."]</b>";
$sql1='DELETE FROM tagente_datos WHERE id_agente_modulo = '.$origen_modulo[$a].' AND ( datos < '.$min.' OR datos > '.$max.' )';
$result1=mysql_query($sql1);
//echo "<br>DEBUG DELETE $sql1 <br>";
}
} //if copy modules or alerts
} else { // Form view
?>
<h2><?php echo $lang_label["dbmain_title"]; ?> &gt;
<?php echo $lang_label["db_refine"]; ?></h2>
<form method="post" action="index.php?sec=gdbman&sec2=godmode/db/db_refine&operacion=1">
<table width='500' border='0' cellspacing='4' cellpadding='4' class='databox'>
<tr>
<td class="datost"><b><?php echo $lang_label["source_agent"]; ?></b><br><br>
<select name="origen" class="w130">
<?php
if ( (isset($_POST["update_agent"])) AND (isset($_POST["origen"])) ) {
echo "<option value=".$_POST["origen"].">".dame_nombre_agente($_POST["origen"]);
}
// Show combo with agents
$sql1='SELECT * FROM tagente';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
if ( (isset($_POST["update_agent"])) AND (isset($_POST["origen"])) ){
if ( $_POST["origen"] != $row["id_agente"])
echo "<option value=".$row["id_agente"].">".$row["nombre"]."</option>";
}
else
echo "<option value=".$row["id_agente"].">".$row["nombre"]."</option>";
}
echo '</select>&nbsp;&nbsp;<input type=submit name="update_agent" class="sub upd" value="'.$lang_label["get_info"].'"><br><br>';
echo "<b>".$lang_label["modules"]."</b><br><br>";
echo "<select name='origen_modulo[]' size=5 multiple=yes class='w130'>";
if ( (isset($_POST["update_agent"])) AND (isset($_POST["origen"])) ) {
// Populate Module/Agent combo
$agente_modulo = $_POST["origen"];
$sql1="SELECT * FROM tagente_modulo WHERE id_agente = ".$agente_modulo;
$result = mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
echo "<option value=".$row["id_agente_modulo"].">".$row["nombre"]."</option>";
}
}
echo "</select>";
?>
<td class="datost"><b><?php echo $lang_label["purge_below_limits"]; ?></b><br><br>
<table cellspacing=3 cellpadding=3 border=0>
<tr class=datos><td><?php echo $lang_label["min"]; ?><td><input type="text" name="min" size=4 value=0>
<tr class=datos><td><?php echo $lang_label["max"]; ?><td><input type="text" name="max" size=4 value=0>
<tr><td></td></tr>
<tr><td class="bot" colspan="2" align="right">
<input type="submit" name="eliminar" class="sub delete" value="<?php echo $lang_label["delete"].'" onClick="if (!confirm("'.$lang_label["are_you_sure"].'")) return false;>'; ?>
</table>
</td></tr>
</table>
<?php
}
} else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Database Debug Admin section");
if (! give_acl ($config['id_user'], 0, "DM")) {
audit_db($config['id_user'],$REMOTE_ADDR, "ACL Violation","Trying to access Database Debug Admin section");
require ("general/noaccess.php");
return;
}
if ((isset ($_GET["operacion"])) && (!isset ($_POST["update_agent"]))) {
// DATA COPY
if (isset ($_POST["eliminar"])) {
echo "<h2>".__('deletedata')."</h2>";
// First checkings
$max = $_POST["max"];
$min = $_POST["min"];
if ($max == $min) {
echo "<h3 class='error'>ERROR ".__('max_eq_min')."</h3>";
echo "</table>";
include ("general/footer.php");
exit;
}
$origen_modulo = mysql_real_esape_string ($_POST["origen_modulo"]);
if (count($origen_modulo) <= 0) {
echo "<h3 class='error'>ERROR: ".__('nomodules_selected')."</h3>";
echo "</table>";
include ("general/footer.php");
exit;
}
// Source (agent)
$id_origen = $_POST["origen"];
// Copy
for ($a = 0; $a < count ($origen_modulo); $a++) { // For every agent selected
$id_agentemodulo = $origen_modulo[$a];
echo "<br><br>".__('filtering_datamodule')."<b> [".dame_nombre_modulo_agentemodulo ($id_agentemodulo)."]</b>";
$sql ='DELETE FROM tagente_datos WHERE id_agente_modulo = '.$origen_modulo[$a].' AND ( datos < '.$min.' OR datos > '.$max.' )';
process_sql ($sql);
//echo "<br>DEBUG DELETE $sql1 <br>";
}
} //if copy modules or alerts
} else { // Form view
?>
<h2><?php echo __('dbmain_title'); ?> &gt;
<?php echo __('db_refine'); ?></h2>
<form method="post" action="index.php?sec=gdbman&sec2=godmode/db/db_refine&operacion=1">
<table width='500' border='0' cellspacing='4' cellpadding='4' class='databox'>
<tr>
<td class="datost"><b><?php echo __('source_agent'); ?></b><br><br>
<select name="origen" class="w130">
<?php
if ( (isset ($_POST["update_agent"])) && (isset ($_POST["origen"])) ) {
echo "<option value=".$_POST["origen"].">".dame_nombre_agente($_POST["origen"]);
}
// Show combo with agents
$sql1='SELECT * FROM tagente';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
if ( (isset($_POST["update_agent"])) AND (isset($_POST["origen"])) ){
if ( $_POST["origen"] != $row["id_agente"])
echo "<option value=".$row["id_agente"].">".$row["nombre"]."</option>";
}
else
echo "<option value=".$row["id_agente"].">".$row["nombre"]."</option>";
}
echo '</select>&nbsp;&nbsp;<input type=submit name="update_agent" class="sub upd" value="'.__('get_info').'"><br><br>';
echo "<b>".__('modules')."</b><br><br>";
echo "<select name='origen_modulo[]' size=5 multiple=yes class='w130'>";
if ( (isset($_POST["update_agent"])) && (isset ($_POST["origen"])) ) {
// Populate Module/Agent combo
$agente_modulo = $_POST["origen"];
$sql1="SELECT * FROM tagente_modulo WHERE id_agente = ".$agente_modulo;
$result = mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
echo "<option value=".$row["id_agente_modulo"].">".$row["nombre"]."</option>";
}
}
echo "</select>";
?>
<td class="datost"><b><?php echo __('purge_below_limits'); ?></b><br><br>
<table cellspacing=3 cellpadding=3 border=0>
<tr class=datos><td><?php echo __('min'); ?><td><input type="text" name="min" size=4 value=0>
<tr class=datos><td><?php echo __('max'); ?><td><input type="text" name="max" size=4 value=0>
<tr><td></td></tr>
<tr><td class="bot" colspan="2" align="right">
<input type="submit" name="eliminar" class="sub delete" value="<?php echo __('delete').'" onClick="if (!confirm("'.__('are_you_sure').'")) return false;>'; ?>
</table>
</td></tr>
</table>
<?php
}
?>

View File

@ -19,36 +19,37 @@
require("include/config.php");
check_login();
if ((give_acl($config["id_user"], 0, "DM")==0) AND (dame_admin($config["id_user"])==0)) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Database cure section");
if (! give_acl ($config["id_user"], 0, "DM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Database cure section");
require ("general/noaccess.php");
return;
}
echo "<h2>".lang_string("Database sanity tool")."</h2>";
echo "<h2>".__('Database sanity tool')."</h2>";
$sanity = get_parameter ("sanity", 0);
if ($sanity == 1) {
// Create tagente estado when missing
// ----------------------------------
echo "<h2>".lang_string ("Checking tagente_estado table")."</h2>";
echo "<h2>".__('Checking tagente_estado table')."</h2>";
$sql = "SELECT * FROM tagente_modulo";
$result = mysql_query ($sql);
while ($row = mysql_fetch_array ($result)) {
$id_agente_modulo = $row[0];
$id_agente = $row["id_agente"];
// check if exist in tagente_estado and create if not
$sql2 = "SELECT COUNT(*) FROM tagente_estado WHERE id_agente_modulo = $id_agente_modulo";
$result2=mysql_query($sql2);
$row2=mysql_fetch_array($result2);
if ($row2[0] == 0){
$sql3 = "INSERT INTO tagente_estado (id_agente_modulo, datos, timestamp, cambio, estado, id_agente, last_try, utimestamp, current_interval, running_by, last_execution_try) VALUE ($id_agente_modulo, 0, '0000-00-00 00:00:00', 0, 100, $id_agente, '0000-00-00 00:00:00', 0, 0, 0, 0)";
$sql = "SELECT COUNT(*) FROM tagente_estado
WHERE id_agente_modulo = $id_agente_modulo";
$total = get_db_sql ($sql);
if ($total == 0) {
$sql = "INSERT INTO tagente_estado (id_agente_modulo, datos, timestamp, cambio, estado, id_agente, last_try, utimestamp, current_interval, running_by, last_execution_try) VALUE ($id_agente_modulo, 0, '0000-00-00 00:00:00', 0, 100, $id_agente, '0000-00-00 00:00:00', 0, 0, 0, 0)";
echo "Inserting module $id_agente_modulo in state table <br>";
mysql_query($sql3);
process_sql ($sql);
}
}
echo "<h3>".lang_string("Checking database consistency")."</h2>";
echo "<h3>".__('Checking database consistency')."</h2>";
$query1 = "SELECT * FROM tagente_estado";
$result = mysql_query($query1);
while ($row = mysql_fetch_array ($result)) {
@ -64,7 +65,7 @@ if ($sanity == 1) {
}
}
} elseif ($sanity == 2) {
echo "<h3>".lang_string("Deleting non-init data")."</h2>";
echo "<h3>".__('Deleting non-init data')."</h2>";
$query1 = "SELECT * FROM tagente_estado WHERE utimestamp = 0";
$result = mysql_query ($query1);
while ($row = mysql_fetch_array ($result)) {
@ -82,19 +83,19 @@ if ($sanity == 1) {
echo "<br>";
echo "<div style='width:520px'>";
echo lang_string ("Pandora FMS Sanity tool is used to remove bad database structure data, created modules with missing status, or modules that cannot be initialized (and don't report any valid data) but retry each it's own interval to get data. This kind of bad modules could degrade performance of Pandora FMS. This database sanity tool is also implemented in the <b>pandora_db.pl</b> that you should be running each day or week. This console sanity DONT compact your database, only delete bad structured data.");
echo __('Pandora FMS Sanity tool is used to remove bad database structure data, created modules with missing status, or modules that cannot be initialized (and don\'t report any valid data) but retry each its own interval to get data. This kind of bad modules could degrade performance of Pandora FMS. This database sanity tool is also implemented in the <b>pandora_db.pl</b> that you should be running each day or week. This console sanity DONT compact your database, only delete bad structured data.');
echo "<br><br>";
echo "<b><a href='index.php?sec=gdbman&sec2=godmode/db/db_sanity&sanity=1'>";
echo "<img src='images/status_away.png'> &nbsp;";
echo lang_string("Sanitize my database now");
echo __('Sanitize my database now');
echo "</a></b>";
echo "<br><br>";
echo "<b><a href='index.php?sec=gdbman&sec2=godmode/db/db_sanity&sanity=2'>";
echo "<img src='images/status_away.png'> &nbsp;";
echo lang_string ("Delete non-initialized modules now");
echo __('Delete non-initialized modules now');
echo "</a></b>";
echo "</div>";

View File

@ -17,21 +17,27 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Login check
require ("include/config.php");
check_login ();
if (! give_acl ($config['id_user'], 0, "AR") && ! dame_admin ($config['id_user'])) {
audit_db ($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access extensions list");
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access extensions list");
include ("general/noaccess.php");
exit;
}
if (sizeof ($config['extensions']) == 0) {
echo '<h3>'.lang_string ('There are no extensions defined').'</h3>';
echo '<h3>'.__('There are no extensions defined').'</h3>';
return;
}
echo '<h2>'.lang_string ('Defined extensions')."</h2>";
echo '<h2>'.__('Defined extensions')."</h2>";
$table->width = '95%';
$table->head = array ();
$table->head[0] = lang_string ('Name');
$table->head[0] = __('Name');
$table->data = array ();
foreach ($config['extensions'] as $extension) {

View File

@ -23,16 +23,12 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global vars
require("include/config.php");
require ("include/config.php");
if (comprueba_login ()) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access Group Management2");
require ("general/noaccess.php");
return;
}
check_login ();
if (! give_acl ($config['id_user'], 0, "PM")) {
audit_db ($id_user, $REMOTE_ADDR, "ACL Violation", "Trying to access Group Management2");
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access Group Management2");
require ("general/noaccess.php");
return;
}
@ -54,26 +50,26 @@ if ($id_group) {
$alerts_isabled = $group["disabled"];
$id_parent = $group["parent"];
} else {
echo "<h3 class='error'>".$lang_label["group_error"]."</h3>";
echo "<h3 class='error'>".__('group_error')."</h3>";
echo "</table>";
include ("general/footer.php");
exit;
}
}
echo "<h2>".$lang_label["group_management"]." &gt; ";
echo "<h2>".__('group_management')." &gt; ";
if ($id_group) {
echo $lang_label["update_group"];
echo __('update_group');
} else {
echo $lang_label["create_group"];
echo __('create_group');
}
echo "</h2>";
$table->width = '450px';
$table->data = array ();
$table->data[0][0] = lang_string ('name');
$table->data[0][0] = __('name');
$table->data[0][1] = print_input_text ('name', $name, '', 35, 100, true);
$table->data[1][0] = lang_string ('icon');
$table->data[1][0] = __('icon');
$files = list_files ('images/groups_small/', "png", 1, 0);
$table->data[1][1] = print_select ($files, 'icon', $icon, '', 'None', '', true);
$table->data[1][1] .= ' <span id="icon_preview">';
@ -81,7 +77,7 @@ if ($icon) {
$table->data[1][1] .= '<img src="images/groups_small/'.$icon.'" />';
}
$table->data[1][1] .= '</span>';
$table->data[2][0] = lang_string ('parent');
$table->data[2][0] = __('parent');
$sql = 'SELECT * FROM tgrupo ';
if ($id_group)
$sql .= sprintf ('WHERE id_grupo != %d', $id_group);
@ -91,7 +87,7 @@ if ($id_parent) {
echo '<img src="images/groups_small/'.dame_grupo_icono ($id_parent).'.png" />';
}
echo'</span>';
$table->data[3][0] = lang_string ('alerts');
$table->data[3][0] = __('alerts');
$table->data[3][1] = print_checkbox ('alerts_enabled', 1, ! $alerts_disabled, true);
echo '<form name="grupo" method="post" action="index.php?sec=gagente&sec2=godmode/groups/group_list">';
@ -100,10 +96,10 @@ echo '<div class="action-buttons" style="width: '.$table->width.'">';
if ($id_group) {
print_input_hidden ('update_group', 1);
print_input_hidden ('id_group', $id_group);
print_submit_button (lang_string ('update'), 'updbutton', false, 'class="sub upd"');
print_submit_button (__('update'), 'updbutton', false, 'class="sub upd"');
} else {
print_input_hidden ('create_group', 1);
print_submit_button (lang_string ('create'), 'crtbutton', false, 'class="sub wand"');
print_submit_button (__('create'), 'crtbutton', false, 'class="sub wand"');
}
echo '</div>';
echo '</form>';

View File

@ -22,16 +22,13 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global vars
require("include/config.php");
require ("include/config.php");
if (comprueba_login()) {
audit_db ($id_user,$REMOTE_ADDR, "ACL Violation", "Trying to access Group Management");
require ("general/noaccess.php");
return;
}
$id_user = $_SESSION["id_usuario"];
if (! give_acl($id_user, 0, "PM")) {
audit_db ($id_user, $REMOTE_ADDR, "ACL Violation", "Trying to access Group Management");
check_login();
if (! give_acl($config['id_user'], 0, "PM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Group Management");
require ("general/noaccess.php");
return;
}
@ -67,9 +64,9 @@ if ($create_group) {
$name, substr ($icon, 0, -4), $id_parent, $alerts_disabled);
$result = mysql_query ($sql);
if ($result) {
echo "<h3 class='suc'>".lang_string ("create_group_ok")."</h3>";
echo "<h3 class='suc'>".__('create_group_ok')."</h3>";
} else {
echo "<h3 class='error'>".lang_string ("create_group_no")."</h3>"; }
echo "<h3 class='error'>".__('create_group_no')."</h3>"; }
}
/* Update group */
@ -86,9 +83,9 @@ if ($update_group) {
$name, substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $id_group);
$result = mysql_query ($sql);
if ($result) {
echo "<h3 class='suc'>".lang_string ("modify_group_ok")."</h3>";
echo "<h3 class='suc'>".__('modify_group_ok')."</h3>";
} else {
echo "<h3 class='error'>".lang_string ("modify_group_no")."</h3>";
echo "<h3 class='error'>".__('modify_group_no')."</h3>";
}
}
@ -101,21 +98,21 @@ if ($delete_group) {
$sql = sprintf ('DELETE FROM tgrupo WHERE id_grupo = %d', $id_group);
$result = mysql_query ($sql);
if (! $result)
echo "<h3 class='error'>".lang_string ("delete_group_no")."</h3>";
echo "<h3 class='error'>".__('delete_group_no')."</h3>";
else
echo "<h3 class='suc'>".lang_string ("delete_group_ok")."</h3>";
echo "<h3 class='suc'>".__('delete_group_ok')."</h3>";
}
echo "<h2>".lang_string ("group_management")." &gt; ";
echo lang_string ("definedgroups")."</h2>";
echo "<h2>".__('group_management')." &gt; ";
echo __('definedgroups')."</h2>";
$table->width = '65%';
$table->head = array ();
$table->head[0] = lang_string ("icon");
$table->head[1] = lang_string ("name");
$table->head[2] = lang_string ("parent");
$table->head[3] = lang_string ("alerts");
$table->head[4] = lang_string ("delete");
$table->head[0] = __('icon');
$table->head[1] = __('name');
$table->head[2] = __('parent');
$table->head[3] = __('alerts');
$table->head[4] = __('delete');
$table->align = array ();
$table->align[4] = 'center';
$table->data = array ();
@ -130,8 +127,8 @@ foreach ($groups as $id_group => $group_name) {
$data[0] = '<img src="images/groups_small/'.$group["icon"].'.png" border="0">';
$data[1] = '<strong><a href="index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group='.$id_group.'">'.$group_name.'</a></strong>';
$data[2] = dame_nombre_grupo ($group["parent"]);
$data[3] = $group['disabled'] ? lang_string ('disabled') : lang_string ('enabled');
$data[4] = '<a href="index.php?sec=gagente&sec2=godmode/groups/group_list&id_group='.$id_group.'&delete_group=1" onClick="if (!confirm(\' '.lang_string ("are_you_sure").'\')) return false;"><img border="0" src="images/cross.png"></a>';
$data[3] = $group['disabled'] ? __('disabled') : __('enabled');
$data[4] = '<a href="index.php?sec=gagente&sec2=godmode/groups/group_list&id_group='.$id_group.'&delete_group=1" onClick="if (!confirm(\' '.__('are_you_sure').'\')) return false;"><img border="0" src="images/cross.png"></a>';
array_push ($table->data, $data);
}
@ -140,7 +137,7 @@ print_table ($table);
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/groups/configure_group">';
echo '<div class="action-buttons" style="width: '.$table->width.'">';
print_submit_button (lang_string ("create_group"), 'crt', false, 'class="sub next"');
print_submit_button (__('create_group'), 'crt', false, 'class="sub next"');
echo '</div>';
echo '</form>';

View File

@ -25,7 +25,7 @@ if ((! give_acl ($config['id_user'], 0, "LM")) && (! give_acl ($config['id_user'
}
?>
<div class="tit bg3">:: <?php echo lang_string ("godmode_header") ?> ::</div>
<div class="tit bg3">:: <?php echo __('godmode_header') ?> ::</div>
<div class="menug" id="god">
<?php
@ -35,7 +35,7 @@ if (give_acl ($config['id_user'], 0, "AW")) {
}
else
echo '<div id="god1">';
echo '<ul class="mn"><li><a href="index.php?sec=gagente&amp;sec2=godmode/agentes/modificar_agente" class="mn">'.lang_string ("manage_agents").'</a></li></ul></div>';
echo '<ul class="mn"><li><a href="index.php?sec=gagente&amp;sec2=godmode/agentes/modificar_agente" class="mn">'.__('manage_agents').'</a></li></ul></div>';
if ($sec == "gagente") {
if ($sec2 == "godmode/agentes/manage_config") {
@ -43,14 +43,14 @@ if (give_acl ($config['id_user'], 0, "AW")) {
} else {
echo "<div class='arrowg'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=gagente&amp;sec2=godmode/agentes/manage_config' class='mn'>".lang_string ("manage_config")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=gagente&amp;sec2=godmode/agentes/manage_config' class='mn'>".__('manage_config')."</a></li></ul></div>";
if ($sec2 == "godmode/agentes/manage_config_remote") {
echo "<div class='arrowgs'>";
} else {
echo "<div class='arrowg'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=gagente&amp;sec2=godmode/agentes/manage_config_remote' class='mn'>".lang_string ("Duplicate config")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=gagente&amp;sec2=godmode/agentes/manage_config_remote' class='mn'>".__('Duplicate config')."</a></li></ul></div>";
// Manage groups
if (give_acl($config['id_user'], 0, "PM")) {
@ -59,7 +59,7 @@ if (give_acl ($config['id_user'], 0, "AW")) {
} else {
echo "<div class='arrowg'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=gagente&amp;sec2=godmode/groups/group_list' class='mn'>".lang_string ("manage_groups")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=gagente&amp;sec2=godmode/groups/group_list' class='mn'>".__('manage_groups')."</a></li></ul></div>";
}
// Planned downtimes
@ -69,7 +69,7 @@ if (give_acl ($config['id_user'], 0, "AW")) {
}
else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gagente&sec2=godmode/agentes/planned_downtime' class='mn'>".lang_string ("Scheduled downtime")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=gagente&sec2=godmode/agentes/planned_downtime' class='mn'>".__('Scheduled downtime')."</a></li></ul></div>";
}
}
}
@ -79,14 +79,14 @@ if ((give_acl($config['id_user'], 0, "PM")==1)){
echo '<div id="god_module_sel">';
else
echo '<div id="god_module">';
echo '<ul class="mn"><li><a href="index.php?sec=gmodules&sec2=godmode/modules/module_list" class="mn">'.lang_string ("manage_modules").'</a></li></ul></div>';
echo '<ul class="mn"><li><a href="index.php?sec=gmodules&sec2=godmode/modules/module_list" class="mn">'.__('manage_modules').'</a></li></ul></div>';
if ($sec == "gmodules") {
if ($sec2 == "godmode/modules/manage_nc_groups" || $sec2 == "godmode/modules/manage_nc_groups_form")
echo "<div class='arrowgs'>";
else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups' class='mn'>".lang_string ("nc_groups")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups' class='mn'>".__('nc_groups')."</a></li></ul></div>";
}
if ($sec == "gmodules") {
@ -94,7 +94,7 @@ if ((give_acl($config['id_user'], 0, "PM")==1)){
echo "<div class='arrowgs'>";
else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components' class='mn'>".lang_string ("network_components")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components' class='mn'>".__('network_components')."</a></li></ul></div>";
}
// Network Profiles
if ($sec == "gmodules") {
@ -102,7 +102,7 @@ if ((give_acl($config['id_user'], 0, "PM")==1)){
echo "<div class='arrowgs'>";
else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates' class='mn'>".lang_string ("network_templates")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates' class='mn'>".__('network_templates')."</a></li></ul></div>";
}
}
@ -112,7 +112,7 @@ if (give_acl ($config['id_user'], 0, "LM")) {
}
else
echo '<div id="god2">';
echo '<ul class="mn"><li><a href="index.php?sec=galertas&amp;sec2=godmode/alerts/modify_alert" class="mn">'.lang_string ("manage_alerts").'</a></li></ul></div>';
echo '<ul class="mn"><li><a href="index.php?sec=galertas&amp;sec2=godmode/alerts/modify_alert" class="mn">'.__('manage_alerts').'</a></li></ul></div>';
}
if (give_acl ($config['id_user'], 0, "UM")) {
@ -120,14 +120,14 @@ if (give_acl ($config['id_user'], 0, "UM")) {
echo '<div id="god3s">';
}
else echo '<div id="god3">';
echo '<ul class="mn"><li><a href="index.php?sec=gusuarios&amp;sec2=godmode/users/user_list" class="mn">'.lang_string ("manage_users").'</a></li></ul></div>';
echo '<ul class="mn"><li><a href="index.php?sec=gusuarios&amp;sec2=godmode/users/user_list" class="mn">'.__('manage_users').'</a></li></ul></div>';
}
// Reporting
if (give_acl ($config['id_user'], 0, "PM")) {
echo '<div id="god51">';
echo '<ul class="mn"><li><a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder" class="mn">'. lang_string ("manage_reporting").'</a></li></ul></div>';
echo '<ul class="mn"><li><a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder" class="mn">'. __('manage_reporting').'</a></li></ul></div>';
// Custom report builder
if ($sec == "greporting") {
@ -136,7 +136,7 @@ if (give_acl ($config['id_user'], 0, "PM")) {
} else {
echo "<div class='arrowg'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=greporting&sec2=godmode/reporting/reporting_builder' class='mn'>".lang_string ("report_builder")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=greporting&sec2=godmode/reporting/reporting_builder' class='mn'>".__('report_builder')."</a></li></ul></div>";
}
// Custom graph builder
@ -146,7 +146,7 @@ if (give_acl ($config['id_user'], 0, "PM")) {
} else {
echo "<div class='arrowg'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=greporting&sec2=godmode/reporting/graph_builder' class='mn'>".lang_string ("graph_builder")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=greporting&sec2=godmode/reporting/graph_builder' class='mn'>".__('graph_builder')."</a></li></ul></div>";
}
// Custom map builder
@ -156,7 +156,7 @@ if (give_acl ($config['id_user'], 0, "PM")) {
} else {
echo "<div class='arrowg'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=greporting&sec2=godmode/reporting/map_builder' class='mn'>".lang_string ("map_builder")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=greporting&sec2=godmode/reporting/map_builder' class='mn'>".__('map_builder')."</a></li></ul></div>";
}
}
@ -167,7 +167,7 @@ if (give_acl ($config['id_user'], 0, "PM")) {
echo '<div id="god4s">';
}
else echo '<div id="god4">';
echo '<ul class="mn"><li><a href="index.php?sec=gperfiles&amp;sec2=godmode/profiles/profile_list" class="mn">'.lang_string ("manage_profiles").'</a></li></ul></div>';
echo '<ul class="mn"><li><a href="index.php?sec=gperfiles&amp;sec2=godmode/profiles/profile_list" class="mn">'.__('manage_profiles').'</a></li></ul></div>';
// SERVERS
if ($sec2 == "godmode/servers/modificar_server"){
@ -175,14 +175,14 @@ if (give_acl ($config['id_user'], 0, "PM")) {
} else
echo '<div id="god5">';
echo '<ul class="mn"><li><a href="index.php?sec=gservers&amp;sec2=godmode/servers/modificar_server" class="mn">'.lang_string ("manage_servers").'</a></li></ul></div>';
echo '<ul class="mn"><li><a href="index.php?sec=gservers&amp;sec2=godmode/servers/modificar_server" class="mn">'.__('manage_servers').'</a></li></ul></div>';
if ($sec == "gservers") {
if ($sec2 == "godmode/servers/manage_recontask"|| $sec2 == "godmode/servers/manage_recontask_form") {
echo "<div class='arrowgs'>";
} else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gservers&sec2=godmode/servers/manage_recontask' class='mn'>".lang_string ("manage_recontask")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=gservers&sec2=godmode/servers/manage_recontask' class='mn'>".__('manage_recontask')."</a></li></ul></div>";
}
if ($sec == "gservers") {
if ($sec2 == "godmode/servers/plugin") {
@ -191,7 +191,7 @@ if (give_acl ($config['id_user'], 0, "PM")) {
echo "<div class='arrowg'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=gservers&sec2=godmode/servers/plugin' class='mn'>".lang_string("Manage plugins")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=gservers&sec2=godmode/servers/plugin' class='mn'>".__('Manage plugins')."</a></li></ul></div>";
}
// AUDIT
@ -200,7 +200,7 @@ if (give_acl ($config['id_user'], 0, "PM")) {
echo '<div id="god6s">';
}
else echo '<div id="god6">';
echo '<ul class="mn"><li><a href="index.php?sec=glog&amp;sec2=godmode/admin_access_logs" class="mn">'.lang_string ("system_audit").'</a></li></ul></div>';
echo '<ul class="mn"><li><a href="index.php?sec=glog&amp;sec2=godmode/admin_access_logs" class="mn">'.__('system_audit').'</a></li></ul></div>';
// Main SETUP
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -208,14 +208,14 @@ if (give_acl ($config['id_user'], 0, "PM")) {
echo '<div id="god7s">';
}
else echo '<div id="god7">';
echo '<ul class="mn"><li><a href="index.php?sec=gsetup&amp;sec2=godmode/setup/setup" class="mn">'.lang_string ("setup_screen").'</a></li></ul></div>';
echo '<ul class="mn"><li><a href="index.php?sec=gsetup&amp;sec2=godmode/setup/setup" class="mn">'.__('setup_screen').'</a></li></ul></div>';
if ($sec == "gsetup") {
if ($sec2 == "godmode/setup/links") {
echo "<div class='arrowgs'>";
}
else echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gsetup&amp;sec2=godmode/setup/links' class='mn'>".lang_string ("setup_links")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=gsetup&amp;sec2=godmode/setup/links' class='mn'>".__('setup_links')."</a></li></ul></div>";
}
if ($sec == "gsetup"){
@ -223,7 +223,7 @@ if (give_acl ($config['id_user'], 0, "PM")) {
echo "<div class='arrowgs'>";
}
else echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gsetup&amp;sec2=godmode/setup/news' class='mn'>".lang_string ("site_news")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=gsetup&amp;sec2=godmode/setup/news' class='mn'>".__('site_news')."</a></li></ul></div>";
}
}
if (give_acl ($config['id_user'], 0, "DM")) {
@ -237,7 +237,7 @@ if (give_acl ($config['id_user'], 0, "DM")) {
} else {
echo '<li class="bb0">';
}
echo '<a href="index.php?sec=gdbman&amp;sec2=godmode/db/db_main" class="mn">'.lang_string ("db_maintenance").'</a></li></ul></div>';
echo '<a href="index.php?sec=gdbman&amp;sec2=godmode/db/db_main" class="mn">'.__('db_maintenance').'</a></li></ul></div>';
if ($sec == "gdbman") {
if ($sec2 == "godmode/db/db_info" || $sec2 == "godmode/db/db_info_data") {
@ -245,42 +245,42 @@ if (give_acl ($config['id_user'], 0, "DM")) {
} else {
echo "<div class='arrowg'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&amp;sec2=godmode/db/db_info' class='mn'>".lang_string ("db_info")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&amp;sec2=godmode/db/db_info' class='mn'>".__('db_info')."</a></li></ul></div>";
if ($sec2 == "godmode/db/db_purge") {
echo "<div class='arrowgs'>";
} else {
echo "<div class='arrowg'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&amp;sec2=godmode/db/db_purge' class='mn'>".lang_string ("db_purge")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&amp;sec2=godmode/db/db_purge' class='mn'>".__('db_purge')."</a></li></ul></div>";
if ($sec2 == "godmode/db/db_refine") {
echo "<div class='arrowgs'>";
} else {
echo "<div class='arrowg'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&amp;sec2=godmode/db/db_refine' class='mn'>".lang_string ("db_refine")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&amp;sec2=godmode/db/db_refine' class='mn'>".__('db_refine')."</a></li></ul></div>";
if ($sec2 == "godmode/db/db_audit") {
echo "<div class='arrowgs'>";
} else {
echo "<div class='arrowg'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&amp;sec2=godmode/db/db_audit' class='mn'>".lang_string ("db_audit")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&amp;sec2=godmode/db/db_audit' class='mn'>".__('db_audit')."</a></li></ul></div>";
if ($sec2 == "godmode/db/db_event") {
echo "<div id='arrowgls'>";
} else {
echo "<div id='arrowgl'>";
}
echo "<ul class='mn'><li class='bb0'><a href='index.php?sec=gdbman&amp;sec2=godmode/db/db_event' class='mn'>".lang_string ("db_event")."</a></li></ul></div>";
echo "<ul class='mn'><li class='bb0'><a href='index.php?sec=gdbman&amp;sec2=godmode/db/db_event' class='mn'>".__('db_event')."</a></li></ul></div>";
if ($sec2 == "godmode/db/db_sanity") {
echo "<div id='arrowgls'>";
} else {
echo "<div id='arrowgl'>";
}
echo "<ul class='mn'><li class='bb0'><a href='index.php?sec=gdbman&sec2=godmode/db/db_sanity' class='mn'>".lang_string ("Database sanity")."</a></li></ul></div>";
echo "<ul class='mn'><li class='bb0'><a href='index.php?sec=gdbman&sec2=godmode/db/db_sanity' class='mn'>".__('Database sanity')."</a></li></ul></div>";
}
}
@ -292,7 +292,7 @@ if (sizeof ($config['extensions'])) {
}
echo '<div id="op-extensions" class="operation-menu'.$selected.'">';
echo '<ul class="mn"><li><a href="index.php?sec=gextensions&sec2=godmode/extensions" class="mn">';
echo lang_string ('Extensions');
echo __('Extensions');
echo '</a></li></ul>';
echo "</div>";
if ($selected != '') {

View File

@ -24,14 +24,11 @@
// Load global vars
require("include/config.php");
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
else
$id_user = "";
check_login ();
if (give_acl($id_user, 0, "PM")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access SNMP Group Management");
if (! give_acl ($config['id_user'], 0, "PM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access SNMP Group Management");
require ("general/noaccess.php");
exit;
}
@ -43,9 +40,9 @@ if (isset($_GET["create"])){ // Create module
VALUES ('$name', '$parent')";
$result=mysql_query($sql_insert);
if (! $result)
echo "<h3 class='error'>".$lang_label["create_no"]."</h3>";
echo "<h3 class='error'>".__('create_no')."</h3>";
else {
echo "<h3 class='suc'>".$lang_label["create_ok"]."</h3>";
echo "<h3 class='suc'>".__('create_ok')."</h3>";
$id_sg = mysql_insert_id();
}
}
@ -59,9 +56,9 @@ if (isset($_GET["update"])){ // if modified any parameter
WHERE id_sg = '$id_sg'";
$result=mysql_query($sql_update);
if (! $result)
echo "<h3 class='error'>".$lang_label["modify_no"]."</h3>";
echo "<h3 class='error'>".__('modify_no')."</h3>";
else
echo "<h3 class='suc'>".$lang_label["modify_ok"]."</h3>";
echo "<h3 class='suc'>".__('modify_ok')."</h3>";
}
if (isset($_GET["delete"])){ // if delete
@ -69,19 +66,19 @@ if (isset($_GET["delete"])){ // if delete
$sql_delete= "DELETE FROM tnetwork_component_group WHERE id_sg = ".$id_sg;
$result=mysql_query($sql_delete);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_no"]."</h3>";
echo "<h3 class='error'>".__('delete_no')."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_ok"]."</h3>";
echo "<h3 class='suc'>".__('delete_ok')."</h3>";
$result=mysql_query($sql_delete);
}
echo "<h2>".$lang_label["module_management"]." &gt; ";
echo $lang_label["network_component_group_management"]."</h2>";
echo "<h2>".__('module_management')." &gt; ";
echo __('network_component_group_management')."</h2>";
echo "<table cellpadding='4' cellspacing='4' width='550' class='databox'>";
echo "<th>".$lang_label["name"]."</th>";
echo "<th>".$lang_label["parent"]."</th>";
echo "<th>".$lang_label["delete"]."</th>";
echo "<th>".__('name')."</th>";
echo "<th>".__('parent')."</th>";
echo "<th>".__('delete')."</th>";
$sql1='SELECT * FROM tnetwork_component_group ORDER BY parent';
$result=mysql_query($sql1);
$color=0;
@ -103,7 +100,7 @@ while ($row=mysql_fetch_array($result)){
</td>
<td class='$tdcolor' align='center'>
<a href='index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups&delete=1&id_sg=".$row["id_sg"]."'
onClick='if (!confirm(\' ".$lang_label["are_you_sure"]."\'))
onClick='if (!confirm(\' ".__('are_you_sure')."\'))
return false;'>
<img border='0' src='images/cross.png'></a>
</td>
@ -114,7 +111,7 @@ echo "</table>";
echo '<table width="550">';
echo '<tr><td align="right">';
echo "<form method=post action='index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups_form&create=1'>";
echo "<input type='submit' class='sub next' name='crt' value='".$lang_label["create"]."'>";
echo "<input type='submit' class='sub next' name='crt' value='".__('create')."'>";
echo "</form></td></tr></table>";
?>
?>

View File

@ -24,14 +24,11 @@
// Load global vars
require("include/config.php");
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
else
$id_user = "";
check_login ();
if (give_acl($id_user, 0, "PM")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access SNMO Groups Management");
if (! give_acl ($config['id_user'], 0, "PM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access SNMO Groups Management");
require ("general/noaccess.php");
exit;
}
@ -49,7 +46,7 @@ if (isset($_GET["edit"])){ // Edit mode
$parent = "";
}
echo "<h2>".$lang_label["network_component_group_management"]."</h2>";
echo "<h2>".__('network_component_group_management')."</h2>";
echo '<table width="500" cellspacing="4" cellpadding="4" class="databox_color">';
// Different Form url if it's a create or if it's a update form
@ -59,11 +56,11 @@ else
echo "<form name='snmp_c' method='post' action='index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups&create=1'>";
echo "<tr>";
echo "<td class='datos'>".$lang_label["name"]."</td>";
echo "<td class='datos'>".__('name')."</td>";
echo "<td class='datos'><input type='text' name='name' size=30 value='$name'></td>";
echo "<tr>";
echo "<td class='datos2'>".$lang_label["parent"]."</td>";
echo "<td class='datos2'>".__('parent')."</td>";
echo "<td class='datos2'>";
echo "<select name='parent'>";
echo "<option value='$parent'>".give_network_component_group_name($parent);
@ -78,10 +75,10 @@ echo '<table width="500">';
echo '<tr><td align="right">';
if ($id_sg == -1)
echo "<input name='crtbutton' type='submit' class='sub wand' value='".$lang_label["create"]."'>";
echo "<input name='crtbutton' type='submit' class='sub wand' value='".__('create')."'>";
else
echo "<input name='uptbutton' type='submit' class='sub upd' value='".$lang_label["update"]."'>";
echo "<input name='uptbutton' type='submit' class='sub upd' value='".__('update')."'>";
echo "</form></td></tr></table>";
?>
?>

View File

@ -16,15 +16,13 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global vars
require("include/config.php");
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
else
$id_user = "";
require ("include/config.php");
if (give_acl($id_user, 0, "PM")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
check_login ();
if (! give_acl ($config['id_user'], 0, "PM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
require ("general/noaccess.php");
exit;
}
@ -91,9 +89,9 @@ if (isset($_GET["create"])){ // Create module
$result=mysql_query($sql_insert);
if (! $result)
echo "<h3 class='error'>".$lang_label["create_no"]."</h3>";
echo "<h3 class='error'>".__('create_no')."</h3>";
else {
echo "<h3 class='suc'>".$lang_label["create_ok"]."</h3>";
echo "<h3 class='suc'>".__('create_ok')."</h3>";
$id_module = mysql_insert_id();
}
}
@ -151,9 +149,9 @@ if (isset($_GET["update"])){ // if modified any parameter
plugin_parameter = '$plugin_parameter', max_timeout = '$max_timeout' WHERE id_nc = '$id_nc'";
$result=mysql_query($sql_update);
if (! $result)
echo "<h3 class='error'>".$lang_label["modify_no"]."</h3>";
echo "<h3 class='error'>".__('modify_no')."</h3>";
else
echo "<h3 class='suc'>".$lang_label["modify_ok"]."</h3>";
echo "<h3 class='suc'>".__('modify_ok')."</h3>";
}
// ------------------
@ -164,9 +162,9 @@ if (isset($_GET["delete"])){ // if delete
$sql_delete= "DELETE FROM tnetwork_component WHERE id_nc = ".$id_nc;
$result=mysql_query($sql_delete);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_no"]."</h3>";
echo "<h3 class='error'>".__('delete_no')."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_ok"]."</h3>";
echo "<h3 class='suc'>".__('delete_ok')."</h3>";
$sql_delete= "DELETE FROM tnetwork_profile_component WHERE id_nc = ".$id_nc;
$result=mysql_query($sql_delete);
}
@ -174,8 +172,8 @@ if (isset($_GET["delete"])){ // if delete
// ------------------
// SHOW MODULES
// ------------------
echo "<h2>".$lang_label["module_management"]." &gt; ";
echo $lang_label["network_component_management"]."</h2>";
echo "<h2>".__('module_management')." &gt; ";
echo __('network_component_management')."</h2>";
// Show group selector
if (isset($_POST["ncgroup"])) {
@ -189,12 +187,12 @@ if (isset($_POST["ncgroup"])) {
echo "<table cellpadding='4' cellspacing='4' class='databox'>";
echo "<tr><td>";
echo "<form method='POST' action='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components'>";
echo $lang_label["group"] . "&nbsp;";
echo __('group') . "&nbsp;";
echo "<select name='ncgroup' onChange='javascript:this.form.submit();'>";
if ($ncgroup != 0){
echo "<option value='$ncgroup'>".give_network_component_group_name($ncgroup)."</option>";
}
echo "<option value='0'>".$lang_label["all"]."</option>";
echo "<option value='0'>".__('all')."</option>";
$result = mysql_query("SELECT * FROM tnetwork_component_group WHERE id_sg != '$ncgroup' ORDER BY name");
while ($row = mysql_fetch_array ($result)) {
echo "<option value='" . $row["id_sg"] . "'>". give_network_component_group_name ($row["id_sg"])."</option>";
@ -203,10 +201,10 @@ echo "</select></form></td>";
echo "<td>";
echo "<form method=post action='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components_form&create=1'>";
echo "<select name='id_modulo'>";
echo "<option value='2'>".lang_string("Create a new network component");
echo "<option value='6'>".lang_string("Create a new WMI component");
echo "<option value='2'>".__('Create a new network component');
echo "<option value='6'>".__('Create a new WMI component');
echo "</select>&nbsp;";
echo "<input type='submit' class='sub next' name='crt' value='".$lang_label["create"]."'>";
echo "<input type='submit' class='sub next' name='crt' value='".__('create')."'>";
echo "</td></tr></table>";
if ($ncgroup != 0) {
@ -219,14 +217,14 @@ $result = mysql_query ($sql1);
if ( $row = mysql_num_rows ($result)){
echo '<table width="750" cellpadding="4" cellspacing="4" class="databox">';
echo '<tr>';
echo "<th>".$lang_label["module_name"]."</th>";
echo "<th>".$lang_label["type"]."</th>";
echo "<th>".$lang_label["interval"]."</th>";
echo "<th>".$lang_label["description"]."</th>";
echo "<th>".$lang_label["nc.group"]."</th>";
//echo "<th>".$lang_label["module_group"];
echo "<th>".$lang_label["max_min"]."</th>";
echo "<th width=50>".$lang_label["action"]."</th>";
echo "<th>".__('module_name')."</th>";
echo "<th>".__('type')."</th>";
echo "<th>".__('interval')."</th>";
echo "<th>".__('description')."</th>";
echo "<th>".__('nc.group')."</th>";
//echo "<th>".__('module_group');
echo "<th>".__('max_min')."</th>";
echo "<th width=50>".__('action')."</th>";
$color=1;
while ($row=mysql_fetch_array($result)){
if ($color == 1){
@ -269,7 +267,7 @@ if ( $row = mysql_num_rows ($result)){
echo $module_max." / ".$module_min;
echo "<td class='$tdcolor' align='center'>";
echo "<a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components&delete=1&id_nc=".$row["id_nc"]."'>";
echo "<img src='images/cross.png' border=0 alt='".$lang_label["delete"]."'></a></td>";
echo "<img src='images/cross.png' border=0 alt='".__('delete')."'></a></td>";
echo "</tr>";
}
echo "</table>";

View File

@ -16,16 +16,13 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global vars
require("include/config.php");
require ("include/config.php");
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
else
$id_user = "";
check_login ();
if (give_acl($id_user, 0, "PM")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
if (! give_acl ($config['id_user'], 0, "PM")) {
audit_db ($config['id_user'],$REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
require ("general/noaccess.php");
exit;
}

View File

@ -132,16 +132,13 @@ function type_change()
</script>
<?PHP
// Load global vars
require("include/config.php");
require ("include/config.php");
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
else
$id_user = "";
check_login ();
if (give_acl($id_user, 0, "PM")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
if (! give_acl ($config['id_user'], 0, "PM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
require ("general/noaccess.php");
exit;
}
@ -183,7 +180,7 @@ if (isset($_GET["update"])){ // Edit mode
$type = 0;
}
echo "<h2>".$lang_label["network_component_management"]."</h2>";
echo "<h2>".__('network_component_management')."</h2>";
echo '<table width="700" cellspacing="4" cellpadding="4" class="databox_color">';
// Different Form url if it's a create or if it's a update form
@ -193,11 +190,11 @@ if ($id_nc != -1) {
echo "<form name='modulo' method='post' action='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components&create=1'>";
}
echo "<tr>";
echo '<tr><td class="datos2">'.$lang_label["module_name"];
echo '<tr><td class="datos2">'.__('module_name');
echo "<td class='datos2'><input type='text' name='name' size='25' value='$name'>";
//-- Module type combobox
echo "<td class='datos2'>".$lang_label["module_type"]."</td>";
echo "<td class='datos2'>".__('module_type')."</td>";
echo "<td class='datos2'>";
echo '<select name="tipo" onChange="type_change()">';
$sql1="SELECT id_tipo, nombre FROM ttipo_modulo WHERE id_tipo != '$type' ORDER BY nombre";
@ -210,7 +207,7 @@ echo "</select>";
echo "</td></tr>";
echo "<tr>";
echo "<td class='datos'>".$lang_label["group"]."</td>";
echo "<td class='datos'>".__('group')."</td>";
echo "<td class='datos'>";
echo "<select name='id_group'>";
echo "<option value='$id_group'>".give_network_component_group_name($id_group)."</option>";
@ -221,7 +218,7 @@ while ($row=mysql_fetch_array($result))
echo "</select>";
echo "<td class='datos'>".$lang_label["module_group"]."</td>";
echo "<td class='datos'>".__('module_group')."</td>";
echo '<td class="datos">';
echo '<select name="id_module_group">';
if ($id_nc != -1 )
@ -233,42 +230,42 @@ while ($row=mysql_fetch_array($result))
echo "</select>";
echo "<tr>";
echo '<td class="datos2">'.$lang_label["module_interval"];
echo '<td class="datos2">'.__('module_interval');
echo '<td class="datos2">';
echo '<input type="text" name="module_interval" size="5" value="'.$module_interval.'">';
?>
<td class="datos2"><?php echo $lang_label["tcp_port"] ?></td>
<td class="datos2"><?php echo __('tcp_port') ?></td>
<td class="datos2">
<input type="text" name="tcp_port" size="5" value="<?php echo $tcp_port ?>">
</td></tr>
<tr><td class="datos"><?php echo $lang_label["snmp_oid"] ?><?php pandora_help("snmpoid"); ?></td>
<tr><td class="datos"><?php echo __('snmp_oid') ?><?php pandora_help("snmpoid"); ?></td>
<td class="datos">
<input type="text" name="snmp_oid" size="25" value="<?php echo $snmp_oid ?>">
</td>
<td class="datos"><?php echo $lang_label["snmp_community"] ?></td>
<td class="datos"><?php echo __('snmp_community') ?></td>
<td class="datos">
<input type="text" name="snmp_community" size="25" value="<?php echo $snmp_community ?>">
</td></tr>
<tr><td class="datos2t"><?php echo $lang_label["tcp_send"] ?></td>
<tr><td class="datos2t"><?php echo __('tcp_send') ?></td>
<td class="datos2">
<textarea name="tcp_send" cols="20" rows="2"><?php echo $tcp_send ?></textarea>
</td>
<td class="datos2t"><?php echo $lang_label["tcp_rcv"] ?></td>
<td class="datos2t"><?php echo __('tcp_rcv') ?></td>
<td class="datos2">
<textarea name="tcp_rcv" cols="20" rows="2"><?php echo $tcp_rcv ?></textarea>
</td></tr>
<tr><td class="datos"><?php echo $lang_label["mindata"] ?></td>
<tr><td class="datos"><?php echo __('mindata') ?></td>
<td class="datos">
<input type="text" name="modulo_min" size="5" value="<?php echo $modulo_min ?>">
</td>
<td class="datos"><?php echo $lang_label["maxdata"] ?></td>
<td class="datos"><?php echo __('maxdata') ?></td>
<td class="datos">
<input type="text" name="modulo_max" size="5" value="<?php echo $modulo_max ?>">
</td></tr>
<?PHP
echo '<tr><td class="datos2t">'.$lang_label["comments"];
echo '<tr><td class="datos2t">'.__('comments');
echo '<td class="datos2" colspan=3>';
echo '<textarea name="descripcion" cols=70 rows=2>';
echo $description;
@ -282,9 +279,9 @@ echo '<input type="hidden" name="id_modulo" value="2">';
echo "<table width='700px'>";
echo "</tr><td align='right'>";
if ($id_nc != "-1")
echo '<input name="updbutton" type="submit" class="sub upd" value="'.$lang_label["update"].'">';
echo '<input name="updbutton" type="submit" class="sub upd" value="'.__('update').'">';
else
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.$lang_label["add"].'">';
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.__('add').'">';
echo "</form>";
echo "</td></tr></table>";

View File

@ -16,17 +16,13 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global variables
require("include/config.php");
require ("include/config.php");
// Check user rights
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
else
$id_user = "";
check_login ();
if (give_acl($id_user, 0, "PM")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
if (! give_acl ($config['id_user'], 0, "PM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
require ("general/noaccess.php");
exit;
}
@ -79,7 +75,7 @@ elseif (isset($_GET["create"])){
$max_timeout = 10;
}
echo '<h2>' . lang_string('WMI component management') . '</h2>';
echo '<h2>' . __('WMI component management') . '</h2>';
if ($id_nc != -1) {
// Update
echo '<form name="modulo" method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_network_components&update=1&id_nc=' . $id_nc . '">';
@ -91,11 +87,11 @@ echo '<table width="700" cellspacing="4" cellpadding="4" class="databox_color">'
echo '<tr>';
// Name
echo '<tr><td class="datos2">' . $lang_label['module_name'];
echo '<tr><td class="datos2">' . __('module_name');
echo '<td class="datos2"><input type="text" name="name" size="25" value="' . $name . '">';
// Type
echo '<td class="datos2">' . $lang_label['module_type'] . '</td>';
echo '<td class="datos2">' . __('module_type') . '</td>';
echo '<td class="datos2">';
echo '<select name="tipo">';
echo '<option value="' . $type . '">' . dame_nombre_tipo_modulo($type);
@ -108,7 +104,7 @@ echo '</td></tr>';
echo '<tr>';
// Component group
echo '<td class="datos">' . $lang_label['group'] . '</td>';
echo '<td class="datos">' . __('group') . '</td>';
echo '<td class="datos">';
echo '<select name="id_group">';
echo '<option value="' . $id_group . '">' . give_network_component_group_name($id_group) . '</option>';
@ -119,7 +115,7 @@ while ($row = mysql_fetch_array($result)) {
echo '</select>';
// Module group
echo '<td class="datos">' . $lang_label['module_group'] . '</td>';
echo '<td class="datos">' . __('module_group') . '</td>';
echo '<td class="datos">';
echo '<select name="id_module_group">';
if ($id_nc != -1 ) {
@ -132,18 +128,18 @@ echo '</select>';
echo '<tr>';
// Interval
echo '<td class="datos2">' . $lang_label['module_interval'];
echo '<td class="datos2">' . __('module_interval');
echo '<td class="datos2">';
echo '<input type="text" name="module_interval" size="5" value="'.$module_interval.'">';
// Timeout
echo '<td class="datos2">' . lang_string ("max_timeout") . '</td>';
echo '<td class="datos2">' . __('max_timeout') . '</td>';
echo '<td class="datos2">';
echo '<input type="text" name="max_timeout" size="5" value="' . $max_timeout . '">';
echo '</td></tr>';
// WMI Query
echo '<tr><td class="datos">' . lang_string ('WMI Query') ;
echo '<tr><td class="datos">' . __('WMI Query') ;
pandora_help("wmiquery");
echo '</td>';
echo '<td class="datos">';
@ -151,7 +147,7 @@ echo '<input type="text" name="snmp_oid" size="25" value="' . $snmp_oid . '">';
echo '</td>';
// Key string
echo '<td class="datos">' . lang_string ('Key string');
echo '<td class="datos">' . __('Key string');
pandora_help("wmikey");
echo '</td>';
echo '<td class="datos">';
@ -159,7 +155,7 @@ echo '<input type="text" name="snmp_community" size="25" value="' . $snmp_commu
echo '</td></tr>';
// Field
echo '<td class="datos2">' . lang_string ("Field number");
echo '<td class="datos2">' . __('Field number');
pandora_help("wmifield");
echo '</td>';
echo '<td class="datos2">';
@ -167,23 +163,23 @@ echo '<input type="text" name="tcp_port" size="5" value="' . $tcp_port . '">';
echo '</td></tr>';
// Username
echo '<tr><td class="datos2t">' . lang_string ('Username') . '</td>';
echo '<tr><td class="datos2t">' . __('Username') . '</td>';
echo '<td class="datos2">';
echo '<input type="text" name="plugin_user" size="25" value="' . $plugin_user . '">';
echo '</td>';
// Password
echo '<td class="datos2t">' . lang_string ('Password') . '</td>';
echo '<td class="datos2t">' . __('Password') . '</td>';
echo '<td class="datos2">';
echo '<input type="password" name="plugin_pass" size="25" value="' . $plugin_pass . '">';
echo '</td></tr>';
// Min data
echo '<tr><td class="datos">' . $lang_label['mindata'] . '</td>';
echo '<tr><td class="datos">' . __('mindata') . '</td>';
echo '<td class="datos">';
echo '<input type="text" name="modulo_min" size="5" value="' . $modulo_min . '">';
echo '</td>';
echo '<td class="datos">' . $lang_label['maxdata'] . '</td>';
echo '<td class="datos">' . __('maxdata') . '</td>';
echo '<td class="datos">';
// Max data
@ -191,7 +187,7 @@ echo '<input type="text" name="modulo_max" size="5" value="' . $modulo_max . '">
echo '</td></tr>';
// Comments
echo '<tr><td class="datos2t">'.$lang_label['comments'];
echo '<tr><td class="datos2t">'.__('comments');
echo '<td class="datos2" colspan=3>';
echo '<textarea name="descripcion" cols=70 rows=2>';
echo $description;
@ -206,9 +202,9 @@ echo '<input type="hidden" name="id_modulo" value="6">';
echo '<table width="700px">';
echo '</tr><td align="right">';
if ($id_nc != '-1')
echo '<input name="updbutton" type="submit" class="sub upd" value="'.$lang_label["update"].'">';
echo '<input name="updbutton" type="submit" class="sub upd" value="'.__('update').'">';
else
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.$lang_label["add"].'">';
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.__('add').'">';
echo '</td></tr></table>';
echo '</form>';

View File

@ -18,14 +18,11 @@
// Load global vars
require("include/config.php");
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
else
$id_user = "";
check_login ();
if (give_acl($id_user, 0, "PM")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access Network Profile Management");
if (! give_acl ($config['id_user'], 0, "PM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Network Profile Management");
require ("general/noaccess.php");
exit;
}
@ -35,14 +32,14 @@ if (isset($_GET["delete"])){ // if delete
$sql_delete= "DELETE FROM tnetwork_profile WHERE id_np = ".$id_np;
$result=mysql_query($sql_delete);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_no"]."</h3>";
echo "<h3 class='error'>".__('delete_no')."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_ok"]."</h3>";
echo "<h3 class='suc'>".__('delete_ok')."</h3>";
$result=mysql_query($sql_delete);
}
echo "<h2>".$lang_label["module_management"]." &gt; ";
echo $lang_label["network_profile_management"]."</h2>";
echo "<h2>".__('module_management')." &gt; ";
echo __('network_profile_management')."</h2>";
$sql1='SELECT * FROM tnetwork_profile ORDER BY name';
@ -50,9 +47,9 @@ $result=mysql_query($sql1);
$color=0;
if (mysql_num_rows($result)) {
echo "<table cellpadding='4' cellspacing='4' width='650' class='databox'>";
echo "<th>".$lang_label["name"]."</th>";
echo "<th>".$lang_label["description"]."</th>";
echo "<th>".$lang_label["action"]."</th>";
echo "<th>".__('name')."</th>";
echo "<th>".__('description')."</th>";
echo "<th>".__('action')."</th>";
}
while ($row=mysql_fetch_array($result)){
if ($color == 1){
@ -73,7 +70,7 @@ while ($row=mysql_fetch_array($result)){
</td>
<td class='$tdcolor' align='center'>
<a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates&delete=".$row["id_np"]."'
onClick='if (!confirm(\' ".$lang_label["are_you_sure"]."\'))
onClick='if (!confirm(\' ".__('are_you_sure')."\'))
return false;'>
<img border='0' src='images/cross.png'></a>
</td>
@ -84,13 +81,13 @@ if (mysql_num_rows($result)) {
echo "</table>";
echo "<table width='650px'>";
} else {
echo "<div class='nf'>".$lang_label["no_netprofiles"]."</div>";
echo "<div class='nf'>".__('no_netprofiles')."</div>";
echo "<table>";
}
echo "<tr><td align='right'>";
echo "<form method=post action='index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&id_np=-1'>";
echo "<input type='submit' class='sub next' name='crt' value='".$lang_label["create"]."'>";
echo "<input type='submit' class='sub next' name='crt' value='".__('create')."'>";
echo "</form></td></tr></table>";
?>

View File

@ -18,14 +18,11 @@
// Load global vars
require("include/config.php");
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
else
$id_user = "";
check_login ();
if (give_acl($id_user, 0, "PM")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access Network Profile Management");
if (! give_acl ($config['id_user'], 0, "PM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Network Profile Management");
require ("general/noaccess.php");
exit;
}
@ -36,9 +33,9 @@ if (isset($_GET["delete_module"])){ // Delete module from profile
$sql1="DELETE FROM tnetwork_profile_component WHERE id_npc = $id_npc";
$result=mysql_query($sql1);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_no"]."</h3>";
echo "<h3 class='error'>".__('delete_no')."</h3>";
else {
echo "<h3 class='suc'>".$lang_label["delete_ok"]."</h3>";
echo "<h3 class='suc'>".__('delete_ok')."</h3>";
}
}
@ -48,9 +45,9 @@ if (isset($_GET["add_module"])){ // Add module to profile
$sql1="INSERT INTO tnetwork_profile_component (id_np,id_nc) VALUES ($id_np, $id_nc)";
$result=mysql_query($sql1);
if (! $result)
echo "<h3 class='error'>".$lang_label["create_no"]."</h3>";
echo "<h3 class='error'>".__('create_no')."</h3>";
else {
echo "<h3 class='suc'>".$lang_label["create_ok"]."</h3>";
echo "<h3 class='suc'>".__('create_ok')."</h3>";
}
}
@ -83,9 +80,9 @@ if (isset($_GET["create"])){ // Create module
VALUES ('$name', '$description')";
$result=mysql_query($sql_insert);
if (! $result)
echo "<h3 class='error'>".$lang_label["create_no"]."</h3>";
echo "<h3 class='error'>".__('create_no')."</h3>";
else {
echo "<h3 class='suc'>".$lang_label["create_ok"]."</h3>";
echo "<h3 class='suc'>".__('create_ok')."</h3>";
$id_np = mysql_insert_id();
}
}
@ -97,14 +94,14 @@ if (isset($_GET["update"])){ // Update profile
$sql_insert="UPDATE tnetwork_profile set name = '$name', description = '$description' WHERE id_np = $id_np";
$result=mysql_query($sql_insert);
if (! $result)
echo "<h3 class='error'>".$lang_label["modify_no"]."</h3>";
echo "<h3 class='error'>".__('modify_no')."</h3>";
else {
echo "<h3 class='suc'>".$lang_label["modify_ok"]."</h3>";
echo "<h3 class='suc'>".__('modify_ok')."</h3>";
}
}
echo "<h2>".$lang_label["module_management"]." &gt; ";
echo $lang_label["network_profile_management"]."</h2>";
echo "<h2>".__('module_management')." &gt; ";
echo __('network_profile_management')."</h2>";
echo "<table width='550' cellpadding='4' cellspacing='4' class='databox_color'>";
if ($id_np == -1)
@ -112,11 +109,11 @@ if ($id_np == -1)
else
echo '<form name="user_mod" method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&update='.$id_np.'">';
echo "<tr><td class='datos'>".$lang_label["name"]."</td>";
echo "<tr><td class='datos'>".__('name')."</td>";
echo "<td class='datos'>";
echo "<input type='text' size=25 name='name' value='$name'>";
echo "</td>";
echo "<tr><td class='datos2'>".$lang_label["description"]."</td>";
echo "<tr><td class='datos2'>".__('description')."</td>";
echo "<td class='datos2'>";
echo "<textarea cols=50 rows=2 name='description'>";
if (isset($description)) {
@ -134,10 +131,10 @@ if ($id_np != -1){
echo '<table width="550" cellpadding="4" cellspacing="4" class="databox">';
echo '<tr>';
echo "<th>".$lang_label["module_name"]."</th>";
echo "<th>".$lang_label["type"]."</th>";
echo "<th>".$lang_label["description"]."</th>";
echo "<th>".$lang_label["nc.group"]."</th>";
echo "<th>".__('module_name')."</th>";
echo "<th>".__('type')."</th>";
echo "<th>".__('description')."</th>";
echo "<th>".__('nc.group')."</th>";
echo "<th>X</th>";
$color =0;
@ -180,15 +177,15 @@ if ($id_np != -1){
echo "<table width='550'>";
echo '<tr><td align="right">';
if ($id_np == -1)
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.$lang_label["create"].'">';
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.__('create').'">';
else
echo '<input name="updbutton" type="submit" class="sub upd" value="'.$lang_label["update"].'">';
echo '<input name="updbutton" type="submit" class="sub upd" value="'.__('update').'">';
echo "</td></tr></table>";
echo "</form>";
if ($id_np != -1){
echo "<h3>".$lang_label["add"]." ".$lang_label["module"]."</h3>";
echo "<h3>".__('add')." ".__('module')."</h3>";
echo "<table class='databox'>";
echo '<tr><td>';
echo '<form name="add_module" method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&id_np='.$id_np.'&add_module=1">';
@ -201,9 +198,9 @@ if ($id_np != -1){
echo "</select>";
echo '<td valign="top">';
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.$lang_label["add"].'">';
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.__('add').'">';
echo "</td></tr></table>";
echo "</form>";
}
?>
?>

View File

@ -24,85 +24,66 @@
// Load global vars
require("include/config.php");
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
check_login ();
if (give_acl($id_user, 0, "PM")==1) {
if (isset($_POST["update_module"])){ // if modified any parameter
$name = entrada_limpia($_POST["name"]);
$id_type = entrada_limpia($_POST["id_type"]);
$description = entrada_limpia($_POST["description"]);
$icon = entrada_limpia($_POST["icon"]);
$category = entrada_limpia($_POST["category"]);
$sql_update ="UPDATE ttipo_modulo
SET descripcion = '".$description."', categoria = '".$category."',
nombre = '".$name."', icon = '".$icon."'
WHERE id_tipo = '".$id_type."'";
$result=mysql_query($sql_update);
if (! $result)
echo "<h3 class='error'>".$lang_label["modify_module_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["modify_module_ok"]."</h3>";
}
/*if (isset($_GET["borrar_grupo"])){ // if delete
$id_borrar_modulo = entrada_limpia($_GET["id_grupo"]);
// First delete from tagente_modulo
$sql_delete= "DELETE FROM tgrupo WHERE id_grupo = ".$id_borrar_modulo;
$result=mysql_query($sql_delete);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_group_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_group_ok"]."</h3>";
}*/
echo "<h2>".$lang_label["module_management"]." &gt; ";
echo $lang_label["defined_modules"]."</h2>";
echo "<table cellpadding='4' cellspacing='4' width='750' class='databox'>";
echo "<th>".$lang_label["icon"]."</th>";
echo "<th>".$lang_label["name"]."</th>";
echo "<th>".$lang_label["description"]."</th>";
$sql1='SELECT * FROM ttipo_modulo ORDER BY nombre';
$result=mysql_query($sql1);
$color=0;
while ($row=mysql_fetch_array($result)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo "
<tr>
<td class='$tdcolor' align='center'>
<img src='images/".$row["icon"]."'
border='0'>
</td>
<td class='$tdcolor'>
<b>".$row["nombre"]."
</b></td>
<td class='$tdcolor'>
".$row["descripcion"]."
</td>
</tr>";
}
echo "</table>";
/* not used yet
echo "<table>";
echo "<tr><td align='right'><form method=post action='index.php?sec=gmodules&
sec2=godmode/modules/manage_modules&create=1'>";
echo "<input type='submit' class='sub next' name='crt' value='".$lang_label["create_module"]."'>";
echo "</form></td></tr></table>
*/
} // Fin pagina
else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access module management");
if (! give_acl ($config['id_user'], 0, "PM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation","Trying to access module management");
require ("general/noaccess.php");
exit;
}
$update_module = (bool) get_parameter_post ('update_module');
// Update
if ($update_module) {
$name = get_parameter_post ("name");
$id_type = get_parameter_post ("id_type");
$description = get_parameter_post ("description");
$icon = get_parameter_post ("icon");
$category = get_parameter_post ("category");
$sql_update ="UPDATE ttipo_modulo
SET descripcion = '".$description."', categoria = '".$category."',
nombre = '".$name."', icon = '".$icon."'
WHERE id_tipo = '".$id_type."'";
$result = mysql_query($sql_update);
if (! $result)
echo "<h3 class='error'>".__('modify_module_no')."</h3>";
else
echo "<h3 class='suc'>".__('modify_module_ok')."</h3>";
}
echo "<h2>".__('module_management')." &gt; ";
echo __('defined_modules')."</h2>";
echo "<table cellpadding='4' cellspacing='4' width='750' class='databox'>";
echo "<th>".__('icon')."</th>";
echo "<th>".__('name')."</th>";
echo "<th>".__('description')."</th>";
$sql = 'SELECT * FROM ttipo_modulo ORDER BY nombre';
$result = mysql_query ($sql);
$color = 0;
while ($row = mysql_fetch_array ($result)){
if ($color == 1) {
$tdcolor = "datos";
$color = 0;
} else {
$tdcolor = "datos2";
$color = 1;
}
echo "
<tr>
<td class='$tdcolor' align='center'>
<img src='images/".$row["icon"]."'
border='0'>
</td>
<td class='$tdcolor'>
<b>".$row["nombre"]."
</b></td>
<td class='$tdcolor'>
".$row["descripcion"]."
</td>
</tr>";
}
echo "</table>";
?>

View File

@ -6,292 +6,295 @@
// Raul Mateos <raulofpandora@gmail.com>, 2005-2007
// Global variables
require("include/config.php");
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
if (give_acl($id_user, 0, "PM")==1) {
// Profile deletion
if (isset($_GET["delete_profile"])){ // if any parameter is modified
$id_perfil= entrada_limpia($_GET["delete_profile"]);
// Delete profile
$query_del1="DELETE FROM tperfil WHERE id_perfil = '".$id_perfil."'";
$query_del2="DELETE FROM tusuario_perfil WHERE id_perfil = '".$id_perfil."'";
$resq1=mysql_query($query_del1);
if (! $resq1)
echo "<h3 class='error'>".$lang_label["delete_profile_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_profile_ok"]."</h3>";
$resq1=mysql_query($query_del2);
unset($id_perfil); // forget it to show list
}
// Profile creation
elseif (isset($_GET["new_profile"])){ // create a new profile
$id_perfil = -1;
$name = "";
$incident_view = "0";
$incident_edit = "0";
$incident_create = "0";
$incident_management = "0";
$agent_view = "0";
$agent_edit ="0";
$alert_edit = "0";
$user_management = "0";
$db_management = "0";
$alert_management = "0";
$pandora_management = "0";
} elseif (isset($_GET["edit_profile"])){ // Edit profile (read data to show in form)
// Profile edit
$id_perfil= entrada_limpia($_GET["edit_profile"]);
$query_del1="SELECT * FROM tperfil WHERE id_perfil = '".$id_perfil."'";
$resq1=mysql_query($query_del1);
$rowq1=mysql_fetch_array($resq1);
if (!$rowq1){
echo "<h3 class='error'>".$lang_label["profile_error"]."</h3>";
echo "</table>";
include ("general/footer.php");
exit;
}
else
require ("include/config.php");
$name = $rowq1["name"];
$incident_view = $rowq1["incident_view"];
$incident_edit = $rowq1["incident_edit"];
$incident_management = $rowq1["incident_management"];
$agent_view = $rowq1["agent_view"];
$agent_edit =$rowq1["agent_edit"];
$alert_edit = $rowq1["alert_edit"];
$user_management = $rowq1["user_management"];
$db_management = $rowq1["db_management"];
$alert_management = $rowq1["alert_management"];
$pandora_management = $rowq1["pandora_management"];
} elseif (isset($_GET["update_data"])){ // Update or Create a new record (writes on DB)
// Profile edit
$incident_view = "0";
$incident_edit = "0";
$incident_create = "0";
$incident_management = "0";
$agent_view = "0";
$agent_edit ="0";
$alert_edit = "0";
$user_management = "0";
$db_management = "0";
$alert_management = "0";
$pandora_management = "0";
$id_perfil= entrada_limpia($_POST["id_perfil"]);
$name = entrada_limpia($_POST["name"]);
if (isset ($_POST["incident_view"]))$incident_view = entrada_limpia($_POST["incident_view"]);
if (isset ($_POST["incident_edit"])) $incident_edit = entrada_limpia($_POST["incident_edit"]);
if (isset ($_POST["incident_management"])) $incident_management = entrada_limpia($_POST["incident_management"]);
if (isset ($_POST["agent_view"])) $agent_view = entrada_limpia($_POST["agent_view"]);
if (isset ($_POST["agent_edit"])) $agent_edit =entrada_limpia($_POST["agent_edit"]);
if (isset ($_POST["alert_edit"])) $alert_edit = entrada_limpia($_POST["alert_edit"]);
if (isset ($_POST["user_management"])) $user_management = entrada_limpia($_POST["user_management"]);
if (isset ($_POST["db_management"])) $db_management = entrada_limpia($_POST["db_management"]);
if (isset ($_POST["alert_management"])) $alert_management = entrada_limpia($_POST["alert_management"]);
if (isset ($_POST["pandora_management"])) $pandora_management = entrada_limpia($_POST["pandora_management"]);
// update or insert ??
if ($id_perfil == -1) { // INSERT
$query = "INSERT INTO tperfil (name,incident_view,incident_edit,incident_management, agent_view,agent_edit,alert_edit,user_management,db_management,alert_management,pandora_management) VALUES
('".$name."','".$incident_view."','".$incident_edit."','".$incident_management."','".$agent_view."','".$agent_edit."','".$alert_edit."','".$user_management."','".$db_management."','".$alert_management."','".$pandora_management."')";
// echo "DEBUG: ".$query;
$res=mysql_query($query);
if ($res)
echo "<h3 class='suc'>".$lang_label["create_profile_ok"]."</h3>";
else {
echo "<h3 class='error'>".$lang_label["create_profile_no"]."</h3>";
}
check_login ();
} else { // UPDATE
$query ="UPDATE tperfil SET
name = '$name',
incident_view = $incident_view,
incident_edit = $incident_edit,
incident_management = $incident_management,
agent_view = $agent_view,
agent_edit = $agent_edit,
alert_edit = $alert_edit,
user_management = $user_management,
db_management = $db_management,
alert_management = $alert_management,
pandora_management = $pandora_management
WHERE id_perfil = $id_perfil ";
// echo "DEBUG: ".$query;
$res=mysql_query($query);
echo "<h3 class='suc'>".$lang_label['profile_upd']."</h3>";
}
unset($id_perfil);
}
echo '<h2>'.$lang_label["profile_title"].' &gt; ';
echo (isset($_GET["new_profile"]))?
($lang_label["create_profile"].'</h2>'):
(
(isset($_GET["edit_profile"]))?
($lang_label["update_profile"].'></h2>'):
($lang_label["definedprofiles"].'</h2>')
);
// Form to manage date
if (isset ($id_perfil)){ // There are values defined, let's show form with data for INSERT or UPDATE
echo "<table width='400' cellpadding='4' cellspacing='4' class='databox'>";
echo "<tr>";
echo "<form method='post' action='index.php?sec=gperfiles&sec2=godmode/profiles/profile_list&update_data'>";
echo "<input type=hidden name=id_perfil value='".$id_perfil."'>";
echo "
<td class=datos>".$lang_label["profile_name"]."</td>
<td class=datos>
<input name='name' type=text size='27' value='".$name."'></td></tr>
<tr><td class=datos2>".$lang_label["incident_view"]."</td>
<td class=datos2>
<input name='incident_view' type=checkbox class='chk' value='1' ";
if ($incident_view == 1) echo "checked"; echo "></td></tr>
<tr><td class=datos>".$lang_label["incident_edit"]."</td>
<td class=datos>
<input name='incident_edit' type=checkbox class='chk' value='1' ";
if ($incident_edit == 1) echo "checked";echo "></td></tr>
<tr><td class=datos2>".$lang_label["manage_incidents"]."</td>
<td class=datos2>
<input name='incident_management' type=checkbox class='chk' value='1' ";
if ($incident_management == 1) echo "checked";echo "></td></tr>
<tr><td class=datos>".$lang_label["view_agents"]."</td>
<td class=datos>
<input name='agent_view' type=checkbox class='chk' value='1' ";
if ($agent_view == 1) echo "checked";echo "></td></tr>
<tr><td class=datos2>".$lang_label["agent_edit"]."</td>
<td class=datos2>
<input name='agent_edit' type=checkbox class='chk' value='1' ";
if ($agent_edit == 1) echo "checked";echo "></td></tr>
<tr><td class=datos>".$lang_label["alert_edit"]."</td>
<td class=datos>
<input name='alert_edit' type=checkbox class='chk' value='1' ";
if ($alert_edit == 1) echo "checked";echo "></td></tr>
<tr><td class=datos2>".$lang_label["manage_users"]."</td>
<td class=datos2>
<input name='user_management' class='chk' type=checkbox value='1' ";
if ($user_management == 1) echo "checked";echo "></td></tr>
<tr><td class=datos>".$lang_label["manage_db"]."</td>
<td class=datos>
<input name='db_management' class='chk' type=checkbox value='1' ";
if ($db_management == 1) echo "checked";echo "></td></tr>
<tr><td class=datos2>".$lang_label["manage_alerts"]."</td>
<td class=datos2>
<input name='alert_management' class='chk' type=checkbox value='1' ";
if ($alert_management == 1) echo "checked";echo "></td></tr>
<tr><td class=datos>".$lang_label["pandora_management"]."</td>
<td class=datos>
<input name='pandora_management' class='chk' type=checkbox value='1' ";
if ($pandora_management == 1) echo "checked";echo "></td></tr>
";
echo "</table>";
echo "<table width='400'>";
echo "<tr><td align='right'>";
if (isset($_GET["new_profile"])){
echo "
<input name='crtbutton' type='submit' class='sub wand' value='".$lang_label["create"]."'>";
}
if (isset($_GET["edit_profile"])){
echo "
<input name='uptbutton' type='submit' class='sub upd' value='" .$lang_label["update"]."'>";
}
echo "</td></tr></table>";
} else { // View list data
$color=1;
?>
<table cellpadding='4' cellspacing='4' class='databox' width='750px'>
<?php
$query_del1="SELECT * FROM tperfil";
$resq1=mysql_query($query_del1);
echo "<tr>";
echo "<th width='180px'><font size=1>".$lang_label["profiles"];
echo "</th><th width='40px'>
<font size=1>IR<a href='#' class='tipp'>&nbsp;<span>".$help_label["IR"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>IW<a href='#' class='tipp'>&nbsp;<span>".$help_label["IW"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>IM<a href='#' class='tipp'>&nbsp;<span>".$help_label["IM"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>AR<a href='#' class='tipp'>&nbsp;<span>".$help_label["AR"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>AW<a href='#' class='tipp'>&nbsp;<span>".$help_label["AW"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>LW<a href='#' class='tipp'>&nbsp;<span>".$help_label["LW"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>UM<a href='#' class='tipp'>&nbsp;<span>".$help_label["UM"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>DM<a href='#' class='tipp'>&nbsp;<span>".$help_label["DM"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>LM<a href='#' class='tipp'>&nbsp;<span>".$help_label["LM"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>PM<a href='#' class='tipp'>&nbsp;<span>".$help_label["PM"]."</span></a>";
echo "</th><th width='40px'>".$lang_label["delete"]."</th></tr>";
while ($rowdup=mysql_fetch_array($resq1)){
$id_perfil = $rowdup["id_perfil"];
$nombre=$rowdup["name"];
$incident_view = $rowdup["incident_view"];
$incident_edit = $rowdup["incident_edit"];
$incident_management = $rowdup["incident_management"];
$agent_view = $rowdup["agent_view"];
$agent_edit =$rowdup["agent_edit"];
$alert_edit = $rowdup["alert_edit"];
$user_management = $rowdup["user_management"];
$db_management = $rowdup["db_management"];
$alert_management = $rowdup["alert_management"];
$pandora_management = $rowdup["pandora_management"];
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo "<td class='$tdcolor'><a href='index.php?sec=gperfiles&amp;sec2=godmode/profiles/profile_list&amp;edit_profile=".$id_perfil."'><b>".$nombre."</b></a>";
echo "</td><td class='$tdcolor'>";
if ($incident_view == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($incident_edit == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($incident_management == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($agent_view == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($agent_edit == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($alert_edit == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($user_management == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($db_management == 1) echo "<img src='images/ok.png' border=0>";
echo "<td class='$tdcolor'>";
if ($alert_management == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($pandora_management == 1) echo "<img src='images/ok.png' border=0>";
echo "<td class='$tdcolor' align='center'><a href='index.php?sec=gagente&sec2=godmode/profiles/profile_list&delete_profile=".$id_perfil."' onClick='if (!confirm(\' ".$lang_label["are_you_sure"]."\')) return false;'><img border='0' src='images/cross.png'></a></td></tr>";
}
echo "</table>";
echo '</tr></table>';
echo '<table width="750">';
echo '<tr><td align="right">';
echo "<form method=post action='index.php?sec=gperfiles&sec2=godmode/profiles/profile_list&new_profile=1'>";
echo "<input type='submit' class='sub next' name='crt' value='".$lang_label["create_profile"]."'>";
echo "</form></table>";
}
if (! give_acl ($config['id_user'], 0, "PM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Profile Management");
require ("general/noaccess.php");
return;
}
// Profile deletion
if (isset($_GET["delete_profile"])){ // if any parameter is modified
$id_perfil= entrada_limpia($_GET["delete_profile"]);
// Delete profile
$query_del1="DELETE FROM tperfil WHERE id_perfil = '".$id_perfil."'";
$query_del2="DELETE FROM tusuario_perfil WHERE id_perfil = '".$id_perfil."'";
$resq1=mysql_query($query_del1);
if (! $resq1)
echo "<h3 class='error'>".__('delete_profile_no')."</h3>";
else
echo "<h3 class='suc'>".__('delete_profile_ok')."</h3>";
$resq1=mysql_query($query_del2);
unset($id_perfil); // forget it to show list
}
// Profile creation
elseif (isset($_GET["new_profile"])){ // create a new profile
$id_perfil = -1;
$name = "";
$incident_view = "0";
$incident_edit = "0";
$incident_create = "0";
$incident_management = "0";
$agent_view = "0";
$agent_edit ="0";
$alert_edit = "0";
$user_management = "0";
$db_management = "0";
$alert_management = "0";
$pandora_management = "0";
} elseif (isset($_GET["edit_profile"])){ // Edit profile (read data to show in form)
// Profile edit
$id_perfil= entrada_limpia($_GET["edit_profile"]);
$query_del1="SELECT * FROM tperfil WHERE id_perfil = '".$id_perfil."'";
$resq1=mysql_query($query_del1);
$rowq1=mysql_fetch_array($resq1);
if (!$rowq1){
echo "<h3 class='error'>".__('profile_error')."</h3>";
echo "</table>";
include ("general/footer.php");
exit;
}
else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Profile Management");
require ("general/noaccess.php");
}
else
$name = $rowq1["name"];
$incident_view = $rowq1["incident_view"];
$incident_edit = $rowq1["incident_edit"];
$incident_management = $rowq1["incident_management"];
$agent_view = $rowq1["agent_view"];
$agent_edit =$rowq1["agent_edit"];
$alert_edit = $rowq1["alert_edit"];
$user_management = $rowq1["user_management"];
$db_management = $rowq1["db_management"];
$alert_management = $rowq1["alert_management"];
$pandora_management = $rowq1["pandora_management"];
} elseif (isset($_GET["update_data"])){ // Update or Create a new record (writes on DB)
// Profile edit
$incident_view = "0";
$incident_edit = "0";
$incident_create = "0";
$incident_management = "0";
$agent_view = "0";
$agent_edit ="0";
$alert_edit = "0";
$user_management = "0";
$db_management = "0";
$alert_management = "0";
$pandora_management = "0";
$id_perfil= entrada_limpia($_POST["id_perfil"]);
$name = entrada_limpia($_POST["name"]);
if (isset ($_POST["incident_view"]))$incident_view = entrada_limpia($_POST["incident_view"]);
if (isset ($_POST["incident_edit"])) $incident_edit = entrada_limpia($_POST["incident_edit"]);
if (isset ($_POST["incident_management"])) $incident_management = entrada_limpia($_POST["incident_management"]);
if (isset ($_POST["agent_view"])) $agent_view = entrada_limpia($_POST["agent_view"]);
if (isset ($_POST["agent_edit"])) $agent_edit =entrada_limpia($_POST["agent_edit"]);
if (isset ($_POST["alert_edit"])) $alert_edit = entrada_limpia($_POST["alert_edit"]);
if (isset ($_POST["user_management"])) $user_management = entrada_limpia($_POST["user_management"]);
if (isset ($_POST["db_management"])) $db_management = entrada_limpia($_POST["db_management"]);
if (isset ($_POST["alert_management"])) $alert_management = entrada_limpia($_POST["alert_management"]);
if (isset ($_POST["pandora_management"])) $pandora_management = entrada_limpia($_POST["pandora_management"]);
// update or insert ??
if ($id_perfil == -1) { // INSERT
$query = "INSERT INTO tperfil (name,incident_view,incident_edit,incident_management, agent_view,agent_edit,alert_edit,user_management,db_management,alert_management,pandora_management) VALUES
('".$name."','".$incident_view."','".$incident_edit."','".$incident_management."','".$agent_view."','".$agent_edit."','".$alert_edit."','".$user_management."','".$db_management."','".$alert_management."','".$pandora_management."')";
// echo "DEBUG: ".$query;
$res=mysql_query($query);
if ($res)
echo "<h3 class='suc'>".__('create_profile_ok')."</h3>";
else {
echo "<h3 class='error'>".__('create_profile_no')."</h3>";
}
} else { // UPDATE
$query ="UPDATE tperfil SET
name = '$name',
incident_view = $incident_view,
incident_edit = $incident_edit,
incident_management = $incident_management,
agent_view = $agent_view,
agent_edit = $agent_edit,
alert_edit = $alert_edit,
user_management = $user_management,
db_management = $db_management,
alert_management = $alert_management,
pandora_management = $pandora_management
WHERE id_perfil = $id_perfil ";
// echo "DEBUG: ".$query;
$res=mysql_query($query);
echo "<h3 class='suc'>".__('profile_upd')."</h3>";
}
unset($id_perfil);
}
echo '<h2>'.__('profile_title').' &gt; ';
echo (isset($_GET["new_profile"])) ?
(__('create_profile').'</h2>'):
(
(isset($_GET["edit_profile"]))?
(__('update_profile').'></h2>'):
(__('definedprofiles').'</h2>')
);
// Form to manage date
if (isset ($id_perfil)){ // There are values defined, let's show form with data for INSERT or UPDATE
echo "<table width='400' cellpadding='4' cellspacing='4' class='databox'>";
echo "<tr>";
echo "<form method='post' action='index.php?sec=gperfiles&sec2=godmode/profiles/profile_list&update_data'>";
echo "<input type=hidden name=id_perfil value='".$id_perfil."'>";
echo "
<td class=datos>".__('profile_name')."</td>
<td class=datos>
<input name='name' type=text size='27' value='".$name."'></td></tr>
<tr><td class=datos2>".__('incident_view')."</td>
<td class=datos2>
<input name='incident_view' type=checkbox class='chk' value='1' ";
if ($incident_view == 1) echo "checked"; echo "></td></tr>
<tr><td class=datos>".__('incident_edit')."</td>
<td class=datos>
<input name='incident_edit' type=checkbox class='chk' value='1' ";
if ($incident_edit == 1) echo "checked";echo "></td></tr>
<tr><td class=datos2>".__('manage_incidents')."</td>
<td class=datos2>
<input name='incident_management' type=checkbox class='chk' value='1' ";
if ($incident_management == 1) echo "checked";echo "></td></tr>
<tr><td class=datos>".__('view_agents')."</td>
<td class=datos>
<input name='agent_view' type=checkbox class='chk' value='1' ";
if ($agent_view == 1) echo "checked";echo "></td></tr>
<tr><td class=datos2>".__('agent_edit')."</td>
<td class=datos2>
<input name='agent_edit' type=checkbox class='chk' value='1' ";
if ($agent_edit == 1) echo "checked";echo "></td></tr>
<tr><td class=datos>".__('alert_edit')."</td>
<td class=datos>
<input name='alert_edit' type=checkbox class='chk' value='1' ";
if ($alert_edit == 1) echo "checked";echo "></td></tr>
<tr><td class=datos2>".__('manage_users')."</td>
<td class=datos2>
<input name='user_management' class='chk' type=checkbox value='1' ";
if ($user_management == 1) echo "checked";echo "></td></tr>
<tr><td class=datos>".__('manage_db')."</td>
<td class=datos>
<input name='db_management' class='chk' type=checkbox value='1' ";
if ($db_management == 1) echo "checked";echo "></td></tr>
<tr><td class=datos2>".__('manage_alerts')."</td>
<td class=datos2>
<input name='alert_management' class='chk' type=checkbox value='1' ";
if ($alert_management == 1) echo "checked";echo "></td></tr>
<tr><td class=datos>".__('pandora_management')."</td>
<td class=datos>
<input name='pandora_management' class='chk' type=checkbox value='1' ";
if ($pandora_management == 1) echo "checked";echo "></td></tr>
";
echo "</table>";
echo "<table width='400'>";
echo "<tr><td align='right'>";
if (isset($_GET["new_profile"])){
echo "
<input name='crtbutton' type='submit' class='sub wand' value='".__('create')."'>";
}
if (isset($_GET["edit_profile"])){
echo "
<input name='uptbutton' type='submit' class='sub upd' value='" .__('update')."'>";
}
echo "</td></tr></table>";
} else { // View list data
$color=1;
?>
<table cellpadding='4' cellspacing='4' class='databox' width='750px'>
<?php
$query_del1="SELECT * FROM tperfil";
$resq1=mysql_query($query_del1);
echo "<tr>";
echo "<th width='180px'><font size=1>".__('profiles');
echo "</th><th width='40px'>
<font size=1>IR<a href='#' class='tipp'>&nbsp;<span>".$help_label["IR"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>IW<a href='#' class='tipp'>&nbsp;<span>".$help_label["IW"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>IM<a href='#' class='tipp'>&nbsp;<span>".$help_label["IM"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>AR<a href='#' class='tipp'>&nbsp;<span>".$help_label["AR"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>AW<a href='#' class='tipp'>&nbsp;<span>".$help_label["AW"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>LW<a href='#' class='tipp'>&nbsp;<span>".$help_label["LW"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>UM<a href='#' class='tipp'>&nbsp;<span>".$help_label["UM"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>DM<a href='#' class='tipp'>&nbsp;<span>".$help_label["DM"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>LM<a href='#' class='tipp'>&nbsp;<span>".$help_label["LM"]."</span></a>";
echo "</th><th width='40px'>
<font size=1>PM<a href='#' class='tipp'>&nbsp;<span>".$help_label["PM"]."</span></a>";
echo "</th><th width='40px'>".__('delete')."</th></tr>";
while ($rowdup=mysql_fetch_array($resq1)){
$id_perfil = $rowdup["id_perfil"];
$nombre=$rowdup["name"];
$incident_view = $rowdup["incident_view"];
$incident_edit = $rowdup["incident_edit"];
$incident_management = $rowdup["incident_management"];
$agent_view = $rowdup["agent_view"];
$agent_edit =$rowdup["agent_edit"];
$alert_edit = $rowdup["alert_edit"];
$user_management = $rowdup["user_management"];
$db_management = $rowdup["db_management"];
$alert_management = $rowdup["alert_management"];
$pandora_management = $rowdup["pandora_management"];
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo "<td class='$tdcolor'><a href='index.php?sec=gperfiles&amp;sec2=godmode/profiles/profile_list&amp;edit_profile=".$id_perfil."'><b>".$nombre."</b></a>";
echo "</td><td class='$tdcolor'>";
if ($incident_view == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($incident_edit == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($incident_management == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($agent_view == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($agent_edit == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($alert_edit == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($user_management == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($db_management == 1) echo "<img src='images/ok.png' border=0>";
echo "<td class='$tdcolor'>";
if ($alert_management == 1) echo "<img src='images/ok.png' border=0>";
echo "</td><td class='$tdcolor'>";
if ($pandora_management == 1) echo "<img src='images/ok.png' border=0>";
echo "<td class='$tdcolor' align='center'><a href='index.php?sec=gagente&sec2=godmode/profiles/profile_list&delete_profile=".$id_perfil."' onClick='if (!confirm(\' ".__('are_you_sure')."\')) return false;'><img border='0' src='images/cross.png'></a></td></tr>";
}
echo "</table>";
echo '</tr></table>';
echo '<table width="750">';
echo '<tr><td align="right">';
echo "<form method=post action='index.php?sec=gperfiles&sec2=godmode/profiles/profile_list&new_profile=1'>";
echo "<input type='submit' class='sub next' name='crt' value='".__('create_profile')."'>";
echo "</form></table>";
}
?>

View File

@ -16,6 +16,18 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Login check
require ("include/config.php");
check_login ();
if (! give_acl ($config['id_user'], 0, "AW")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access graph builder");
include ("general/noaccess.php");
exit;
}
$id_agent = 0;
$id_module = 0;
$name = "Pandora FMS combined graph";
@ -30,38 +42,22 @@ $stacked = 0;
$add_module = (bool) get_parameter ('add_module');
// Login check
$id_usuario=$_SESSION["id_usuario"];
global $REMOTE_ADDR;
if (comprueba_login() != 0) {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access graph builder");
include ("general/noaccess.php");
exit;
}
if ((give_acl($id_user,0,"AW") != 1 ) && (dame_admin($id_user)!=1)) {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access graph builder");
include ("general/noaccess.php");
exit;
}
if (isset($_GET["store_graph"])) {
$name = entrada_limpia($_POST["name"]);
$description = entrada_limpia($_POST["description"]);
$module_number = entrada_limpia($_POST["module_number"]);
$private = entrada_limpia($_POST["private"]);
$width = entrada_limpia($_POST["width"]);
$height = entrada_limpia($_POST["height"]);
$events = entrada_limpia($_POST["events"]);
$stacked = get_parameter ("stacked",0);
if (isset ($_GET["store_graph"])) {
$name = get_parameter_post ("name");
$description = get_parameter_post ("description");
$module_number = get_parameter_post ("module_number");
$private = get_parameter_post ("private");
$width = get_parameter_post ("width");
$height = get_parameter_post ("height");
$events = get_parameter_post ("events");
$stacked = get_parameter ("stacked", 0);
if ($events == "") // Temporal workaround
$events = 0;
$period = entrada_limpia($_POST["period"]);
$period = get_parameter_post ("period");
// Create graph
$sql = "INSERT INTO tgraph
(id_user, name, description, period, width, height, private, events, stacked) VALUES
('$id_user',
('".$config['id_user']."',
'$name',
'$description',
$period,
@ -76,52 +72,52 @@ if (isset($_GET["store_graph"])) {
$id_graph = mysql_insert_id();
if ($id_graph){
for ($a=0; $a < $module_number; $a++){
$id_agentemodulo = entrada_limpia($_POST["module_".$a]);
$id_agentemodulo_w = entrada_limpia($_POST["module_weight_".$a]);
$id_agentemodulo = get_parameter_post ("module_".$a);
$id_agentemodulo_w = get_parameter_post ("module_weight_".$a);
$sql = "INSERT INTO tgraph_source (id_graph, id_agent_module, weight) VALUES
($id_graph, $id_agentemodulo, $id_agentemodulo_w)";
//echo "DEBUG $sql<br>";
mysql_query($sql);
}
echo "<h3 class='suc'>".$lang_label["store_graph_suc"]."</h3>";
echo "<h3 class='suc'>".__('store_graph_suc')."</h3>";
} else
echo "<h3 class='error'>".$lang_label["store_graph_error"]."</h3>";
echo "<h3 class='error'>".__('store_graph_error')."</h3>";
} else
echo "<h3 class='error'>".$lang_label["store_graph_error"]."</h3>";
echo "<h3 class='error'>".__('store_graph_error')."</h3>";
}
if (isset($_GET["get_agent"])) {
if (isset ($_GET["get_agent"])) {
$id_agent = $_POST["id_agent"];
if (isset($_POST["chunk"]))
$chunkdata = $_POST["chunk"];
}
if (isset($_GET["delete_module"] )) {
if (isset ($_GET["delete_module"] )) {
$chunkdata = $_POST["chunk"];
if (isset($chunkdata)) {
$chunk1 = array();
$chunk1 = split ("\|", $chunkdata);
$modules="";$weights="";
for ($a=0; $a < count($chunk1); $a++){
if (isset($_POST["delete_$a"])){
for ($a = 0; $a < count ($chunk1); $a++) {
if (isset ($_POST["delete_$a"])) {
$id_module = $_POST["delete_$a"];
$deleted_id[]=$id_module;
}
}
$chunkdata2 = "";
$module_array = array();
$weight_array = array();
$agent_array = array();
for ($a=0; $a < count($chunk1); $a++){
$module_array = array ();
$weight_array = array ();
$agent_array = array ();
for ($a = 0; $a < count ($chunk1); $a++) {
$chunk2[$a] = array();
$chunk2[$a] = split ( ",", $chunk1[$a]);
$chunk2[$a] = split (",", $chunk1[$a]);
$skip_module =0;
for ($b=0; $b < count($deleted_id); $b++){
if ($deleted_id[$b] == $chunk2[$a][1]){
for ($b = 0; $b < count ($deleted_id); $b++) {
if ($deleted_id[$b] == $chunk2[$a][1]) {
$skip_module = 1;
}
}
if (($skip_module == 0) && (strpos($modules, $chunk2[$a][1]) == 0)){ // Skip
if (($skip_module == 0) && (strpos ($modules, $chunk2[$a][1]) == 0)) { // Skip
$module_array[] = $chunk2[$a][1];
$agent_array[] = $chunk2[$a][0];
$weight_array[] = $chunk2[$a][2];
@ -172,7 +168,7 @@ if ($add_module) {
// Parse CHUNK information into showable information
// Split id to get all parameters
if (! isset($_GET["delete_module"])){
if (! isset($_GET["delete_module"])) {
if (isset($_POST["period"]))
$period = $_POST["period"];
if ((isset($chunkdata) )&& ($chunkdata != "")) {
@ -202,9 +198,9 @@ if (! isset($_GET["delete_module"])){
}
}
echo "<h2>".$lang_label["reporting"]." &gt; ";
if (isset($chunk1)) {
echo $lang_label["graph_builder_modulelist"]."</h2>";
echo "<h2>".__('reporting')." &gt; ";
if (isset ($chunk1)) {
echo __('graph_builder_modulelist')."</h2>";
echo "<form method='post' action='index.php?sec=greporting&sec2=godmode/reporting/graph_builder&delete_module=1'>";
if (isset($chunkdata))
echo "<input type='hidden' name='chunk' value='$chunkdata'>";
@ -215,10 +211,10 @@ if (isset($chunk1)) {
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox'>";
echo "<tr>
<th>".$lang_label["agent"]."</th>
<th>".$lang_label["module"]."</th>
<th>".__('agent')."</th>
<th>".__('module')."</th>
<th>Weight</th>
<th>".$lang_label["delete"]."</th>";
<th>".__('delete')."</th>";
$color=0;
for ($a=0; $a < count($module_array); $a++){
// Calculate table line color
@ -242,7 +238,7 @@ if (isset($chunk1)) {
}
echo "</table>";
echo "<table width='500px'>";
echo "<tr><td align='right'><input type=submit name='update_agent' class='sub delete' value='".$lang_label["delete"]."'>";
echo "<tr><td align='right'><input type=submit name='update_agent' class='sub delete' value='".__('delete')."'>";
echo "</table>";
echo "</form>";
}
@ -252,7 +248,7 @@ if (isset($chunk1)) {
// --------------------------------------
if (($render == 1) && (isset($modules))) {
// parse chunk
echo "<h3>".$lang_label["combined_image"]."</h3>";
echo "<h3>".__('combined_image')."</h3>";
echo "<table class='databox'>";
echo "<tr><td>";
echo "<img src='reporting/fgraph.php?tipo=combined&id=$modules&weight_l=$weights&label=Combined%20Sample%20Graph&height=$height&width=$width&stacked=$stacked&period=$period' border=1 alt=''>";
@ -265,9 +261,9 @@ if (($render == 1) && (isset($modules))) {
// -----------------------
if ($add_module) {
echo $lang_label["graph_builder"]."</h2>";
echo __('graph_builder')."</h2>";
} else {
echo "<h3>".$lang_label["graph_builder"]."</h3>";
echo "<h3>".__('graph_builder')."</h3>";
}
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox_color'>";
echo "<form method='post' action='index.php?sec=greporting&sec2=godmode/reporting/graph_builder'>";
@ -276,7 +272,7 @@ if (isset($period))
echo "<input type='hidden' name='period' value='$period'>";
echo "<tr>";
echo "<td class='datos'><b>".$lang_label["source_agent"]."</td>";
echo "<td class='datos'><b>".__('source_agent')."</td>";
echo "</b>";
// Show combo with agents
@ -289,7 +285,7 @@ if (isset ($chunkdata))
echo "<input type='hidden' name='chunk' value='$chunkdata'>";
echo "<tr><td class='datos2'>";
echo "<b>".$lang_label["modules"]."</b>";
echo "<b>".__('modules')."</b>";
echo "<td class='datos2' colspan=3>";
echo "<select id='id_module' name='id_module' size=1 style='width:180px;'>";
echo "<option value=-1> -- </option>";
@ -304,17 +300,17 @@ if ($id_agent != 0){
echo "</select>";
echo "<tr><td class='datos'>";
echo "<b>".$lang_label["Factor"]."</b></td>";
echo "<b>".__('Factor')."</b></td>";
echo "<td class='datos'>";
echo "<input type='text' name='factor' value='$factor' size=6></td>";
echo "<td class='datos'>";
echo "<b>".$lang_label["width"]."</b>";
echo "<b>".__('width')."</b>";
echo "<td class='datos'>";
echo "<input type='text' name='width' value='$width' size=6></td>";
echo "<tr><td class='datos2'>";
echo "<b>".$lang_label["render_now"]."</b></td>";
echo "<b>".__('render_now')."</b></td>";
echo "<td class='datos2'>";
echo "<select name='render'>";
if ($render == 1){
@ -326,7 +322,7 @@ if ($render == 1){
}
echo "</select></td>";
echo "<td class='datos2'>";
echo "<b>".$lang_label["height"]."</b></td>";
echo "<b>".__('height')."</b></td>";
echo "<td class='datos2'>";
echo "<input type='text' name='height' value='$height' size=6>";
@ -380,7 +376,7 @@ switch ($period) {
echo "<tr><td class='datos'>";
echo "<b>".$lang_label["period"]."</b></td>";
echo "<b>".__('period')."</b></td>";
echo "<td class='datos'>";
echo "<select name='period'>";
@ -404,7 +400,7 @@ echo "<option value=15552000>"."Six Months</option>";
echo "</select>";
echo "<td class='datos'>";
echo "<b>".$lang_label["view_events"]."</b></td>";
echo "<b>".__('view_events')."</b></td>";
echo "<td class='datos'>";
echo "<select name='events'>";
if ($events == 1){
@ -418,13 +414,13 @@ echo "</select></td>";
echo "<tr>";
echo "<td class='datos2'>";
echo "<b>".lang_string ("Stacked")."</b></td>";
echo "<b>".__('Stacked')."</b></td>";
echo "<td class='datos2'>";
$stackeds[0] = lang_string ('Area');
$stackeds[1] = lang_string ('Stacked area');
$stackeds[2] = lang_string ('Line');
$stackeds[0] = __('Area');
$stackeds[1] = __('Stacked area');
$stackeds[2] = __('Line');
print_select ($stackeds, 'stacked', $stacked, '', '', 0);
echo "</td>";
@ -447,7 +443,7 @@ echo "</select>";
echo "</tr></table>";
echo "<table width='500px'>";
echo "<tr><td align='right'><input type=submit name='update_agent' class='sub upd' value='".$lang_label["add"]."/".$lang_label["redraw"]."'>";
echo "<tr><td align='right'><input type=submit name='update_agent' class='sub upd' value='".__('add')."/".__('redraw')."'>";
echo "</form>";
echo "</td></tr></table>";
@ -458,7 +454,7 @@ echo "</td></tr></table>";
// If we have something to save..
if (isset($module_array)){
echo "<h3>".$lang_label["graph_store"]."</h3>";
echo "<h3>".__('graph_store')."</h3>";
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox_color'>";
echo "<form method='post' action='index.php?sec=greporting&sec2=godmode/reporting/graph_builder&store_graph=1'>";
@ -479,25 +475,25 @@ if (isset($module_array)){
// hidden fields end
echo "<tr>";
echo "<td class='datos'><b>".$lang_label["name"]."</b></td>";
echo "<td class='datos'><b>".__('name')."</b></td>";
echo "</b>";
echo "<td class='datos'><input type='text' name='name' size='35'>";
echo "<td class='datos'><b>".$lang_label["private"]."</b></td>";
echo "<td class='datos'><b>".__('private')."</b></td>";
echo "</b>";
echo "<td class='datos'><select name='private'>";
echo "<option value=0>".$lang_label["no"]."</option>";
echo "<option value=1>".$lang_label["yes"]."</option>";
echo "<option value=0>".__('no')."</option>";
echo "<option value=1>".__('yes')."</option>";
echo "</select>";
echo "</td></tr>";
echo "<tr>";
echo "<td class='datos2'><b>".$lang_label["description"]."</b></td>";
echo "<td class='datos2'><b>".__('description')."</b></td>";
echo "</b>";
echo "<td class='datos2' colspan=4><textarea name='description' style='height:45px;' cols=55 rows=2>";
echo "</textarea>";
echo "</td></tr></table>";
echo "<table width='500px'>";
echo "<tr><td align='right'><input type=submit name='store' class='sub wand' value='".$lang_label["store"]."'>";
echo "<tr><td align='right'><input type=submit name='store' class='sub wand' value='".__('store')."'>";
echo "</form>";

View File

@ -65,10 +65,10 @@ if ($create_layout) {
$name, $id_group, $background, $height, $width);
$result = mysql_query ($sql);
if ($result) {
echo '<h3 class="suc">'.lang_string ("create_ok").'</h3>';
echo '<h3 class="suc">'.__('create_ok').'</h3>';
$id_layout = mysql_insert_id ();
} else {
echo '<h3 class="err">'.lang_string ("create_no").'</h3>';
echo '<h3 class="err">'.__('create_no').'</h3>';
}
if (defined ('AJAX')) {
exit;
@ -81,9 +81,9 @@ if ($delete_layout) {
$sql = sprintf ('DELETE FROM tlayout WHERE id = %d', $id_layout);
$result = mysql_query ($sql);
if ($result) {
echo '<h3 class="suc">'.lang_string ("delete_ok").'</h3>';
echo '<h3 class="suc">'.__('delete_ok').'</h3>';
} else {
echo '<h3 class="err">'.lang_string ("delete_no").'</h3>';
echo '<h3 class="err">'.__('delete_no').'</h3>';
}
$id_layout = 0;
}
@ -108,9 +108,9 @@ if ($update_layout) {
$name, $background, $height, $width, $id_layout);
$result = mysql_query ($sql);
if ($result) {
echo '<h3 class="suc">'.lang_string ("update_ok").'</h3>';
echo '<h3 class="suc">'.__('update_ok').'</h3>';
} else {
echo '<h3 class="err">'.lang_string ("update_no").'</h3>';
echo '<h3 class="err">'.__('update_no').'</h3>';
}
if (defined ('AJAX')) {
exit;
@ -165,9 +165,9 @@ if ($create_layout_data) {
$result = mysql_query ($sql);
if ($result) {
echo '<h3 class="suc">'.lang_string ("create_ok").'</h3>';
echo '<h3 class="suc">'.__('create_ok').'</h3>';
} else {
echo '<h3 class="error">'.lang_string ("create_no").'</h3>';
echo '<h3 class="error">'.__('create_no').'</h3>';
}
if (defined ('AJAX')) {
exit;
@ -239,9 +239,9 @@ if ($update_layout_data) {
$result = mysql_query ($sql);
if ($result) {
echo '<h3 class="suc">'.lang_string ("modify_ok").'</h3>';
echo '<h3 class="suc">'.__('modify_ok').'</h3>';
} else {
echo '<h3 class="error">'.lang_string ("modify_no").'</h3>';
echo '<h3 class="error">'.__('modify_no').'</h3>';
}
}
@ -255,14 +255,14 @@ if ($id_layout) {
}
if (! $edit_layout && ! $id_layout) {
echo "<h2>".lang_string ("reporting")." &gt; ".lang_string ("map_builder")."</h2>";
echo "<h2>".__('reporting')." &gt; ".__('map_builder')."</h2>";
$table->width = '500px';
$table->data = array ();
$table->head = array ();
$table->head[0] = lang_string ('map_name');
$table->head[1] = lang_string ('group');
$table->head[2] = lang_string ('delete');
$table->head[0] = __('map_name');
$table->head[1] = __('group');
$table->head[2] = __('delete');
$table->align = array ();
$table->align[2] = 'center';
@ -282,12 +282,12 @@ if (! $edit_layout && ! $id_layout) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
echo '<form action="index.php?sec=greporting&sec2=godmode/reporting/map_builder" method="post">';
print_input_hidden ('edit_layout', 1);
print_submit_button (lang_string ('create'), '', false, 'class="sub wand"');
print_submit_button (__('create'), '', false, 'class="sub wand"');
echo '</form>';
echo '</div>';
} else {
echo "<h2>".lang_string ("reporting")." &gt; ";
echo lang_string ("map_builder");
echo "<h2>".__('reporting')." &gt; ";
echo __('map_builder');
pandora_help ("map_builder");
echo "</h2>";
@ -297,17 +297,17 @@ if (! $edit_layout && ! $id_layout) {
$table->width = '300px';
$table->data = array ();
$table->data[0][0] = lang_string ('name');
$table->data[0][0] = __('name');
$table->data[0][1] = print_input_text ('name', $name, '', 15, 50, true);
$table->data[1][0] = lang_string ('group');
$table->data[1][0] = __('group');
$table->data[1][1] = print_select ($groups, 'id_group', $id_group, '', '', '', true);
$table->data[2][0] = lang_string ('background');
$table->data[2][0] = __('background');
$table->data[2][1] = print_select ($backgrounds_list, 'background', $background, '', 'None', '', true);
if ($id_layout) {
$table->data[3][0] = lang_string ('width');
$table->data[3][0] = __('width');
$table->data[3][1] = print_input_text ('width', $width, '', 3, 5, true);
$table->data[4][0] = lang_string ('height');
$table->data[4][0] = __('height');
$table->data[4][1] = print_input_text ('height', $height, '', 3, 5, true);
}
echo '<form action="index.php?sec=greporting&sec2=godmode/reporting/map_builder" method="post">';
@ -315,11 +315,11 @@ if (! $edit_layout && ! $id_layout) {
echo '<div style="width: '.$table->width.'" class="action-buttons">';
if ($id_layout) {
print_submit_button (lang_string ('update'), 'update_layout', false, 'class="sub upd"');
print_submit_button (__('update'), 'update_layout', false, 'class="sub upd"');
print_input_hidden ('update_layout', 1);
print_input_hidden ('id_layout', $id_layout);
} else {
print_submit_button (lang_string ('create'), 'create_layout', false, 'class="sub wand"');
print_submit_button (__('create'), 'create_layout', false, 'class="sub wand"');
print_input_hidden ('create_layout', 1);
}
echo '</div>';
@ -327,7 +327,7 @@ if (! $edit_layout && ! $id_layout) {
if ($id_layout) {
/* Show visual map preview */
echo '<h1>'.lang_string ('preview').'</h1>';
echo '<h1>'.__('preview').'</h1>';
print_pandora_visual_map ($id_layout, false, true);
$images_list = array ();
@ -345,32 +345,32 @@ if (! $edit_layout && ! $id_layout) {
/* Layout data trash */
echo '<form id="form_layout_data_trash" action="" method="post">';
echo '<div id="layout_trash_drop">';
echo '<h1>'.lang_string ('Map element trash').'</h1>';
echo lang_string ('Drag an element here to delete from the map');
echo '<h1>'.__('Map element trash').'</h1>';
echo __('Drag an element here to delete from the map');
echo '<span id="elements"> </span>';
print_input_hidden ('delete_layout_data', 1);
print_input_hidden ('id_layout', $id_layout);
echo '<div class="action-buttons" style="margin-top: 180px">';
print_submit_button (lang_string ('delete'), 'delete_buttons', true, 'class="sub delete"');
print_submit_button (__('delete'), 'delete_buttons', true, 'class="sub delete"');
echo '</div>';
echo '</div>';
echo '</form>';
/* Layout_data editor form */
$intervals = array ();
$intervals[1] = lang_string ('Hour');
$intervals[2] = "2 ".lang_string ('Hours');
$intervals[3] = "3 ".lang_string ('Hours');
$intervals[6] = "6 ".lang_string ('Hours');
$intervals[12] = "12 ".lang_string ('Hours');
$intervals[24] = lang_string ('Last day');
$intervals[48] = "2 ". lang_string ('days');
$intervals[168] = lang_string ('Last week');
$intervals[360] = lang_string ('15 days');
$intervals[720] = lang_string ('Last Month');
$intervals[1440] = lang_string ('Two Months');
$intervals[4320] = lang_string ('Six Months');
$intervals[1] = __('Hour');
$intervals[2] = "2 ".__('Hours');
$intervals[3] = "3 ".__('Hours');
$intervals[6] = "6 ".__('Hours');
$intervals[12] = "12 ".__('Hours');
$intervals[24] = __('Last day');
$intervals[48] = "2 ". __('days');
$intervals[168] = __('Last week');
$intervals[360] = __('15 days');
$intervals[720] = __('Last Month');
$intervals[1440] = __('Two Months');
$intervals[4320] = __('Six Months');
$all_agents = get_agents_in_group ($id_group);
$agents = array ();
@ -382,8 +382,8 @@ if (! $edit_layout && ! $id_layout) {
}
echo '<div id="layout_editor_drop">';
echo '<h1>'.lang_string ('Map element editor').'</h1>';
echo lang_string ('Drag an element here to edit the properties');
echo '<h1>'.__('Map element editor').'</h1>';
echo __('Drag an element here to edit the properties');
$table->data = array ();
$table->id = 'table_layout_data';
@ -391,29 +391,29 @@ if (! $edit_layout && ! $id_layout) {
$table->rowstyle[3] = 'display: none';
$table->rowstyle[4] = 'display: none';
$table->data[0][0] = lang_string ('label');
$table->data[0][0] = __('label');
$table->data[0][1] = print_input_text ('label', '', '', 20, 200, true);
$table->data[1][0] = lang_string ('label_color');
$table->data[1][0] = __('label_color');
$table->data[1][1] = print_input_text ('label_color', '#000000', '', 7, 7, true);
$table->data[2][0] = lang_string ('type');
$table->data[2][0] = __('type');
$table->data[2][1] = print_select (get_layout_data_types (), 'type', '', '', '', '', true);
$table->data[3][0] = lang_string ('height');
$table->data[3][0] = __('height');
$table->data[3][1] = print_input_text ('height', '', '', 5, 5, true);
$table->data[4][0] = lang_string ('width');
$table->data[4][0] = __('width');
$table->data[4][1] = print_input_text ('width', '', '', 5, 5, true);
$table->data[5][0] = lang_string ('agent');
$table->data[5][0] = __('agent');
$table->data[5][1] = print_select ($agents, 'agent', '', '', '--', 0, true);
$table->data[6][0] = lang_string ('module');
$table->data[6][0] = __('module');
$table->data[6][1] = print_select (array (), 'module', '', '', '--', 0, true);
$table->data[7][0] = lang_string ('period');
$table->data[7][0] = __('period');
$table->data[7][1] = print_select ($intervals, 'period', '', '', '--', 0, true);
$table->data[8][0] = lang_string ('image');
$table->data[8][0] = __('image');
$table->data[8][1] = print_select ($images_list, 'image', '', '', 'None', '', true);
$table->data[8][1] .= '<div id="image_preview"> </div>';
$table->data[9][0] = lang_string ('parent');
$table->data[9][0] = __('parent');
$table->data[9][1] = print_select_from_sql ('SELECT id, label FROM tlayout_data WHERE id_layout = '.$id_layout,
'parent_item', '', '', 'None', '', true);
$table->data[10][0] = lang_string ('map_linked');
$table->data[10][0] = __('map_linked');
$table->data[10][1] = print_select_from_sql ('SELECT id, name FROM tlayout WHERE id != '.$id_layout,
'map_linked', '', '', 'None', '', true);
@ -424,7 +424,7 @@ if (! $edit_layout && ! $id_layout) {
print_input_hidden ('id_layout', $id_layout);
print_input_hidden ('id_layout_data', 0);
echo '<div style="width: '.$table->width.'" class="action-buttons">';
print_submit_button (lang_string ('create'), 'create_layout_data_button', false, 'class="sub wand"');
print_submit_button (__('create'), 'create_layout_data_button', false, 'class="sub wand"');
echo '</div>';
echo '</form>';
echo '</div>';
@ -449,7 +449,7 @@ function agent_changed (event, id_agent, selected) {
id_agent = this.value;
$('#form_layout_data_editor #module').attr ('disabled', 1);
$('#form_layout_data_editor #module').empty ();
$('#form_layout_data_editor #module').append (new Option ("<?=lang_string ('Loading')?>...", 0));
$('#form_layout_data_editor #module').append (new Option ("<?=__('Loading')?>...", 0));
jQuery.post ('ajax.php',
{page: "operation/agentes/ver_agente",
get_agent_modules_json: 1,
@ -552,7 +552,7 @@ $(document).ready (function () {
$("#form_layout_data_editor #hidden-update_layout_data").attr ('value', 1);
$("#form_layout_data_editor #hidden-create_layout_data").attr ('value', 0);
$("#form_layout_data_editor #hidden-id_layout_data").attr ('value', id);
$("#form_layout_data_editor #submit-create_layout_data_button").attr ('value', "<?=lang_string ('update')?>").removeClass ('wand').addClass ('upd');
$("#form_layout_data_editor #submit-create_layout_data_button").attr ('value', "<?=__('update')?>").removeClass ('wand').addClass ('upd');
$("#form_layout_data_editor #text-label_color").attr ('value', data['label_color']);
$(".ColorPickerDivSample").css ('background-color', data['label_color']);
agent_changed (null, data['id_agent'], data['id_agente_modulo']);

View File

@ -17,11 +17,13 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Login check
$id_user=$_SESSION["id_usuario"];
global $REMOTE_ADDR;
require ("include/config.php");
if (give_acl ($id_user, 0, "AW") != 1 && dame_admin ($id_user) != 1) {
audit_db ($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access graph builder");
check_login ();
if (! give_acl ($config['id_user'], 0, "AW")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access graph builder");
include ("general/noaccess.php");
exit;
}
@ -68,9 +70,9 @@ if ($delete_report_content) {
$sql = sprintf ('DELETE FROM treport_content WHERE id_rc = %d', $id_report_content);
$result = mysql_query ($sql);
if ($result)
echo "<h3 class='suc'>".lang_string ('delete_ok')."</h3>";
echo "<h3 class='suc'>".__('delete_ok')."</h3>";
else
echo "<h3 class='error'>".lang_string ('delete_no')."</h3>";
echo "<h3 class='error'>".__('delete_no')."</h3>";
}
// Move content up
@ -104,16 +106,16 @@ if ($delete_report) {
$res = mysql_query ($sql);
$res2 = mysql_query ($sql2);
if ($res AND $res2)
echo "<h3 class=suc>".lang_string ('delete_reporting_ok')."</h3>";
echo "<h3 class=suc>".__('delete_reporting_ok')."</h3>";
else
echo "<h3 class=error>".lang_string ('delete_reporting_no')."</h3>";
echo "<h3 class=error>".__('delete_reporting_no')."</h3>";
$id_report = 0;
}
// Add module SQL code
if ($add_content) {
if (! $id_report) {
audit_db($id_user,$REMOTE_ADDR, "Hack attempt","Parameter trash in report builder");
audit_db ($config['id_user'], $REMOTE_ADDR, "Hack attempt", "Parameter trash in report builder");
include ("general/noaccess.php");
exit ();
}
@ -131,7 +133,7 @@ if ($add_content) {
$id_agent_module ? $id_agent_module : "NULL",
$order, $type, $period * 3600);
if ($result = mysql_query($sql)) {
echo '<h3 class="suc">'.lang_string ('create_reporting_ok').'</h3>';
echo '<h3 class="suc">'.__('create_reporting_ok').'</h3>';
$id_agent = 0;
$id_agent_module = 0;
$report_id_group = 0;
@ -142,7 +144,7 @@ if ($add_content) {
$sla_min = 0;
$sla_limit = 0;
} else {
echo '<h3 class="error">'.lang_string ('create_reporting_no')."</h3>";
echo '<h3 class="error">'.__('create_reporting_no')."</h3>";
/* Do not unset so the values are kept in the form */
}
}
@ -154,9 +156,9 @@ if ($create_report) {
$report_name, $report_description, $config['id_user'], $report_private, $report_id_group);
$result = mysql_query ($sql);
if ($result)
echo "<h3 class=suc>".lang_string ('create_reporting_ok')."</h3>";
echo "<h3 class=suc>".__('create_reporting_ok')."</h3>";
else
echo "<h3 class=error>".lang_string ('create_reporting_no')."</h3>";
echo "<h3 class=error>".__('create_reporting_no')."</h3>";
$id_report = mysql_insert_id ();
}
@ -169,9 +171,9 @@ if ($update_report) {
$report_private, $id_report);
$result = mysql_query ($sql);
if ($result)
echo "<h3 class=suc>".lang_string ('modify_ok')."</h3>";
echo "<h3 class=suc>".__('modify_ok')."</h3>";
else
echo "<h3 class=error>".lang_string ('modify_no')."</h3>";
echo "<h3 class=error>".__('modify_no')."</h3>";
}
if ($id_report) {
@ -214,11 +216,11 @@ if ($edit_sla_report_content) {
if ($id_module) {
$result = mysql_query ($sql);
if ($result)
echo "<h3 class=suc>".lang_string ('add_sla_ok')."</h3>";
echo "<h3 class=suc>".__('add_sla_ok')."</h3>";
else
echo "<h3 class=error>".lang_string ('add_sla_no')."</h3>";
echo "<h3 class=error>".__('add_sla_no')."</h3>";
} else {
echo "<h3 class=error>".lang_string ('sla_module_is_null')."</h3>";
echo "<h3 class=error>".__('sla_module_is_null')."</h3>";
}
}
if ($delete_sla) {
@ -226,18 +228,18 @@ if ($edit_sla_report_content) {
$sql = sprintf ('DELETE FROM treport_content_sla_combined WHERE id = %d', $id_sla);
$result = mysql_query ($sql);
if ($result)
echo "<h3 class=suc>".lang_string ('delete_sla_ok')."</h3>";
echo "<h3 class=suc>".__('delete_sla_ok')."</h3>";
else
echo "<h3 class=error>".lang_string ('delete_sla_no')."</h3>";
echo "<h3 class=error>".__('delete_sla_no')."</h3>";
}
$report_content = get_db_row ('treport_content', 'id_rc', $id_report_content);
/* Show all SLAs defined in the report content */
echo '<h2>'.lang_string ('reporting')." &gt; ";
echo lang_string ('custom_reporting_builder')." &gt; ";
echo '<h2>'.__('reporting')." &gt; ";
echo __('custom_reporting_builder')." &gt; ";
echo '<a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&edit_report=1&id_report='.
$id_report.'">'.$report['name'].'</a></h2>';
echo '<h2>'.lang_string ('defined_slas')."</h2>";
echo '<h2>'.__('defined_slas')."</h2>";
$table->id = 'table-sla-list';
$table->width = '500px';
@ -245,12 +247,12 @@ if ($edit_sla_report_content) {
$table->align[5] = 'center';
$table->data = array ();
$table->head = array ();
$table->head[0] = lang_string ('agent');
$table->head[1] = lang_string ('module');
$table->head[2] = lang_string ('sla_min');
$table->head[3] = lang_string ('sla_max');
$table->head[4] = lang_string ('sla_limit');
$table->head[5] = lang_string ('delete');
$table->head[0] = __('agent');
$table->head[1] = __('module');
$table->head[2] = __('sla_min');
$table->head[3] = __('sla_max');
$table->head[4] = __('sla_limit');
$table->head[5] = __('delete');
$slas = get_db_all_rows_field_filter ('treport_content_sla_combined', 'id_report_content', $id_report_content);
foreach ($slas as $sla) {
@ -272,7 +274,7 @@ if ($edit_sla_report_content) {
print_table ($table);
}
echo "<h2>".lang_string ('sla_construction')."</h2>";
echo "<h2>".__('sla_construction')."</h2>";
$table->id = 'table-add-sla';
$table->width = '500px';
$table->data = array ();
@ -281,15 +283,15 @@ if ($edit_sla_report_content) {
$table->size[0] = '150px';
$table->head = array ();
$table->style[0] = 'font-weight: bold';
$table->data[0][0] = lang_string ('agent');
$table->data[0][0] = __('agent');
$table->data[0][1] = print_select ($agents, 'id_agent', 0, '', '--', 0, true);
$table->data[1][0] = lang_string ('module');
$table->data[1][0] = __('module');
$table->data[1][1] = print_select (array (), 'id_module', 0, '', '--', 0, true);
$table->data[2][0] = lang_string ('sla_min');
$table->data[2][0] = __('sla_min');
$table->data[2][1] = print_input_text ('sla_min', $sla_min, '', 5, 10, true);
$table->data[3][0] = lang_string ('sla_max');
$table->data[3][0] = __('sla_max');
$table->data[3][1] = print_input_text ('sla_max', $sla_max, '', 5, 10, true);
$table->data[4][0] = lang_string ('sla_limit');
$table->data[4][0] = __('sla_limit');
$table->data[4][1] = print_input_text ('sla_limit', $sla_limit, '', 5, 10, true);
echo '<form method="post" action="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&id_report='.
@ -299,7 +301,7 @@ if ($edit_sla_report_content) {
print_input_hidden ('edit_sla_report_content', 1);
print_input_hidden ('id_report_content', $id_report_content);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
print_submit_button (lang_string ('create'), 'add', false, 'class="sub wand"');
print_submit_button (__('create'), 'add', false, 'class="sub wand"');
echo '</div>';
echo '</form>';
} else if ($edit_report || $id_report) {
@ -308,17 +310,17 @@ if ($edit_sla_report_content) {
$id_agent = $_POST["id_agent"];
else
$id_agent = 0;
echo "<h2>".lang_string ('reporting')." &gt; ";
echo lang_string ('custom_reporting_builder')."</h2>";
echo "<h2>".__('reporting')." &gt; ";
echo __('custom_reporting_builder')."</h2>";
$table->id = 'table-edit-report';
$table->width = '500px';
$table->data = array ();
$table->style = array ();
$table->style[0] = 'font-weight: bold';
$table->data[0][0] = lang_string ('report_name');
$table->data[0][0] = __('report_name');
$table->data[0][1] = print_input_text ('report_name', $report_name, '', 35, 150, true);
$table->data[1][0] = lang_string ('group');
$table->data[1][0] = __('group');
if ($report_id_group) {
/* Changing the group is not allowed. */
$table->data[1][1] = '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.
@ -332,9 +334,9 @@ if ($edit_sla_report_content) {
$table->data[1][1] .= '<img src="images/groups_small/'.dame_grupo_icono ($report_id_group).'.png" />';
}
$table->data[1][1] .= '</span>';
$table->data[2][0] = lang_string ('private');
$table->data[2][0] = __('private');
$table->data[2][1] = print_checkbox ('report_private', 1, $report_private, true);
$table->data[3][0] = lang_string ('description');
$table->data[3][0] = __('description');
$table->data[3][1] = print_textarea ('report_description', 3, 40, $report_description, '', true);
echo "<form method='post' action='index.php?sec=greporting&sec2=godmode/reporting/reporting_builder'>";
@ -345,17 +347,17 @@ if ($edit_sla_report_content) {
if ($id_report) {
print_input_hidden ('id_report', $id_report);
print_input_hidden ('update_report', 1);
print_submit_button (lang_string ('update'), 'submit', false, 'class="sub next"');
print_submit_button (__('update'), 'submit', false, 'class="sub next"');
} else {
print_input_hidden ('create_report', 1);
print_submit_button (lang_string ('create'), 'submit', false, 'class="sub wand"');
print_submit_button (__('create'), 'submit', false, 'class="sub wand"');
}
echo "</div>";
echo "</form>";
if ($id_report) {
// Part 2 - Add new items to report
echo "<h2>".lang_string ('reporting_item_add')."</h2>";
echo "<h2>".__('reporting_item_add')."</h2>";
/* We're reusing some $table attributes */
$table->id = 'table-add-item';
@ -367,29 +369,29 @@ if ($edit_sla_report_content) {
$table->size[0] = '200px';
$table->data = array ();
$table->data[0][0] = lang_string ('reporting_type');
$table->data[0][0] = __('reporting_type');
$types = get_report_types ();
asort ($types);
$table->data[0][1] = print_select ($types, 'type', -1, '', '--', -1, true);
$table->data[1][0] = lang_string ('period');
$table->data[1][0] = __('period');
$periods = array ();
$periods[1] = lang_string ('hour');
$periods[2] = '2 '.lang_string ('hours');
$periods[3] = '3 '.lang_string ('hours');
$periods[6] = '6 '.lang_string ('hours');
$periods[12] = '12 '.lang_string ('hours');
$periods[24] = lang_string ('last_day');
$periods[48] = lang_string ('two_days');
$periods[180] = lang_string ('last_week');
$periods[360] = lang_string ('last_two_weeks');
$periods[720] = lang_string ('last_month');
$periods[4320] = lang_string ('six_months');
$periods[1] = __('hour');
$periods[2] = '2 '.__('hours');
$periods[3] = '3 '.__('hours');
$periods[6] = '6 '.__('hours');
$periods[12] = '12 '.__('hours');
$periods[24] = __('last_day');
$periods[48] = __('two_days');
$periods[180] = __('last_week');
$periods[360] = __('last_two_weeks');
$periods[720] = __('last_month');
$periods[4320] = __('six_months');
$table->data[1][1] = print_select ($periods, 'period', 0, '', '--', 0, true);
$table->data[2][0] = lang_string ('source_agent');
$table->data[2][0] = __('source_agent');
$table->data[2][1] = print_select ($agents, 'id_agent', $id_agent, '', '--', 0, true);
$table->data[3][0] = lang_string ('module');
$table->data[3][0] = __('module');
$modules = array ();
if ($id_agent) {
$sql = sprintf ('SELECT id_agente_modulo, LOWER(nombre) FROM tagente_modulo WHERE id_agente = %d ORDER BY nombre', $id_agent);
@ -397,7 +399,7 @@ if ($edit_sla_report_content) {
}
$table->data[3][1] = print_select ($modules, 'id_module', 0, '', '--', 0, true);
$table->data[4][0] = lang_string ('custom_graph_name');
$table->data[4][0] = __('custom_graph_name');
$table->data[4][1] = print_select_from_sql ('SELECT id_graph, name FROM tgraph',
'id_custom_graph', 0, '', '--', 0, true);
@ -406,30 +408,30 @@ if ($edit_sla_report_content) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
print_input_hidden ('add_content', 1);
print_input_hidden ('id_report', $id_report);
print_submit_button (lang_string ('add'), 'add', false, 'class="sub wand"');
print_submit_button (__('add'), 'add', false, 'class="sub wand"');
echo "</div>";
echo "</form>";
// Part 3 - List of already assigned report items
echo "<h2>".lang_string ('report_items')."</h2>";
echo "<h2>".__('report_items')."</h2>";
$table->id = 'table-assigned-reports';
$table->width = '90%';
$table->data = array ();
$table->head = array ();
$table->size = array ();
$table->rowstyle = array ();
$table->head[0] = lang_string ('order');
$table->head[1] = lang_string ('type');
$table->head[2] = lang_string ('agent');
$table->head[3] = lang_string ('module');
$table->head[4] = lang_string ('period');
$table->head[5] = lang_string ('Options');
$table->head[0] = __('order');
$table->head[1] = __('type');
$table->head[2] = __('agent');
$table->head[3] = __('module');
$table->head[4] = __('period');
$table->head[5] = __('Options');
$table->align = array ();
$table->align[0] = 'center';
$table->align[5] = 'center';
if ($report_id_user == $config['id_user']) {
$table->align[6] = 'center';
$table->head[6] = lang_string ('delete');
$table->head[6] = __('delete');
}
$sql = sprintf ('SELECT * FROM treport_content WHERE id_report = %d ORDER BY `order`', $id_report);
@ -445,12 +447,12 @@ if ($edit_sla_report_content) {
if ($first_id != $report_content['id_rc']) {
$data[0] .= '<a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&edit_report=1&id_report='.
$id_report.'&content_up=1&id_report_content='.$report_content['id_rc'].
'"><img src="images/up.png" title="'.lang_string ('up').'"></a>';
'"><img src="images/up.png" title="'.__('up').'"></a>';
}
if ($last_id != $report_content['id_rc']) {
$data[0] .= '<a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&edit_report=1&id_report='.
$id_report.'&content_down=1&id_report_content='.$report_content['id_rc'].
'"><img src="images/down.png" title="'.lang_string ('down').'"></a>';
'"><img src="images/down.png" title="'.__('down').'"></a>';
}
$data[1] = get_report_name ($report_content['type']);
$data[2] = '--';
@ -475,8 +477,8 @@ if ($edit_sla_report_content) {
}
} else {
// Report LIST
echo "<h2>".lang_string ('reporting')." &gt; ";
echo lang_string ('custom_reporting')."</h2>";
echo "<h2>".__('reporting')." &gt; ";
echo __('custom_reporting')."</h2>";
$reports = get_db_all_rows_in_table ('treport', 'name');
$table->width = '0px';
@ -487,9 +489,9 @@ if ($edit_sla_report_content) {
$table->align = array ();
$table->align[2] = 'center';
$table->data = array ();
$table->head[0] = lang_string ('report_name');
$table->head[1] = lang_string ('description');
$table->head[2] = lang_string ('delete');
$table->head[0] = __('report_name');
$table->head[1] = __('description');
$table->head[2] = __('delete');
foreach ($reports as $report) {
if ($report["private"] || $report["id_user"] != $config['id_user'])
@ -506,13 +508,13 @@ if ($edit_sla_report_content) {
}
print_table ($table);
} else {
echo "<div class='nf'>".lang_string ('no_reporting_def')."</div>";
echo "<div class='nf'>".__('no_reporting_def')."</div>";
}
echo '<form method="post" action="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder">';
echo '<div class="action-buttons" style="width: '.$table->width.'">';
print_input_hidden ('edit_report', 1);
print_submit_button (lang_string ('Create report'), 'create', false, 'class="sub next"');
print_submit_button (__('Create report'), 'create', false, 'class="sub next"');
echo "</div>";
echo "</form>";
}

View File

@ -17,12 +17,15 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global vars
global $config;
require ("include/config.php");
if ( (give_acl($id_user, 0, "LM")==0)){
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Recon Task Management");
require ("general/noaccess.php");
exit;
check_login ();
if (! give_acl ($config['id_user'], 0, "LM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Recon Task Management");
require ("general/noaccess.php");
exit;
}
// --------------------------------
@ -33,9 +36,9 @@ if (isset($_GET["delete"])) {
$sql = "DELETE FROM trecon_task WHERE id_rt = $id ";
$result = mysql_query($sql);
if ($result)
echo "<h3 class='suc'>".$lang_label["delete_ok"]."</h3>";
echo "<h3 class='suc'>".__('delete_ok')."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_no"]."</h3>";
echo "<h3 class='suc'>".__('delete_no')."</h3>";
}
@ -63,9 +66,9 @@ if (isset($_GET["update"])) {
id_network_profile = $id_network_profile WHERE id_rt = $id";
$result=mysql_query($sql);
if ($result)
echo "<h3 class='suc'>".$lang_label["modify_ok"]."</h3>";
echo "<h3 class='suc'>".__('modify_ok')."</h3>";
else
echo "<h3 class='suc'>".$lang_label["modify_no"]."</h3>";
echo "<h3 class='suc'>".__('modify_no')."</h3>";
}
// --------------------------------
@ -75,30 +78,30 @@ if (isset($_GET["create"])) {
$sql = "INSERT INTO trecon_task (name, subnet, description, id_recon_server, create_incident, id_group, id_network_profile, interval_sweep, id_os) VALUES ( '$name', '$network', '$description', $id_recon_server, $create_incident, $id_group, $id_network_profile, $interval, $id_os)";
$result=mysql_query($sql);
if ($result)
echo "<h3 class='suc'>".$lang_label["create_ok"]."</h3>";
echo "<h3 class='suc'>".__('create_ok')."</h3>";
else
echo "<h3 class='suc'>".$lang_label["create_no"]."</h3>";
echo "<h3 class='suc'>".__('create_no')."</h3>";
}
// --------------------------------
// SHOW TABLE WITH ALL RECON TASKs
// --------------------------------
echo "<h2>".$lang_label["view_servers"]." &gt; ";
echo $lang_label["manage_recontask"]."</h2>";
echo "<h2>".__('view_servers')." &gt; ";
echo __('manage_recontask')."</h2>";
$query="SELECT * FROM trecon_task";
$result=mysql_query($query);
$color=1;
if (mysql_num_rows($result)){
echo "<table cellpadding='4' cellspacing='4' width='700' class='databox'>";
echo "<tr><th class='datos'>".$lang_label["name"];
echo "<th class='datos'>".lang_string ('type');
echo "<th class='datos'>".lang_string ('network');
echo "<th class='datos'>".lang_string ('network_profile');
echo "<th class='datos'>".lang_string ('group');
echo "<th class='datos'>".lang_string ('incident');
echo "<th class='datos'>".lang_string ('OS');
echo "<th class='datos'>".lang_string ('interval');
echo "<th class='datos'>".lang_string ('Action');
echo "<tr><th class='datos'>".__('name');
echo "<th class='datos'>".__('type');
echo "<th class='datos'>".__('network');
echo "<th class='datos'>".__('network_profile');
echo "<th class='datos'>".__('group');
echo "<th class='datos'>".__('incident');
echo "<th class='datos'>".__('OS');
echo "<th class='datos'>".__('interval');
echo "<th class='datos'>".__('Action');
}
while ($row=mysql_fetch_array($result)){
$id_rt = $row["id_rt"];
@ -145,9 +148,9 @@ while ($row=mysql_fetch_array($result)){
// INCIDENT
echo "</td><td class='$tdcolor'>";
if ($create_incident == 1)
echo $lang_label["yes"];
echo __('yes');
else
echo $lang_label["no"];
echo __('no');
// OS
echo "</td><td class='$tdcolor'>";
@ -169,13 +172,13 @@ while ($row=mysql_fetch_array($result)){
echo "</table>";
if (!mysql_num_rows($result)){
echo "<div class='nf'>".$lang_label["no_rtask"]."</div>";
echo "<div class='nf'>".__('no_rtask')."</div>";
}
echo "<table width='700'>";
echo "<tr><td align='right'>";
echo "<form method='post' action='index.php?sec=gservers&sec2=godmode/servers/manage_recontask_form&create'>";
echo "<input type='submit' class='sub next' name='crt' value='".$lang_label["create"]."'>";
echo "<input type='submit' class='sub next' name='crt' value='".__('create')."'>";
echo "</form></table>";
?>

View File

@ -16,16 +16,18 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global vars
require("include/config.php");
require ("include/config.php");
if ((comprueba_login() != 0) || (give_acl($id_user, 0, "PM")!=1)) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
check_login ();
if (! give_acl ($config['id_user'], 0, "PM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
require ("general/noaccess.php");
exit;
return;
}
if (isset($_GET["update"])){ // Edit mode
if (isset ($_GET["update"])) { // Edit mode
$id_rt = $_GET["update"];
$query="SELECT * FROM trecon_task where id_rt = $id_rt";
$result=mysql_query($query);
@ -41,7 +43,7 @@ if (isset($_GET["update"])){ // Edit mode
$id_network_profile = $row["id_network_profile"];
$id_os = $row["id_os"];
} elseif (isset($_GET["create"])){
} elseif (isset ($_GET["create"])) {
$id_rt = -1;
$name = "";
$network = "";
@ -55,8 +57,8 @@ if (isset($_GET["update"])){ // Edit mode
$id_os = 10; // Other
}
echo '<h2>'.$lang_label["view_servers"].' &gt; ';
echo $lang_label["manage_recontask"];
echo '<h2>'.__('view_servers').' &gt; ';
echo __('manage_recontask');
pandora_help ("recontask");
echo '</h2>';
echo '<table width="700" cellspacing="4" cellpadding="4" class="databox_color">';
@ -68,12 +70,12 @@ else
echo "<form name='modulo' method='post' action='index.php?sec=gservers&sec2=godmode/servers/manage_recontask&create=1'>";
// Name
echo '<tr><td class="datos2">'.$lang_label["task_name"];
echo '<tr><td class="datos2">'.__('task_name');
echo "<td class='datos2'><input type='text' name='name' size='25' value='$name'>";
// Recon server
echo "<td class='datos2'>".$lang_label["recon_server"];
echo '<a href="#" class="tip">&nbsp;<span>'.$lang_label["recon_server_help"].'</span></a>';
echo "<td class='datos2'>".__('recon_server');
echo '<a href="#" class="tip">&nbsp;<span>'.__('recon_server_help').'</span></a>';
echo "<td class='datos2'>";
echo '<select name="id_recon_server">';
echo "<option value='$id_recon_server'>" . give_server_name($id_recon_server);
@ -86,34 +88,34 @@ echo "</select>";
// Network
echo "<tr>";
echo '<td class="datos">'.$lang_label["network"].'</td>';
echo '<td class="datos">'.__('network').'</td>';
echo '<td class="datos">';
echo '<input type="text" name="network" size="25" value="'.$network.'"></td>';
// Interval
echo '<td class="datos">'.$lang_label["interval"].'</td>';
echo '<td class="datos">'.__('interval').'</td>';
echo '<td class="datos">';
echo "<select name='interval'>";
if ($interval != 0){
if ($interval < 43200)
echo "<option value='$interval'>".($interval / 3600).$lang_label["hours"]."</option>";
echo "<option value='$interval'>".($interval / 3600).__('hours')."</option>";
else
echo "<option value='$interval'>".($interval / 86400).$lang_label["days"]."</option>";
echo "<option value='$interval'>".($interval / 86400).__('days')."</option>";
}
echo "<option value='3600'>1 ".$lang_label["hour"]."</option>";
echo "<option value='7200'>2 ".$lang_label["hours"]."</option>";
echo "<option value='21600'>6 ".$lang_label["hours"]."</option>";
echo "<option value='43200'>1/2 ".$lang_label["day"]."</option>";
echo "<option value='86400'>1 ".$lang_label["day"]."</option>";
echo "<option value='432000'>5 ".$lang_label["days"]."</option>";
echo "<option value='604800'>1 ".$lang_label["week"]."</option>";
echo "<option value='1209600'>2 ".$lang_label["week"]."</option>";
echo "<option value='2592000'>1 ".$lang_label["month"]."</option>";
echo "<option value='3600'>1 ".__('hour')."</option>";
echo "<option value='7200'>2 ".__('hours')."</option>";
echo "<option value='21600'>6 ".__('hours')."</option>";
echo "<option value='43200'>1/2 ".__('day')."</option>";
echo "<option value='86400'>1 ".__('day')."</option>";
echo "<option value='432000'>5 ".__('days')."</option>";
echo "<option value='604800'>1 ".__('week')."</option>";
echo "<option value='1209600'>2 ".__('week')."</option>";
echo "<option value='2592000'>1 ".__('month')."</option>";
echo "</select>";
// Network profile
echo "<tr>";
echo "<td class='datos2'>".lang_string ("network_profile") . "</td>";
echo "<td class='datos2'>".__('network_profile') . "</td>";
echo "<td class='datos2'>";
echo "<select name='id_network_profile'>";
echo "<option value='$id_network_profile'>".give_network_profile_name($id_network_profile);
@ -124,12 +126,12 @@ while ($row=mysql_fetch_array($result))
echo "</select></td>";
// OS
echo "<td class='datos2'>". lang_string ("OS") . "</td>";
echo "<td class='datos2'>". __('OS') . "</td>";
echo "<td class='datos2'>";
echo "<select name='id_os'>";
if ($id_os != 0)
echo "<option value='$id_os'>".get_db_sql ("SELECT name FROM tconfig_os WHERE id_os = $id_os");
echo "<option value=-1>". lang_string ("Any");
echo "<option value=-1>". __('Any');
$sql1 = "SELECT * FROM tconfig_os ORDER BY name";
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result))
@ -138,7 +140,7 @@ echo "</select></td>";
// Group
echo "<tr>";
echo "<td class='datos'>".$lang_label["group"]."</td>";
echo "<td class='datos'>".__('group')."</td>";
echo "<td class='datos'>";
echo "<select name='id_group'>";
echo "<option value='$id_group'>".dame_nombre_grupo($id_group)."</option>";
@ -150,22 +152,22 @@ echo "</select></td>";
// Incident
echo "<tr>";
echo "<td class='datos2'>".$lang_label["incident"]."</td>";
echo "<td class='datos2'>".__('incident')."</td>";
echo "<td class='datos2'>";
echo "<select name='create_incident'>";
if ($create_incident == 1){
echo "<option value='1'>".$lang_label["yes"]."</option>";
echo "<option value='0'>".$lang_label["no"]."</option>";
echo "<option value='1'>".__('yes')."</option>";
echo "<option value='0'>".__('no')."</option>";
}
else {
echo "<option value='0'>".$lang_label["no"]."</option>";
echo "<option value='1'>".$lang_label["yes"]."</option>";
echo "<option value='0'>".__('no')."</option>";
echo "<option value='1'>".__('yes')."</option>";
}
echo "</select></td>";
echo "<td class='datos2' colspan=2> </td></tr>";
// Comments
echo '<tr><td class="datost">'.$lang_label["comments"];
echo '<tr><td class="datost">'.__('comments');
echo '<td class="datos" colspan=3>';
echo '<textarea name="description" cols=70 rows=2>';
echo $description;
@ -176,9 +178,9 @@ echo "</table>";
echo "<table cellpadding='4' cellspacing='4' width='700'>";
echo "<td align='right'>";
if ($id_rt != "-1")
echo '<input name="updbutton" type="submit" class="sub upd" value="'.$lang_label["update"].'">';
echo '<input name="updbutton" type="submit" class="sub upd" value="'.__('update').'">';
else
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.$lang_label["add"].'">';
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.__('add').'">';
echo "</form>";
echo "</table>";

View File

@ -20,17 +20,18 @@ require("include/config.php");
check_login();
if ((give_acl($config["id_user"], 0, "AR")!=1) AND (give_acl($id_user, 0, "AW") != 1)) {
audit_db($config["id_user"],$REMOTE_ADDR, "ACL Violation","Trying to access Server Management");
if (! give_acl ($config["id_user"], 0, "AR") && ! give_acl($config['id_user'], 0, "AW")) {
audit_db ($config["id_user"], $REMOTE_ADDR, "ACL Violation",
"Trying to access Server Management");
require ("general/noaccess.php");
}
if (isset($_GET["delete"])) {
$id_server=entrada_limpia($_GET["server_del"]);
if (isset ($_GET["delete"])) {
$id_server = entrada_limpia($_GET["server_del"]);
$sql = "DELETE FROM tserver WHERE id_server='".$id_server."'";
$result=mysql_query($sql);
if ($result) echo "<h3 class='suc'>".$lang_label["del_server_ok"]."</h3>";
else echo "<h3 class='suc'>".$lang_label["del_server_no"]."</h3>";
if ($result) echo "<h3 class='suc'>".__('del_server_ok')."</h3>";
else echo "<h3 class='suc'>".__('del_server_no')."</h3>";
}
if (isset($_GET["update"])) {
@ -40,14 +41,14 @@ if (isset($_GET["update"])) {
$id_server=entrada_limpia($_POST["server"]);
$sql = "UPDATE tserver SET name='".$name."', ip_address='".$address."', description='".$description."' WHERE id_server='".$id_server."'";
$result=mysql_query($sql);
if ($result) echo "<h3 class='suc'>".$lang_label["upd_server_ok"]."</h3>";
else echo "<h3 class='suc'>".$lang_label["upd_server_no"]."</h3>";
if ($result) echo "<h3 class='suc'>".__('upd_server_ok')."</h3>";
else echo "<h3 class='suc'>".__('upd_server_no')."</h3>";
}
if (isset($_GET["server"])) {
$id_server=entrada_limpia($_GET["server"]);
echo "<h2>".$lang_label["view_servers"]." &gt; ";
echo $lang_label["update_server"]."</h2>";
echo "<h2>".__('view_servers')." &gt; ";
echo __('update_server')."</h2>";
$query="SELECT * FROM tserver WHERE id_server=".$id_server;
$result=mysql_query($query);
@ -67,35 +68,35 @@ if (isset($_GET["server"])) {
echo '<form name="servers" method="POST" action="index.php?sec=gservers&sec2=godmode/servers/modificar_server&update=1">';
echo "<table cellpadding='4' cellspacing='4' width='450' class='databox_color'>";
echo "<tr>";
echo "<td class='datos'>".$lang_label["name"]."</td><td class='datos'><input type='text' name='name' value='".$name."' width='200px'>";
echo "<tr><td class='datos2'>".$lang_label['ip_address']."</td><td class='datos2'><input type='text' name='address' value='".$address."' width='200px'>";
echo "<tr><td class='datos'>".$lang_label['description']."<td class='datos'><input type='text' name='description' value='".$description."'><input type='hidden' name='server' value='".entrada_limpia($_GET["server"])."'></input>";
echo "<td class='datos'>".__('name')."</td><td class='datos'><input type='text' name='name' value='".$name."' width='200px'>";
echo "<tr><td class='datos2'>".__('ip_address')."</td><td class='datos2'><input type='text' name='address' value='".$address."' width='200px'>";
echo "<tr><td class='datos'>".__('description')."<td class='datos'><input type='text' name='description' value='".$description."'><input type='hidden' name='server' value='".entrada_limpia($_GET["server"])."'></input>";
}
else {
echo "<div class='nf'>".$lang_label["no_server"]."</div>";
echo "<div class='nf'>".__('no_server')."</div>";
}
echo '</table>';
echo '<table cellpadding="4" cellspacing="4" width="450">';
echo '<tr><td align="right">';
echo '<input type="submit" class="sub upd" value="'.$lang_label["update"].'"></table>';
echo '<input type="submit" class="sub upd" value="'.__('update').'"></table>';
}
else {
$sql='SELECT * FROM tserver';
echo "<h2>".$lang_label["view_servers"]." &gt; ";
echo $lang_label["manage_servers"]."</h2>";
echo "<h2>".__('view_servers')." &gt; ";
echo __('manage_servers')."</h2>";
$result=mysql_query($sql);
if (mysql_num_rows($result)){
echo "<table cellpadding='4' cellspacing='4' witdh='550' class='databox'>";
echo "<tr><th class='datos'>".$lang_label["name"]."</th>";
echo "<th class='datos'>".$lang_label['status']."</th>";
echo "<th class='datos'>".$lang_label['ip_address']."</th>";
echo "<th class='datos'>".$lang_label['description']."</th>";
echo "<th class='datos' width=80>".$lang_label['type']."</th>";
echo "<th class='datos'>".$lang_label['laststart']."</th>";
echo "<th class='datos'>".$lang_label['lastupdate']."</th>";
echo "<th class='datos'>".$lang_label['delete']."</th>";
echo "<tr><th class='datos'>".__('name')."</th>";
echo "<th class='datos'>".__('status')."</th>";
echo "<th class='datos'>".__('ip_address')."</th>";
echo "<th class='datos'>".__('description')."</th>";
echo "<th class='datos' width=80>".__('type')."</th>";
echo "<th class='datos'>".__('laststart')."</th>";
echo "<th class='datos'>".__('lastupdate')."</th>";
echo "<th class='datos'>".__('delete')."</th>";
$color=1;
while ($row=mysql_fetch_array($result)){
$name = $row["name"];
@ -158,25 +159,25 @@ else {
echo "
<tr>
<td>
<span class='net'>".$lang_label["network_server"]."</span>
<span class='net'>".__('network_server')."</span>
</td>
<td>
<span class='master'>".$lang_label["master"]."</span>
<span class='master'>".__('master')."</span>
</td>
<td>
<span class='data'>".$lang_label["data_server"]."</span>
<span class='data'>".__('data_server')."</span>
</td>
<td>
<span class='binary'>".$lang_label["md5_checksum"]."</span>
<span class='binary'>".__('md5_checksum')."</span>
</td>
<td>
<span class='snmp'>".$lang_label["snmp_console"]."</span>
<span class='snmp'>".__('snmp_console')."</span>
</td>
</tr>";
echo "</table>";
}
else {
echo "<div class='nf'>".$lang_label["no_server"]."</div>";
echo "<div class='nf'>".__('no_server')."</div>";
}
}

View File

@ -17,116 +17,106 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global vars
global $config;
require ("include/config.php");
if ( (give_acl($id_user, 0, "LM")==0)){
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Plugin Management");
require ("general/noaccess.php");
exit;
check_login ();
if (! give_acl ($config['id_user'], 0, "LM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Plugin Management");
require ("general/noaccess.php");
return;
}
// Plugin operations
/*
tplugin table DB struct
id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(200) NOT NULL,
`description` mediumtext default "",
`max_timeout` int(4) UNSIGNED NOT NULL default 0,
`execute`varchar(250) NOT NULL,
`net_dst_opt` varchar(50) default '',
`net_port_opt` varchar(50) default '',
`user_opt` varchar(50) default '',
`pass_opt` varchar(50) default '',
*/
// Update plugin
if (isset($_GET["update_plugin"])){ // if modified any parameter
$plugin_id = get_parameter ("update_plugin", 0);
$plugin_name = get_parameter ("form_name", "");
$plugin_description = get_parameter ("form_description", "");
$plugin_max_timeout = get_parameter ("form_max_timeout", "");
$plugin_execute = get_parameter ("form_execute", "");
$plugin_net_dst_opt = get_parameter ("form_net_dst_opt", "");
$plugin_net_port_opt = get_parameter ("form_net_port_opt", "");
$plugin_user_opt = get_parameter ("form_user_opt", "");
$plugin_pass_opt = get_parameter ("form_pass_opt", "");
$sql_update ="UPDATE tplugin SET
name = '$plugin_name',
description = '$plugin_description',
max_timeout = '$plugin_max_timeout',
execute = '$plugin_execute',
net_dst_opt = '$plugin_net_dst_opt',
net_port_opt = '$plugin_net_port_opt',
user_opt = '$plugin_user_opt',
pass_opt = '$plugin_pass_opt'
WHERE id = $plugin_id";
$result=mysql_query($sql_update);
if (! $result) {
echo "<h3 class='error'>".lang_string ("Problem updating plugin")."</h3>";
} else {
echo "<h3 class='suc'>".lang_string ("Plugin updated successfully")."</h3>";
}
$plugin_id = get_parameter ("update_plugin", 0);
$plugin_name = get_parameter ("form_name", "");
$plugin_description = get_parameter ("form_description", "");
$plugin_max_timeout = get_parameter ("form_max_timeout", "");
$plugin_execute = get_parameter ("form_execute", "");
$plugin_net_dst_opt = get_parameter ("form_net_dst_opt", "");
$plugin_net_port_opt = get_parameter ("form_net_port_opt", "");
$plugin_user_opt = get_parameter ("form_user_opt", "");
$plugin_pass_opt = get_parameter ("form_pass_opt", "");
$sql_update ="UPDATE tplugin SET
name = '$plugin_name',
description = '$plugin_description',
max_timeout = '$plugin_max_timeout',
execute = '$plugin_execute',
net_dst_opt = '$plugin_net_dst_opt',
net_port_opt = '$plugin_net_port_opt',
user_opt = '$plugin_user_opt',
pass_opt = '$plugin_pass_opt'
WHERE id = $plugin_id";
$result=mysql_query($sql_update);
if (! $result) {
echo "<h3 class='error'>".__('Problem updating plugin')."</h3>";
} else {
echo "<h3 class='suc'>".__('Plugin updated successfully')."</h3>";
}
}
// Create plugin
if (isset($_GET["create_plugin"])){
$plugin_name = get_parameter ("form_name", "");
$plugin_description = get_parameter ("form_description", "");
$plugin_max_timeout = get_parameter ("form_max_timeout", "");
$plugin_execute = get_parameter ("form_execute", "");
$plugin_net_dst_opt = get_parameter ("form_net_dst_opt", "");
$plugin_net_port_opt = get_parameter ("form_net_port_opt", "");
$plugin_user_opt = get_parameter ("form_user_opt", "");
$plugin_pass_opt = get_parameter ("form_pass_opt", "");
$sql_insert ="INSERT tplugin (name, description, max_timeout, execute, net_dst_opt, net_port_opt, user_opt, pass_opt) VALUES ('$plugin_name', '$plugin_description', '$plugin_max_timeout', '$plugin_execute', '$plugin_net_dst_opt', '$plugin_net_port_opt', '$plugin_user_opt', '$plugin_pass_opt')";
$result=mysql_query($sql_insert);
if (! $result){
echo "<h3 class='error'>".lang_string ("Problem creating plugin")."</h3>";
echo $sql_insert;
} else {
echo "<h3 class='suc'>".lang_string ("Plugin created successfully")."</h3>";
}
if (isset($_GET["create_plugin"])){
$plugin_name = get_parameter ("form_name", "");
$plugin_description = get_parameter ("form_description", "");
$plugin_max_timeout = get_parameter ("form_max_timeout", "");
$plugin_execute = get_parameter ("form_execute", "");
$plugin_net_dst_opt = get_parameter ("form_net_dst_opt", "");
$plugin_net_port_opt = get_parameter ("form_net_port_opt", "");
$plugin_user_opt = get_parameter ("form_user_opt", "");
$plugin_pass_opt = get_parameter ("form_pass_opt", "");
$sql_insert ="INSERT tplugin (name, description, max_timeout, execute, net_dst_opt, net_port_opt, user_opt, pass_opt) VALUES ('$plugin_name', '$plugin_description', '$plugin_max_timeout', '$plugin_execute', '$plugin_net_dst_opt', '$plugin_net_port_opt', '$plugin_user_opt', '$plugin_pass_opt')";
$result=mysql_query($sql_insert);
if (! $result){
echo "<h3 class='error'>".__('Problem creating plugin')."</h3>";
echo $sql_insert;
} else {
echo "<h3 class='suc'>".__('Plugin created successfully')."</h3>";
}
}
if (isset($_GET["kill_plugin"])){ // if delete alert
$plugin_id = get_parameter ("kill_plugin", 0);
$sql_delete= "DELETE FROM tplugin WHERE id= ".$plugin_id;
$result=mysql_query($sql_delete);
if (! $result){
echo "<h3 class='error'>".lang_string ("Problem deleting plugin")."</h3>";
} else {
echo "<h3 class='suc'>".lang_string ("Plugin deleted successfully")."</h3>";
}
if ($plugin_id != 0){
$sql_delete2 ="DELETE FROM tagente_modulo WHERE id_plugin = ".$plugin_id;
$result=mysql_query($sql_delete2);
}
$plugin_id = get_parameter ("kill_plugin", 0);
$sql_delete= "DELETE FROM tplugin WHERE id= ".$plugin_id;
$result=mysql_query($sql_delete);
if (! $result){
echo "<h3 class='error'>".__('Problem deleting plugin')."</h3>";
} else {
echo "<h3 class='suc'>".__('Plugin deleted successfully')."</h3>";
}
if ($plugin_id != 0){
$sql_delete2 ="DELETE FROM tagente_modulo WHERE id_plugin = ".$plugin_id;
$result=mysql_query($sql_delete2);
}
}
$view = get_parameter ("view", "");
$create = get_parameter ("create", "");
if ($view != ""){
$form_id = $view;
$form_id = $view;
$plugin = get_db_row ("tplugin", "id", $form_id);
$form_name = $plugin["name"];
$form_description = $plugin["description"];
$form_max_timeout = $plugin ["max_timeout"];
$form_execute = $plugin ["execute"];
$form_net_dst_opt = $plugin ["net_dst_opt"];
$form_net_port_opt = $plugin ["net_port_opt"];
$form_user_opt = $plugin ["user_opt"];
$form_pass_opt = $plugin ["pass_opt"];
$form_name = $plugin["name"];
$form_description = $plugin["description"];
$form_max_timeout = $plugin ["max_timeout"];
$form_execute = $plugin ["execute"];
$form_net_dst_opt = $plugin ["net_dst_opt"];
$form_net_port_opt = $plugin ["net_port_opt"];
$form_user_opt = $plugin ["user_opt"];
$form_pass_opt = $plugin ["pass_opt"];
}
if ($create != ""){
$form_name = "";
$form_description = "";
$form_max_timeout = "";
$form_execute = "";
$form_net_dst_opt = "";
$form_net_port_opt = "";
$form_user_opt = "";
$form_pass_opt = "";
$form_name = "";
$form_description = "";
$form_max_timeout = "";
$form_execute = "";
$form_net_dst_opt = "";
$form_net_port_opt = "";
$form_user_opt = "";
$form_pass_opt = "";
}
// SHOW THE FORM
@ -135,109 +125,108 @@ if ($create != ""){
if (($create != "") OR ($view != "")){
echo "<h2>";
if ($create != "")
echo lang_string ("Plugin creation");
else {
echo lang_string ("Plugin update");
$plugin_id = get_parameter ("view","");
}
if ($create != "")
echo __('Plugin creation');
else {
echo __('Plugin update');
$plugin_id = get_parameter ("view","");
}
pandora_help("plugin_definition");
echo "</h2>";
if ($create == "")
echo "<form name=plugin method='post' action='index.php?sec=gservers&sec2=godmode/servers/plugin&update_plugin=$plugin_id'>";
else
echo "<form name=plugin method='post' action='index.php?sec=gservers&sec2=godmode/servers/plugin&create_plugin=1'>";
echo "</h2>";
if ($create == "")
echo "<form name=plugin method='post' action='index.php?sec=gservers&sec2=godmode/servers/plugin&update_plugin=$plugin_id'>";
else
echo "<form name=plugin method='post' action='index.php?sec=gservers&sec2=godmode/servers/plugin&create_plugin=1'>";
echo '<table width="600" cellspacing="4" cellpadding="4" class="databox_color">';
echo '<tr><td class="datos">'.lang_string ("Name");
echo '<td class="datos">';
echo '<input type="text" name="form_name" size=30 value="'.$form_name.'"></td>';
echo '<tr><td class="datos2">'.lang_string ("Plugin command");
echo '<td class="datos2">';
echo '<input type="text" name="form_execute" size=45 value="'.$form_execute.'"></td>';
echo '<table width="600" cellspacing="4" cellpadding="4" class="databox_color">';
echo '<tr><td class="datos">'.__('Name');
echo '<td class="datos">';
echo '<input type="text" name="form_name" size=30 value="'.$form_name.'"></td>';
echo '<tr><td class="datos2">'.__('Plugin command');
echo '<td class="datos2">';
echo '<input type="text" name="form_execute" size=45 value="'.$form_execute.'"></td>';
echo '<tr><td class="datos">'.lang_string ("Max.Timeout");
echo '<td class="datos">';
echo '<input type="text" name="form_max_timeout" size=5 value="'.$form_max_timeout.'"></td>';
echo '<tr><td class="datos">'.__('Max.Timeout');
echo '<td class="datos">';
echo '<input type="text" name="form_max_timeout" size=5 value="'.$form_max_timeout.'"></td>';
echo '<tr><td class="datos2">'.lang_string ("IP address option");
echo '<td class="datos2">';
echo '<input type="text" name="form_net_dst_opt" size=15 value="'.$form_net_dst_opt.'"></td>';
echo '<tr><td class="datos2">'.__('IP address option');
echo '<td class="datos2">';
echo '<input type="text" name="form_net_dst_opt" size=15 value="'.$form_net_dst_opt.'"></td>';
echo '<tr><td class="datos">'.lang_string ("Port option");
echo '<td class="datos">';
echo '<input type="text" name="form_net_port_opt" size=5 value="'.$form_net_port_opt.'"></td>';
echo '<tr><td class="datos">'.__('Port option');
echo '<td class="datos">';
echo '<input type="text" name="form_net_port_opt" size=5 value="'.$form_net_port_opt.'"></td>';
echo '<tr><td class="datos2">'.lang_string ("User option");
echo '<td class="datos2">';
echo '<input type="text" name="form_user_opt" size=15 value="'.$form_user_opt.'"></td>';
echo '<tr><td class="datos2">'.__('User option');
echo '<td class="datos2">';
echo '<input type="text" name="form_user_opt" size=15 value="'.$form_user_opt.'"></td>';
echo '<tr><td class="datos">'.lang_string ("Password option");
echo '<td class="datos">';
echo '<input type="text" name="form_pass_opt" size=15 value="'.$form_pass_opt.'"></td>';
echo '<tr><td class="datos">'.__('Password option');
echo '<td class="datos">';
echo '<input type="text" name="form_pass_opt" size=15 value="'.$form_pass_opt.'"></td>';
echo '<tr><td class="datos2">'.$lang_label["description"].'</td>';
echo '<td class="datos2"><textarea name="form_description" cols="50" rows="4">';
echo $form_description;
echo '</textarea></td></tr>';
echo '<tr><td class="datos2">'.__('description').'</td>';
echo '<td class="datos2"><textarea name="form_description" cols="50" rows="4">';
echo $form_description;
echo '</textarea></td></tr>';
echo '</table>';
echo '<table width=600>';
echo '<tr><td align="right">';
if ($create != ""){
echo "<input name='crtbutton' type='submit' class='sub wand' value='".$lang_label["create"]."'>";
} else {
echo "<input name='uptbutton' type='submit' class='sub upd' value='".$lang_label["update"]."'>";
}
echo '</form></table>';
echo '</table>';
echo '<table width=600>';
echo '<tr><td align="right">';
if ($create != ""){
echo "<input name='crtbutton' type='submit' class='sub wand' value='".__('create')."'>";
} else {
echo "<input name='uptbutton' type='submit' class='sub upd' value='".__('update')."'>";
}
echo '</form></table>';
}
else {
echo "<h2>". lang_string ("Plugins registered in Pandora FMS")."</h2>";
echo "<h2>". __('Plugins registered in Pandora FMS')."</h2>";
// If not edition or insert, then list available plugins
$sql1='SELECT * FROM tplugin ORDER BY name';
$result=mysql_query($sql1);
if (mysql_num_rows($result) > 0){
echo '<table width="530" cellspacing="4" cellpadding="4" class="databox">';
echo "<th>".lang_string("name");
echo "<th>".lang_string("execute");
echo "<th>".lang_string("delete");
$color = 0;
while ($row=mysql_fetch_array($result)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo "<tr>";
echo "<td class=$tdcolor>";
echo "<b><a href='index.php?sec=gservers&sec2=godmode/servers/plugin&view=".$row["id"]."'>";
echo $row["name"];
echo "</a></b>";
echo "<td class=$tdcolor>";
echo $row["execute"];
echo "<td class=$tdcolor>";
echo "<a href='index.php?sec=gservers&sec2=godmode/servers/plugin&kill_plugin=".$row["id"]."'><img src='images/cross.png' border=0></a>";
}
echo "</table>";
} else {
echo '<div class="nf">'. lang_string ("There is no plugins in the system");
echo "<br>";
}
echo "<table width=530>";
echo "<tr><td align=right>";
echo "<form name=plugin method='post' action='index.php?sec=gservers&sec2=godmode/servers/plugin&create=1'>";
echo "<input name='crtbutton' type='submit' class='sub wand' value='".$lang_label["create"]."'>";
echo "</table>";
$sql1='SELECT * FROM tplugin ORDER BY name';
$result=mysql_query($sql1);
if (mysql_num_rows($result) > 0){
echo '<table width="530" cellspacing="4" cellpadding="4" class="databox">';
echo "<th>".__('name');
echo "<th>".__('execute');
echo "<th>".__('delete');
$color = 0;
while ($row=mysql_fetch_array($result)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo "<tr>";
echo "<td class=$tdcolor>";
echo "<b><a href='index.php?sec=gservers&sec2=godmode/servers/plugin&view=".$row["id"]."'>";
echo $row["name"];
echo "</a></b>";
echo "<td class=$tdcolor>";
echo $row["execute"];
echo "<td class=$tdcolor>";
echo "<a href='index.php?sec=gservers&sec2=godmode/servers/plugin&kill_plugin=".$row["id"]."'><img src='images/cross.png' border=0></a>";
}
echo "</table>";
} else {
echo '<div class="nf">'. __('There is no plugins in the system');
echo "<br>";
}
echo "<table width=530>";
echo "<tr><td align=right>";
echo "<form name=plugin method='post' action='index.php?sec=gservers&sec2=godmode/servers/plugin&create=1'>";
echo "<input name='crtbutton' type='submit' class='sub wand' value='".__('create')."'>";
echo "</table>";
}
?>

View File

@ -35,9 +35,9 @@ if (! give_acl ($config['id_user'], 0, "PM") || ! dame_admin ($config['id_user']
$sql_insert="INSERT INTO tlink (name,link) VALUES ('$name','$link') ";
$result=mysql_query($sql_insert);
if (! $result)
echo "<h3 class='error'>".$lang_label["create_link_no"]."</h3>";
echo "<h3 class='error'>".__('create_link_no')."</h3>";
else {
echo "<h3 class='suc'>".$lang_label["create_link_ok"]."</h3>";
echo "<h3 class='suc'>".__('create_link_ok')."</h3>";
$id_link = mysql_insert_id();
}
}
@ -49,9 +49,9 @@ if (! give_acl ($config['id_user'], 0, "PM") || ! dame_admin ($config['id_user']
$sql_update ="UPDATE tlink SET name = '".$name."', link ='".$link."' WHERE id_link = '".$id_link."'";
$result=mysql_query($sql_update);
if (! $result)
echo "<h3 class='error'>".$lang_label["modify_link_no"]."</h3>";
echo "<h3 class='error'>".__('modify_link_no')."</h3>";
else
echo "<h3 class='suc'>".$lang_label["modify_link_ok"]."</h3>";
echo "<h3 class='suc'>".__('modify_link_ok')."</h3>";
}
if (isset($_GET["borrar"])){ // if delete
@ -59,9 +59,9 @@ if (! give_acl ($config['id_user'], 0, "PM") || ! dame_admin ($config['id_user']
$sql_delete= "DELETE FROM tlink WHERE id_link = ".$id_link;
$result=mysql_query($sql_delete);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_link_no"]."</h3>";
echo "<h3 class='error'>".__('delete_link_no')."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_link_ok"]."</h3>";
echo "<h3 class='suc'>".__('delete_link_ok')."</h3>";
}
@ -76,7 +76,7 @@ if (! give_acl ($config['id_user'], 0, "PM") || ! dame_admin ($config['id_user']
$nombre = $row["name"];
$link = $row["link"];
}
else echo "<h3 class='error'>".$lang_label["name_error"]."</h3>";
else echo "<h3 class='error'>".__('name_error')."</h3>";
} else { // form_add
$creation_mode =1;
$nombre = "";
@ -84,8 +84,8 @@ if (! give_acl ($config['id_user'], 0, "PM") || ! dame_admin ($config['id_user']
}
// Create link
echo "<h2>".$lang_label["setup_screen"]." &gt; ";
echo $lang_label["link_management"]."</h2>";
echo "<h2>".__('setup_screen')." &gt; ";
echo __('link_management')."</h2>";
echo '<table class="databox" cellpadding="4" cellspacing="4" width="500">';
echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/links">';
if ($creation_mode == 1)
@ -97,26 +97,26 @@ if (! give_acl ($config['id_user'], 0, "PM") || ! dame_admin ($config['id_user']
<?php
echo "'>";
echo '<tr>
<td class="datos">'.$lang_label["link_name"].'</td>
<td class="datos">'.__('link_name').'</td>
<td class="datos"><input type="text" name="name" size="35" value="'.$nombre.'">';
echo '<tr>
<td class="datos2">'.$lang_label["link"].'</td>
<td class="datos2">'.__('link').'</td>
<td class="datos2">
<input type="text" name="link" size="35" value="'.$link.'"></td>';
echo '</tr>';
echo "</table>";
echo "<table width='500px'>";
echo "<tr><td align='right'>
<input name='crtbutton' type='submit' class='sub upd' value='".$lang_label["update"]."'>";
<input name='crtbutton' type='submit' class='sub upd' value='".__('update')."'>";
echo '</form></td></tr></table>';
}
else { // Main list view for Links editor
echo "<h2>".$lang_label["setup_screen"]." &gt; ";
echo $lang_label["link_management"]."</h3>";
echo "<h2>".__('setup_screen')." &gt; ";
echo __('link_management')."</h3>";
echo "<table cellpadding='4' cellspacing='4' class='databox'>";
echo "<th width='180px'>".$lang_label["link_name"]."</th>";
echo "<th width='80px'>".$lang_label["delete"]."</th>";
echo "<th width='180px'>".__('link_name')."</th>";
echo "<th width='80px'>".__('delete')."</th>";
$sql1='SELECT * FROM tlink ORDER BY name';
$result=mysql_query($sql1);
$color=1;
@ -130,13 +130,13 @@ if (! give_acl ($config['id_user'], 0, "PM") || ! dame_admin ($config['id_user']
$color = 1;
}
echo "<tr><td class='$tdcolor'><b><a href='index.php?sec=gsetup&sec2=godmode/setup/links&form_edit=1&id_link=".$row["id_link"]."'>".$row["name"]."</a></b></td>";
echo '<td class="'.$tdcolor.'" align="center"><a href="index.php?sec=gsetup&sec2=godmode/setup/links&id_link='.$row["id_link"].'&borrar='.$row["id_link"].'" onClick="if (!confirm(\' '.$lang_label["are_you_sure"].'\')) return false;"><img border=0 src="images/cross.png"></a></td></tr>';
echo '<td class="'.$tdcolor.'" align="center"><a href="index.php?sec=gsetup&sec2=godmode/setup/links&id_link='.$row["id_link"].'&borrar='.$row["id_link"].'" onClick="if (!confirm(\' '.__('are_you_sure').'\')) return false;"><img border=0 src="images/cross.png"></a></td></tr>';
}
echo "</table>";
echo "<table width='290px'>";
echo "<tr><td align='right'>";
echo "<form method='post' action='index.php?sec=gsetup&sec2=godmode/setup/links&form_add=1'>";
echo "<input type='submit' class='sub next' name='form_add' value='".$lang_label["add"]."'>";
echo "<input type='submit' class='sub next' name='form_add' value='".__('add')."'>";
echo "</form></table>";
}
?>
?>

View File

@ -6,139 +6,139 @@
// Raul Mateos <raulofpandora@gmail.com>, 2005-2007
// Load global vars
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
if (give_acl($id_user, 0, "PM")==1) {
require_once ("include/config.php");
if (isset($_POST["create"])){ // If create
$subject = entrada_limpia($_POST["subject"]);
$text = entrada_limpia($_POST["text"]);
$timestamp = $ahora=date("Y/m/d H:i:s");
$author = $id_user;
$sql_insert="INSERT INTO tnews (subject, text, author, timestamp) VALUES ('$subject','$text', '$author', '$timestamp') ";
$result=mysql_query($sql_insert);
if (! $result)
echo "<h3 class='error'>".$lang_label["create_no"]."</h3>";
else {
echo "<h3 class='suc'>".$lang_label["create_ok"]."</h3>";
$id_link = mysql_insert_id();
}
}
check_login ();
if (isset($_POST["update"])){ // if update
$id_news = entrada_limpia($_POST["id_news"]);
$subject = entrada_limpia($_POST["subject"]);
$text = entrada_limpia($_POST["text"]);
$timestamp = $ahora=date("Y/m/d H:i:s");
$sql_update ="UPDATE tnews SET subject = '".$subject."', text ='".$text."', timestamp = '$timestamp' WHERE id_news = '".$id_news."'";
$result=mysql_query($sql_update);
if (! $result)
echo "<h3 class='error'>".$lang_label["modify_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["modify_ok"]."</h3>";
}
if (! give_acl ($config['id_user'], 0, "PM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Link Management");
require ("general/noaccess.php");
return;
}
if (isset ($_POST["create"])) { // If create
$subject = get_parameter ("subject");
$text = get_parameter ("text");
$timestamp = $ahora = date ("Y/m/d H:i:s");
$author = $config['id_user'];
if (isset($_GET["borrar"])){ // if delete
$id_news = entrada_limpia($_GET["borrar"]);
$sql_delete= "DELETE FROM tnews WHERE id_news = ".$id_news;
$result=mysql_query($sql_delete);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_ok"]."</h3>";
$sql = "INSERT INTO tnews (subject, text, author, timestamp) VALUES ('$subject','$text', '$author', '$timestamp') ";
$result = mysql_query ($sql_insert);
if (! $result) {
echo "<h3 class='error'>".__('create_no')."</h3>";
} else {
echo "<h3 class='suc'>".__('create_ok')."</h3>";
$id_link = mysql_insert_id ();
}
}
// Main form view for Links edit
if ((isset($_GET["form_add"])) or (isset($_GET["form_edit"]))){
if (isset($_GET["form_edit"])){
$creation_mode = 0;
$id_news = entrada_limpia($_GET["id_news"]);
$sql1='SELECT * FROM tnews WHERE id_news = '.$id_news;
$result=mysql_query($sql1);
if ($row=mysql_fetch_array($result)){
$subject = $row["subject"];
$text = $row["text"];
$author = $row["author"];
$timestamp = $row["timestamp"];
}
else echo "<h3 class='error'>".$lang_label["name_error"]."</h3>";
} else { // form_add
$creation_mode =1;
$text = "";
$subject = "";
$author = $id_user;
if (isset ($_POST["update"])) { // if update
$id_news = get_parameter ("id_news");
$subject = get_parameter ("subject");
$text = get_parameter ("text");
$timestamp = $ahora = date("Y/m/d H:i:s");
$sql_update ="UPDATE tnews SET subject = '".$subject."', text ='".$text."', timestamp = '$timestamp' WHERE id_news = '".$id_news."'";
$result = mysql_query($sql_update);
if (! $result)
echo "<h3 class='error'>".__('modify_no')."</h3>";
else
echo "<h3 class='suc'>".__('modify_ok')."</h3>";
}
if (isset ($_GET["borrar"])) { // if delete
$id_news = get_parameter ("borrar");
$sql_delete = "DELETE FROM tnews WHERE id_news = ".$id_news;
$result = mysql_query ($sql_delete);
if (! $result)
echo "<h3 class='error'>".__('delete_no')."</h3>";
else
echo "<h3 class='suc'>".__('delete_ok')."</h3>";
}
// Main form view for Links edit
if ((isset ($_GET["form_add"])) || (isset ($_GET["form_edit"]))) {
if (isset($_GET["form_edit"])) {
$creation_mode = 0;
$id_news = get_parameter ("id_news");
$sql = 'SELECT * FROM tnews WHERE id_news = '.$id_news;
$result = mysql_query ($sql);
if ($row = mysql_fetch_array ($result)) {
$subject = $row["subject"];
$text = $row["text"];
$author = $row["author"];
$timestamp = $row["timestamp"];
} else {
echo "<h3 class='error'>".__('name_error')."</h3>";
}
// Create news
echo "<h2>".$lang_label["setup_screen"]." &gt; ";
echo $lang_label["site_news_management"]."</h2>";
echo '<table class="databox" cellpadding="4" cellspacing="4" width="500">';
echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/news">';
if ($creation_mode == 1)
echo "<input type='hidden' name='create' value='1'>";
else
echo "<input type='hidden' name='update' value='1'>";
echo "<input type='hidden' name='id_news' value='";
if (isset($id_news)) {
echo $id_news;
}
echo "'>";
echo '<tr>
<td class="datos">'.$lang_label["subject"].'</td>
<td class="datos"><input type="text" name="subject" size="35" value="'.$subject.'">';
echo '<tr>
<td class="datos2">'.$lang_label["text"].'</td>
<td class="datos2">
<textarea rows=4 cols=50 name="text" >';
echo $text;
echo '</textarea></td>';
echo '</tr>';
echo "</table>";
echo "<table width='500px'>";
echo "<tr><td align='right'>
<input name='crtbutton' type='submit' class='sub upd' value='".$lang_label["update"]."'>";
echo '</form></td></tr></table>';
} else { // form_add
$creation_mode =1;
$text = "";
$subject = "";
$author = $config['id_user'];
}
else { // Main list view for Links editor
echo "<h2>".$lang_label["setup_screen"]." &gt; ";
echo $lang_label["site_news_management"]."</h3>";
echo "<table cellpadding='4' cellspacing='4' class='databox' width=600>";
echo "<th>".$lang_label["subject"]."</th>";
echo "<th>".$lang_label["author"]."</th>";
echo "<th>".$lang_label["timestamp"]."</th>";
echo "<th>".$lang_label["delete"]."</th>";
$sql1='SELECT * FROM tnews ORDER BY timestamp';
$result=mysql_query($sql1);
$color=1;
while ($row=mysql_fetch_array($result)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo "<tr><td class='$tdcolor'><b><a href='index.php?sec=gsetup&sec2=godmode/setup/news&form_edit=1&id_news=".$row["id_news"]."'>".$row["subject"]."</a></b></td>";
echo "<td class='$tdcolor'>".$row["author"]."</b></td>";
echo "<td class='$tdcolor'>".$row["timestamp"]."</b></td>";
echo '<td class="'.$tdcolor.'" align="center"><a href="index.php?sec=gsetup&sec2=godmode/setup/news&id_news='.$row["id_news"].'&borrar='.$row["id_news"].'" onClick="if (!confirm(\' '.$lang_label["are_you_sure"].'\')) return false;"><img border=0 src="images/cross.png"></a></td></tr>';
// Create news
echo "<h2>".__('setup_screen')." &gt; ";
echo __('site_news_management')."</h2>";
echo '<table class="databox" cellpadding="4" cellspacing="4" width="500">';
echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/news">';
if ($creation_mode == 1)
echo "<input type='hidden' name='create' value='1'>";
else
echo "<input type='hidden' name='update' value='1'>";
echo "<input type='hidden' name='id_news' value='";
if (isset($id_news)) {
echo $id_news;
}
echo "'>";
echo '<tr>
<td class="datos">'.__('subject').'</td>
<td class="datos"><input type="text" name="subject" size="35" value="'.$subject.'">';
echo '<tr>
<td class="datos2">'.__('text').'</td>
<td class="datos2">
<textarea rows=4 cols=50 name="text" >';
echo $text;
echo '</textarea></td>';
echo '</tr>';
echo "</table>";
echo "<table width='500px'>";
echo "<tr><td align='right'>
<input name='crtbutton' type='submit' class='sub upd' value='".__('update')."'>";
echo '</form></td></tr></table>';
} else { // Main list view for Links editor
echo "<h2>".__('setup_screen')." &gt; ";
echo __('site_news_management')."</h3>";
echo "<table cellpadding='4' cellspacing='4' class='databox' width=600>";
echo "<th>".__('subject')."</th>";
echo "<th>".__('author')."</th>";
echo "<th>".__('timestamp')."</th>";
echo "<th>".__('delete')."</th>";
$sql = 'SELECT * FROM tnews ORDER BY timestamp';
$result = mysql_query ($sql);
$color = 1;
while ($row=mysql_fetch_array($result)){
if ($color == 1) {
$tdcolor = "datos";
$color = 0;
}
echo "</table>";
echo "<table width='600'>";
echo "<tr><td align='right'>";
echo "<form method='post' action='index.php?sec=gsetup&sec2=godmode/setup/news&form_add=1'>";
echo "<input type='submit' class='sub next' name='form_add' value='".$lang_label["add"]."'>";
echo "</form></table>";
} // Fin bloque else
} else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Link Management");
require ("general/noaccess.php");
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo "<tr><td class='$tdcolor'><b><a href='index.php?sec=gsetup&sec2=godmode/setup/news&form_edit=1&id_news=".$row["id_news"]."'>".$row["subject"]."</a></b></td>";
?>
echo "<td class='$tdcolor'>".$row["author"]."</b></td>";
echo "<td class='$tdcolor'>".$row["timestamp"]."</b></td>";
echo '<td class="'.$tdcolor.'" align="center"><a href="index.php?sec=gsetup&sec2=godmode/setup/news&id_news='.$row["id_news"].'&borrar='.$row["id_news"].'" onClick="if (!confirm(\' '.__('are_you_sure').'\')) return false;"><img border=0 src="images/cross.png"></a></td></tr>';
}
echo "</table>";
echo "<table width='600'>";
echo "<tr><td align='right'>";
echo "<form method='post' action='index.php?sec=gsetup&sec2=godmode/setup/news&form_add=1'>";
echo "<input type='submit' class='sub next' name='form_add' value='".__('add')."'>";
echo "</form></table>";
}
?>

View File

@ -63,49 +63,49 @@ if ($update_settings) {
mysql_query ("UPDATE tconfig SET VALUE='".$config["sla_period"]."' WHERE token = 'sla_period'");
}
echo "<h2>".lang_string ("setup_screen")." &gt; ";
echo lang_string ("general_config")."</h2>";
echo "<h2>".__('setup_screen')." &gt; ";
echo __('general_config')."</h2>";
$file_styles = list_files('include/styles/', "pandora", 1, 0);
$table->width = '500px';
$table->data = array ();
$table->data[0][0] = lang_string ('language_code');
$table->data[0][0] = __('language_code');
$table->data[0][1] = print_select_from_sql ('SELECT id_language, name FROM tlanguage', 'language_code', $config["language"], '', '', '', true);
$table->data[1][0] = lang_string ('Remote config directory');
$table->data[1][0] = __('Remote config directory');
$table->data[1][1] = print_input_text ('remote_config', $config["remote_config"], '', 30, 100, true);
$table->data[2][0] = lang_string ('Graph color (min)');
$table->data[2][0] = __('Graph color (min)');
$table->data[2][1] = print_input_text ('graph_color1', $config["graph_color1"], '', 8, 8, true);
$table->data[3][0] = lang_string ('Graph color (avg)');
$table->data[3][0] = __('Graph color (avg)');
$table->data[3][1] = print_input_text ('graph_color2', $config["graph_color2"], '', 8, 8, true);
$table->data[4][0] = lang_string ('Graph color (max)');
$table->data[4][0] = __('Graph color (max)');
$table->data[4][1] = print_input_text ('graph_color3', $config["graph_color3"], '', 8, 8, true);
$table->data[5][0] = lang_string ('sla_period');
$table->data[5][0] = __('sla_period');
$table->data[5][1] = print_input_text ('sla_period', $config["sla_period"], '', 5, 5, true);
$table->data[5][0] = lang_string ('days_compact');
$table->data[5][0] = __('days_compact');
$table->data[5][1] = print_input_text ('days_compact', $config["days_compact"], '', 5, 5, true);
$table->data[6][0] = lang_string ('days_purge');
$table->data[6][0] = __('days_purge');
$table->data[6][1] = print_input_text ('days_purge', $config["days_purge"], '', 5, 5, true);
$table->data[7][0] = lang_string ('graph_res');
$table->data[7][0] = __('graph_res');
$table->data[7][1] = print_input_text ('graph_res', $config["graph_res"], '', 5, 5, true);
$table->data[8][0] = lang_string ('step_compact');
$table->data[8][0] = __('step_compact');
$table->data[8][1] = print_input_text ('step_compact', $config["step_compact"], '', 5, 5, true);
$table->data[9][0] = lang_string ('show_unknown');
$table->data[9][0] = __('show_unknown');
$table->data[9][1] = print_checkbox ('show_unknown', 1, $config["show_unknown"], true);
$table->data[10][0] = lang_string ('show_lastalerts');
$table->data[10][0] = __('show_lastalerts');
$table->data[10][1] = print_checkbox ('show_lastalerts', 1, $config["show_lastalerts"], true);
$table->data[11][0] = lang_string ('style_template');
$table->data[11][0] = __('style_template');
$table->data[11][1] = print_select ($file_styles, 'style', $config["style"], '', '', '', true);
$table->data[12][0] = lang_string ('block_size');
$table->data[12][0] = __('block_size');
$table->data[12][1] = print_input_text ('block_size', $config["block_size"], '', 5, 5, true);
$table->data[13][0] = lang_string ('sla_period');
$table->data[13][0] = __('sla_period');
$table->data[13][1] = print_input_text ('sla_period', $config["sla_period"], '', 5, 5, true);
echo '<form id="form_setup" method="POST" action="index.php?sec=gsetup&amp;sec2=godmode/setup/setup">';
print_input_hidden ('update_settings', 1);
print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
print_submit_button (lang_string ('update'), 'update_button', false, 'class="sub upd"');
print_submit_button (__('update'), 'update_button', false, 'class="sub upd"');
echo '</div>';
echo '</form>';
?>

View File

@ -19,80 +19,84 @@
// Load global vars
require("include/config.php");
if (comprueba_login() == 0)
if (give_acl($id_user, 0, "UM")==1) {
// Init. vars
$comentarios = "";
$direccion = "";
$telefono = "";
$password = "";
$password2 = "";
$id_usuario_mio = "";
$nombre_real = "";
$nivel = 0;
// Default is create mode (creacion)
$modo = "creacion";
if (isset($_GET["borrar_grupo"])){ // if modified some parameter
$grupo= entrada_limpia($_GET["borrar_grupo"]);
$query_del2="DELETE FROM tusuario_perfil WHERE id_up = ".$grupo;
$resq1=mysql_query($query_del2);
}
if (isset($_GET["id_usuario_mio"])){ // if any parameter changed
$modo="edicion";
$id_usuario_mio = entrada_limpia($_GET["id_usuario_mio"]);
// Read user data to include in form
$query1="SELECT * FROM tusuario WHERE id_usuario = '".$id_usuario_mio."'";
$resq1=mysql_query($query1);
$rowdup=mysql_fetch_array($resq1);
if (!$rowdup)
{
echo "<h3 class='error'>".$lang_label["user_error"]."</h3>";
echo "</table>";
include ("general/footer.php");
exit;
}
else
check_login();
if (! give_acl ($config['id_user'], 0, "UM")) {
audit_db($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access User Management");
require ("general/noaccess.php");
}
// Init. vars
$comentarios = "";
$direccion = "";
$telefono = "";
$password = "";
$password2 = "";
$id_usuario_mio = "";
$nombre_real = "";
$nivel = 0;
// Default is create mode (creacion)
$modo = "creacion";
if (isset ($_GET["borrar_grupo"])) { // if modified some parameter
$grupo = get_parameter ("borrar_grupo");
$sql = "DELETE FROM tusuario_perfil WHERE id_up = ".$grupo;
$resq1 = mysql_query ($sql);
}
if (isset ($_GET["id_usuario_mio"])) { // if any parameter changed
$modo = "edicion";
$id_usuario_mio = get_parameter ("id_usuario_mio");
// Read user data to include in form
$sql = "SELECT * FROM tusuario WHERE id_usuario = '".$id_usuario_mio."'";
$result = mysql_query ($sql);
$rowdup = mysql_fetch_array ($result);
if (! $rowdup) {
echo "<h3 class='error'>".__('user_error')."</h3>";
echo "</table>";
include ("general/footer.php");
exit;
} else {
$password="";
$password2="";
$comentarios=$rowdup["comentarios"];
$direccion=$rowdup["direccion"];
$telefono=$rowdup["telefono"];
$nivel =$rowdup["nivel"];
$nombre_real=$rowdup["nombre_real"];
}
// Edit user
if (isset ($_POST["edicion"])){
// We do it
if (isset ($_POST["pass1"])){
$nombre = entrada_limpia($_POST["nombre"]);
$nombre_real=entrada_limpia($_POST["nombre_real"]);
$nombre_viejo = entrada_limpia($_POST["id_usuario_antiguo"]);
$password = entrada_limpia($_POST["pass1"]);
$password2 = entrada_limpia($_POST["pass2"]);
if ($password <> $password2){
echo "<h3 class='error'>".$lang_label["pass_nomatch"]."</h3>";
}
else {
$password2 = "";
$comentarios = $rowdup["comentarios"];
$direccion = $rowdup["direccion"];
$telefono = $rowdup["telefono"];
$nivel = $rowdup["nivel"];
$nombre_real = $rowdup["nombre_real"];
}
// Edit user
if (isset ($_POST["edicion"])) {
// We do it
if (isset ($_POST["pass1"])) {
$nombre = get_parameter_post ("nombre");
$nombre_real = get_parameter_post ("nombre_real");
$nombre_viejo = get_parameter_post ("id_usuario_antiguo");
$password = get_parameter_post ("pass1");
$password2 = get_parameter_post ("pass2");
if ($password != $password2){
echo "<h3 class='error'>".__('pass_nomatch')."</h3>";
} else {
if (isset($_POST["nivel"]))
$nivel = entrada_limpia($_POST["nivel"]);
$direccion = entrada_limpia($_POST["direccion"]);
$telefono = entrada_limpia($_POST["telefono"]);
$comentarios = entrada_limpia($_POST["comentarios"]);
if ($password != ""){
$password=md5($password);
$nivel = get_parameter_post ("nivel");
$direccion = get_parameter_post ("direccion");
$telefono = get_parameter_post ("telefono");
$comentarios = get_parameter_post ("comentarios");
if ($password != "") {
$password = md5 ($password);
$sql = "UPDATE tusuario SET nombre_real ='".$nombre_real."', id_usuario ='".$nombre."', password = '".$password."', telefono ='".$telefono."', direccion ='".$direccion." ', nivel = '".$nivel."', comentarios = '".$comentarios."' WHERE id_usuario = '".$nombre_viejo."'";
}
else
} else {
$sql = "UPDATE tusuario SET nombre_real ='".$nombre_real."', id_usuario ='".$nombre."', telefono ='".$telefono."', direccion ='".$direccion." ', nivel = '".$nivel."', comentarios = '".$comentarios."' WHERE id_usuario = '".$nombre_viejo."'";
$resq2=mysql_query($sql);
}
$resq2 = mysql_query ($sql);
// Add group
if (isset($_POST["grupo"]))
if ($_POST["grupo"] <> ""){
if ($_POST["grupo"] != "") {
$grupo = $_POST["grupo"];
$perfil = $_POST["perfil"];
$id_usuario_edit = $_SESSION["id_usuario"];
@ -100,187 +104,182 @@ if (comprueba_login() == 0)
// echo "DEBUG:".$sql;
$resq2=mysql_query($sql);
}
$query1="SELECT * FROM tusuario WHERE id_usuario = '".$nombre."'";
$query1 = "SELECT * FROM tusuario WHERE id_usuario = '".$nombre."'";
$id_usuario_mio = $nombre;
$resq1=mysql_query($query1);
$rowdup=mysql_fetch_array($resq1);
$resq1 = mysql_query ($query1);
$rowdup = mysql_fetch_array ($resq1);
$password="";
$password2= "";
$password2= "";
$comentarios=$rowdup["comentarios"];
$direccion=$rowdup["direccion"];
$telefono=$rowdup["telefono"];
$nivel = $rowdup["nivel"];
$nombre_real=$rowdup["nombre_real"];
$modo ="edicion";
echo "<h3 class='suc'>".$lang_label["update_user_ok"]."</h3>";
echo "<h3 class='suc'>".__('update_user_ok')."</h3>";
}
}
else {
echo "<h3 class='error'>".$lang_label["update_user_no"]."</h3>";
}
}
// Create user
if (isset($_GET["nuevo_usuario"])){
// Get data from POST
$nombre = entrada_limpia($_POST["nombre"]);
$password = entrada_limpia($_POST["pass1"]);
$password2 = entrada_limpia($_POST["pass2"]);
$nombre_real=entrada_limpia($_POST["nombre_real"]);
if ($password <> $password2){
echo "<h3 class='error'>".$lang_label["pass_nomatch"]."</h3>";
}
$direccion = entrada_limpia($_POST["direccion"]);
$telefono = entrada_limpia($_POST["telefono"]);
$comentarios = entrada_limpia($_POST["comentarios"]);
if (isset($_POST["nivel"]))
$nivel = entrada_limpia($_POST["nivel"]);
$password=md5($password);
$ahora = date("Y/m/d H:i:s");
$sql_insert = "INSERT INTO tusuario (id_usuario,direccion,password,telefono,fecha_registro,nivel,comentarios, nombre_real) VALUES ('".$nombre."','".$direccion."','".$password."','".$telefono."','".$ahora."','".$nivel."','".$comentarios."','".$nombre_real."')";
$resq1=mysql_query($sql_insert);
if (! $resq1)
echo "<h3 class='error'>".$lang_label["create_user_no"]."</h3>";
else {
echo "<h3 class='suc'>".$lang_label["create_user_ok"]."</h3>";
}
$id_usuario_mio = $nombre;
$modo ="edicion";
$password = "";
$password2 = "";
} else {
echo "<h3 class='error'>".__('update_user_no')."</h3>";
}
echo "<h2>".$lang_label["user_management"]." &gt; ";
if (isset($_GET["alta"])){
if ($_GET["alta"]==1){
echo $lang_label["create_user"];
}
}
// Create user
if (isset ($_GET["nuevo_usuario"])) {
// Get data from POST
$nombre = get_parameter_post ("nombre");
$password = get_parameter_post ("pass1");
$password2 = get_parameter_post ("pass2");
$nombre_real=get_parameter_post ("nombre_real");
if ($password <> $password2){
echo "<h3 class='error'>".__('pass_nomatch')."</h3>";
}
$direccion = get_parameter_post ("direccion");
$telefono = get_parameter_post ("telefono");
$comentarios = get_parameter_post ("comentarios");
if (isset ($_POST["nivel"]))
$nivel = get_parameter_post ("nivel");
$password = md5 ($password);
$ahora = date("Y/m/d H:i:s");
$sql = "INSERT INTO tusuario (id_usuario,direccion,password,telefono,fecha_registro,nivel,comentarios, nombre_real) VALUES ('".$nombre."','".$direccion."','".$password."','".$telefono."','".$ahora."','".$nivel."','".$comentarios."','".$nombre_real."')";
$resq1 = mysql_query ($sql);
if (! $resq1)
echo "<h3 class='error'>".__('create_user_no')."</h3>";
else {
echo "<h3 class='suc'>".__('create_user_ok')."</h3>";
}
$id_usuario_mio = $nombre;
$modo ="edicion";
$password = "";
$password2 = "";
}
echo "<h2>".__('user_management')." &gt; ";
if (isset($_GET["alta"])) {
if ($_GET["alta"] == 1) {
echo __('create_user');
}
if (isset($_GET["id_usuario_mio"]) OR isset($_GET["nuevo_usuario"])){
echo $lang_label["update_user"];
}
echo "</h2>";
}
if (isset ($_GET["id_usuario_mio"]) || isset ($_GET["nuevo_usuario"])) {
echo __('update_user');
}
echo "</h2>";
?>
<table width='500' cellpadding='4' cellspacing='4' class='databox_color'>
<?php
if (isset($_GET["alta"]))
echo '<form name="new_user" method="post" action="index.php?sec=gusuarios&sec2=godmode/users/configure_user&nuevo_usuario=1">';
else
echo '<form name="user_mod" method="post" action="index.php?sec=gusuarios&sec2=godmode/users/configure_user&id_usuario_mio='.$id_usuario_mio.'">';
?>
<tr>
<td class="datos"><?php echo $lang_label["id_user"] ?></td>
<td class="datos"><input type="text" name="nombre" value="<?php echo $id_usuario_mio ?>"></td>
<tr><td class="datos2"><?php echo $lang_label["real_name"] ?>
<td class="datos2"><input type="text" name="nombre_real" value="<?php echo $nombre_real ?>"></td>
<?PHP
echo '<tr><td class="datos">';
echo lang_string ("password");
echo '<td class="datos">';
echo '<input type="password" name="pass1" value="'.$password.'"></td>';
echo '<tr><td class="datos2">';
echo lang_string ("password"). " ". lang_string ("confirmation").'</td>';
echo '<td class="datos">';
echo '<input type="password" name="pass2" value="'.$password2.'"></td>';
echo '<tr><td class="datos">E-Mail</td>';
<table width='500' cellpadding='4' cellspacing='4' class='databox_color'>
<?php
if (isset ($_GET["alta"]))
echo '<form name="new_user" method="post" action="index.php?sec=gusuarios&sec2=godmode/users/configure_user&nuevo_usuario=1">';
else
echo '<form name="user_mod" method="post" action="index.php?sec=gusuarios&sec2=godmode/users/configure_user&id_usuario_mio='.$id_usuario_mio.'">';
?>
<td class="datos"><input type="text" name="direccion" size="40" value="<?php echo $direccion ?>"></td>
<tr><td class="datos2"><?php echo $lang_label["telefono"] ?></td>
<td class="datos2"><input type="text" name="telefono" value="<?php echo $telefono ?>"></td>
<tr><td class="datos"><?php echo $lang_label["global_profile"] ?></td>
<td class="datos">
<?php if ($nivel == "1"){
echo $lang_label["administrator"].'<input type="radio" class="chk" name="nivel" value="1" checked><a href="#" class="tip">&nbsp;<span>'.$help_label["users_msg1"].'</span></a>&nbsp;';
echo $lang_label["normal_user"].'<input type="radio" class="chk" name="nivel" value="0"><a href="#" class="tip">&nbsp;<span>'.$help_label["users_msg2"].'</span></a>';
} else {
echo $lang_label["administrator"].'<input type="radio" class="chk" name="nivel" value="1"><a href="#" class="tip">&nbsp;<span>'.$help_label["users_msg1"].'</span></a>&nbsp;';
echo $lang_label["normal_user"].'<input type="radio" class="chk" name="nivel" value="0" checked><a href="#" class="tip">&nbsp;<span>'.$help_label["users_msg2"].'</span></a>';
}
?>
<tr><td class="datos2" colspan="2"><?php echo $lang_label["comments"] ?></td>
<tr><td class="datos" colspan="2">
<textarea name="comentarios" cols="60" rows="4"><?php echo $comentarios ?></textarea>
</td></tr>
<?php
if ($modo == "edicion") { // Only show groups for existing users
// Combo for group
echo '<input type="hidden" name="edicion" value="1">';
echo '<input type="hidden" name="id_usuario_antiguo" value="'.$id_usuario_mio.'">';
echo '<tr><td class="datos2">'.$lang_label["group_avail"].'</td>
<td class="datos2">
<select name="grupo" class="w155">';
echo "<option value=''>".$lang_label["none"];
$sql1='SELECT * FROM tgrupo ORDER BY nombre';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
echo "<option value='".$row["id_grupo"]."'>".$row["nombre"]."</option>";
}
echo '</select>';
echo '</td></tr>';
echo "<tr><td class='datos'>".$lang_label["profiles"]."</td>";
echo "<td class='datos'>
<select name='perfil' class='w155'>";
$sql1='SELECT * FROM tperfil ORDER BY name';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
echo "<option value='".$row["id_perfil"]."'>".$row["name"]."</option>";
}
echo '</select>';
echo '</td>';
echo '</tr></table>';
echo "<table width=500>";
echo "<tr><td align='right'>";
echo "<input name='uptbutton' type='submit' class='sub upd' value='".$lang_label["update"]."'></td></tr></table><br>";
// Show user profile / groups assigned
$sql1='SELECT * FROM tusuario_perfil WHERE id_usuario = "'.$id_usuario_mio.'"';
$result=mysql_query($sql1);
echo '<h3>'.$lang_label["listGroupUser"].'</h3>';
echo "<table width='500' cellpadding='4' cellspacing='4' class='databox'>";
if (mysql_num_rows($result)){
echo '<tr>';
$color=1;
while ($row=mysql_fetch_array($result)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo '<td class="'.$tdcolor.'">';
echo "<b style='margin-left:10px'>".dame_perfil($row["id_perfil"])."</b> / ";
echo "<b>".dame_grupo($row["id_grupo"])."</b>";
echo '<td class="'.$tdcolor.'t"><a href="index.php?sec=gusuarios&sec2=godmode/users/configure_user&id_usuario_mio='.$id_usuario_mio.'&borrar_grupo='.$row["id_up"].' " onClick="if (!confirm(\' '.$lang_label["are_you_sure"].'\')) return false;"><img border=0 src="images/cross.png"></a><tr>';
}
}
else {
echo '<div class="nf">'.$lang_label["no_profile"].'</div>';
}
}
?>
<?php if (isset($_GET["alta"])){
echo '</tr></table>';
echo '<table width="500">';
echo '<tr><td align="right">';
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.$lang_label["create"].'">';
}
?>
</form>
</td></tr></table>
<tr>
<td class="datos"><?php echo __('id_user') ?></td>
<td class="datos"><input type="text" name="nombre" value="<?php echo $id_usuario_mio ?>"></td>
<tr><td class="datos2"><?php echo __('real_name') ?>
<td class="datos2"><input type="text" name="nombre_real" value="<?php echo $nombre_real ?>"></td>
<?php
} // end security check
else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access User Management");
require ("general/noaccess.php");
}
?>
echo '<tr><td class="datos">';
echo __('password');
echo '<td class="datos">';
echo '<input type="password" name="pass1" value="'.$password.'"></td>';
echo '<tr><td class="datos2">';
echo __('password'). " ". __('confirmation').'</td>';
echo '<td class="datos">';
echo '<input type="password" name="pass2" value="'.$password2.'"></td>';
echo '<tr><td class="datos">E-Mail</td>';
?>
<td class="datos"><input type="text" name="direccion" size="40" value="<?php echo $direccion ?>"></td>
<tr><td class="datos2"><?php echo __('telefono') ?></td>
<td class="datos2"><input type="text" name="telefono" value="<?php echo $telefono ?>"></td>
<tr><td class="datos"><?php echo __('global_profile') ?></td>
<td class="datos">
<?php
if ($nivel == "1") {
echo __('administrator').'<input type="radio" class="chk" name="nivel" value="1" checked><a href="#" class="tip">&nbsp;<span>'.$help_label["users_msg1"].'</span></a>&nbsp;';
echo __('normal_user').'<input type="radio" class="chk" name="nivel" value="0"><a href="#" class="tip">&nbsp;<span>'.$help_label["users_msg2"].'</span></a>';
} else {
echo __('administrator').'<input type="radio" class="chk" name="nivel" value="1"><a href="#" class="tip">&nbsp;<span>'.$help_label["users_msg1"].'</span></a>&nbsp;';
echo __('normal_user').'<input type="radio" class="chk" name="nivel" value="0" checked><a href="#" class="tip">&nbsp;<span>'.$help_label["users_msg2"].'</span></a>';
}
?>
<tr><td class="datos2" colspan="2"><?php echo __('comments') ?></td>
<tr><td class="datos" colspan="2">
<textarea name="comentarios" cols="60" rows="4"><?php echo $comentarios ?></textarea>
</td></tr>
<?php
if ($modo == "edicion") { // Only show groups for existing users
// Combo for group
echo '<input type="hidden" name="edicion" value="1">';
echo '<input type="hidden" name="id_usuario_antiguo" value="'.$id_usuario_mio.'">';
echo '<tr><td class="datos2">'.__('group_avail').'</td>
<td class="datos2">
<select name="grupo" class="w155">';
echo "<option value=''>".__('none');
$sql1='SELECT * FROM tgrupo ORDER BY nombre';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
echo "<option value='".$row["id_grupo"]."'>".$row["nombre"]."</option>";
}
echo '</select>';
echo '</td></tr>';
echo "<tr><td class='datos'>".__('profiles')."</td>";
echo "<td class='datos'>
<select name='perfil' class='w155'>";
$sql1='SELECT * FROM tperfil ORDER BY name';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
echo "<option value='".$row["id_perfil"]."'>".$row["name"]."</option>";
}
echo '</select>';
echo '</td>';
echo '</tr></table>';
echo "<table width=500>";
echo "<tr><td align='right'>";
echo "<input name='uptbutton' type='submit' class='sub upd' value='".__('update')."'></td></tr></table><br>";
// Show user profile / groups assigned
$sql1='SELECT * FROM tusuario_perfil WHERE id_usuario = "'.$id_usuario_mio.'"';
$result=mysql_query($sql1);
echo '<h3>'.__('listGroupUser').'</h3>';
echo "<table width='500' cellpadding='4' cellspacing='4' class='databox'>";
if (mysql_num_rows($result)){
echo '<tr>';
$color=1;
while ($row=mysql_fetch_array($result)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo '<td class="'.$tdcolor.'">';
echo "<b style='margin-left:10px'>".dame_perfil($row["id_perfil"])."</b> / ";
echo "<b>".dame_grupo($row["id_grupo"])."</b>";
echo '<td class="'.$tdcolor.'t"><a href="index.php?sec=gusuarios&sec2=godmode/users/configure_user&id_usuario_mio='.$id_usuario_mio.'&borrar_grupo='.$row["id_up"].' " onClick="if (!confirm(\' '.__('are_you_sure').'\')) return false;"><img border=0 src="images/cross.png"></a><tr>';
}
}
else {
echo '<div class="nf">'.__('no_profile').'</div>';
}
}
?>
<?php
if (isset($_GET["alta"])) {
echo '</tr></table>';
echo '<table width="500">';
echo '<tr><td align="right">';
echo '<input name="crtbutton" type="submit" class="sub wand" value="'.__('create').'">';
}
?>
</form>
</td></tr></table>

View File

@ -8,38 +8,42 @@
// Load globar vars
require("include/config.php");
if (comprueba_login() == 0)
if (give_acl($id_user, 0, "UM")==1) {
if (isset($_GET["borrar_usuario"])){ // if delete user
$nombre= entrada_limpia($_GET["borrar_usuario"]);
// Delete user
// Delete cols from table tgrupo_usuario
$query_del1="DELETE FROM tgrupo_usuario WHERE usuario = '".$nombre."'";
$query_del2="DELETE FROM tusuario WHERE id_usuario = '".$nombre."'";
$resq1=mysql_query($query_del1);
$resq1=mysql_query($query_del2);
if (! $resq1)
echo "<h3 class='error'>".$lang_label["delete_user_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_user_ok"]."</h3>";
}
check_login ();
if (! give_acl ($config['id_user'], 0, "UM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access User Management");
require ("general/noaccess.php");
}
if (isset($_GET["borrar_usuario"])) { // if delete user
$nombre= entrada_limpia($_GET["borrar_usuario"]);
// Delete user
// Delete cols from table tgrupo_usuario
$sql = "DELETE FROM tgrupo_usuario WHERE usuario = '".$nombre."'";
$result = mysql_query ($sql);
$sql = "DELETE FROM tusuario WHERE id_usuario = '".$nombre."'";
$result = mysql_query ($sql);
if (! $result)
echo "<h3 class='error'>".__('delete_user_no')."</h3>";
else
echo "<h3 class='suc'>".__('delete_user_ok')."</h3>";
}
?>
<h2><?php echo $lang_label["user_management"] ?> &gt;
<?php echo $lang_label["users"] ?></h2>
<h2><?php echo __('user_management') ?> &gt;
<?php echo __('users') ?></h2>
<table width="700" cellpadding="4" cellspacing="4" class="databox">
<th width="80px"><?php echo $lang_label["user_ID"]?></th>
<th width="155px"><?php echo $lang_label["last_contact"]?></th>
<th width="45px"><?php echo $lang_label["profile"]?></th>
<th width="120px"><?php echo $lang_label["name"]?></th>
<th><?php echo $lang_label["description"]?></th>
<th width="30px"><?php echo $lang_label["delete"]?></th>
<th width="80px"><?php echo __('user_ID')?></th>
<th width="155px"><?php echo __('last_contact')?></th>
<th width="45px"><?php echo __('profile')?></th>
<th width="120px"><?php echo __('name')?></th>
<th><?php echo __('description')?></th>
<th width="30px"><?php echo __('delete')?></th>
<?php
$query1="SELECT * FROM tusuario";
$resq1=mysql_query($query1);
$sql = "SELECT * FROM tusuario";
$resq1 = mysql_query ($sql);
// Init vars
$nombre = "";
$nivel = "";
@ -47,7 +51,7 @@ $comentarios = "";
$fecha_registro = "";
$color=1;
while ($rowdup=mysql_fetch_array($resq1)){
while ($rowdup = mysql_fetch_array ($resq1)) {
$name = $rowdup["id_usuario"];
$nivel = $rowdup["nivel"];
$real_name = $rowdup["nombre_real"];
@ -72,34 +76,29 @@ while ($rowdup=mysql_fetch_array($resq1)){
else
echo "<img src='images/user_green.png'>";
$sql1='SELECT * FROM tusuario_perfil WHERE id_usuario = "'.$name.'"';
$result=mysql_query($sql1);
$sql = 'SELECT * FROM tusuario_perfil WHERE id_usuario = "'.$name.'"';
$result = mysql_query ($sql);
echo "<a href='#' class='$tip'>&nbsp;<span>";
if (mysql_num_rows($result)){
while ($row=mysql_fetch_array($result)){
echo dame_perfil($row["id_perfil"])."/ ";
echo dame_grupo($row["id_grupo"])."<br>";
if (mysql_num_rows ($result)) {
while ($row = mysql_fetch_array ($result)) {
echo dame_perfil ($row["id_perfil"])."/ ";
echo dame_grupo ($row["id_grupo"])."<br>";
}
} else {
echo __('no_profile');
}
else { echo $lang_label["no_profile"]; }
echo "</span></a>";
echo "<td class='$tdcolor' width='100'>".substr($real_name,0,16)."</td>";
echo "<td class='$tdcolor' width='100'>".substr ($real_name, 0, 16)."</td>";
echo "<td class='$tdcolor'>".$comments."</td>";
echo "<td class='$tdcolor' align='center'><a href='index.php?sec=gagente&sec2=godmode/users/user_list&borrar_usuario=".$name."' onClick='if (!confirm(\' ".$lang_label["are_you_sure"]."\')) return false;'><img border='0' src='images/cross.png'></a></td>";
echo "<td class='$tdcolor' align='center'><a href='index.php?sec=gagente&sec2=godmode/users/user_list&borrar_usuario=".$name."' onClick='if (!confirm(\' ".__('are_you_sure')."\')) return false;'><img border='0' src='images/cross.png'></a></td>";
}
echo "</tr></table>";
echo "<table width=700>";
echo "<tr><td align='right'>";
echo "<form method=post action='index.php?sec=gusuarios&sec2=godmode/users/configure_user&alta=1'>";
echo "<input type='submit' class='sub next' name='crt' value='".$lang_label["create_user"]."'>";
echo "</form></td></tr></table>";
echo "</tr></table>";
echo "<table width=700>";
echo "<tr><td align='right'>";
echo "<form method=post action='index.php?sec=gusuarios&sec2=godmode/users/configure_user&alta=1'>";
echo "<input type='submit' class='sub next' name='crt' value='".__('create_user')."'>";
echo "</form></td></tr></table>";
echo "</table>";
} // end verify security of page
else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access User Management");
require ("general/noaccess.php");
}
?>
?>

View File

@ -46,7 +46,7 @@ function safe_input ($value) {
if (is_numeric ($value))
return $value;
if (is_array ($value)) {
array_walk (&$value,'safe_input');
array_walk ($value,'safe_input');
return $value;
}
return htmlentities (utf8_decode ($value), ENT_QUOTES);
@ -198,11 +198,11 @@ function popup_help ($help_id, $return = false) {
function no_permission () {
require("config.php");
require ("include/languages/language_".$config["language"].".php");
echo "<h3 class='error'>".lang_string ('no_permission_title')."</h3>";
echo "<h3 class='error'>".__('no_permission_title')."</h3>";
echo "<img src='images/noaccess.png' alt='No access' width='120'><br><br>";
echo "<table width=550>";
echo "<tr><td>";
echo lang_string ('no_permission_text');
echo __('no_permission_text');
echo "</table>";
echo "<tr><td><td><td><td>";
include "general/footer.php";
@ -217,11 +217,11 @@ function no_permission () {
function unmanaged_error ($error = "") {
require("config.php");
require ("include/languages/language_".$config["language"].".php");
echo "<h3 class='error'>".lang_string("Unmanaged error")."</h3>";
echo "<h3 class='error'>".__('Unmanaged error')."</h3>";
echo "<img src='images/errror.png' alt='error'><br><br>";
echo "<table width=550>";
echo "<tr><td>";
echo lang_string("Unmanaged error_text");
echo __('Unmanaged error_text');
echo "<tr><td>";
echo $error;
echo "</table>";
@ -452,24 +452,24 @@ function format_for_graph ($number , $decimals = 1, $dec_point = ".", $thousands
*/
function human_time_comparation ($timestamp) {
if ($timestamp == "") {
return "0 ".lang_string ('minutes');
return "0 ".__('minutes');
}
$ahora = date ("Y/m/d H:i:s");
$seconds = strtotime ($ahora) - strtotime ($timestamp);
if ($seconds < 3600)
return format_numeric ($seconds / 60, 1)." ".lang_string ('minutes');
return format_numeric ($seconds / 60, 1)." ".__('minutes');
if ($seconds >= 3600 && $seconds < 86400)
return format_numeric ($seconds / 3600, 1)." ".lang_string ('hours');
return format_numeric ($seconds / 3600, 1)." ".__('hours');
if ($seconds >= 86400 && $seconds < 2592000)
return format_numeric ($seconds / 86400, 1)." ".lang_string ('days');
return format_numeric ($seconds / 86400, 1)." ".__('days');
if ($seconds >= 2592000 && $seconds < 15552000)
return format_numeric ($seconds / 2592000, 1)." ".lang_string ('months');
return " +6 ".lang_string ('months');
return format_numeric ($seconds / 2592000, 1)." ".__('months');
return " +6 ".__('months');
}
/**
@ -483,12 +483,12 @@ function human_time_comparation ($timestamp) {
function human_time_description_raw ($seconds) {
global $lang_label;
if ($seconds < 3600)
return format_numeric($seconds/60,2)." ".lang_string ('minutes');
return format_numeric($seconds/60,2)." ".__('minutes');
if ($seconds >= 3600 && $seconds < 86400)
return format_numeric ($seconds/3600,2)." ".lang_string ('hours');
return format_numeric ($seconds/3600,2)." ".__('hours');
return format_numeric ($seconds/86400,2)." ".lang_string ('days');
return format_numeric ($seconds/86400,2)." ".__('days');
}
/**
@ -505,40 +505,40 @@ function human_time_description ($period) {
switch ($period) {
case 3600:
return lang_string ('hour');
return __('hour');
break;
case 7200:
return lang_string ('2_hours');
return __('2_hours');
break;
case 21600:
return lang_string ('6_hours');
return __('6_hours');
break;
case 43200:
return lang_string ('12_hours');
return __('12_hours');
break;
case 86400:
return lang_string ('last_day');
return __('last_day');
break;
case 172800:
return lang_string ('two_days');
return __('two_days');
break;
case 432000:
return lang_string ('five_days');
return __('five_days');
break;
case 604800:
return lang_string ('last_week');
return __('last_week');
break;
case 1296000:
return lang_string ('15_days');
return __('15_days');
break;
case 2592000:
return lang_string ('last_month');
return __('last_month');
break;
case 5184000:
return lang_string ('two_month');
return __('two_month');
break;
case 15552000:
return lang_string ('six_months');
return __('six_months');
break;
default:
return human_time_description_raw ($period);
@ -645,19 +645,19 @@ function get_alert_priority ($priority = 0) {
global $config;
switch ($priority) {
case 0:
return lang_string("Maintenance");
return __('Maintenance');
break;
case 1:
return lang_string("Informational");
return __('Informational');
break;
case 2:
return lang_string("Normal");
return __('Normal');
break;
case 3:
return lang_string("Warning");
return __('Warning');
break;
case 4:
return lang_string("Critical");
return __('Critical');
break;
}
return '';
@ -676,9 +676,9 @@ function get_alert_days ($row) {
$check = $row["monday"] + $row["tuesday"] + $row["wednesday"] + $row["thursday"] + $row["friday"] + $row["saturday"] + $row["sunday"];
if ($check == 7) {
return lang_string ("all");
return __('all');
} elseif ($check == 0) {
return lang_string ("none");
return __('none');
}
if ($row["monday"] != 0)
$days_output .= "Mo ";
@ -711,15 +711,15 @@ function get_alert_times ($row2) {
if ($row2["time_from"]){
$time_from_table = $row2["time_from"];
} else {
$time_from_table = lang_string ("N/A");
$time_from_table = __('N/A');
}
if ($row2["time_to"]){
$time_to_table = $row2["time_to"];
} else {
$time_to_table = lang_string ("N/A");
$time_to_table = __('N/A');
}
if ($time_to_table == $time_from_table)
return lang_string ('N/A');
return __('N/A');
return substr ($time_from_table, 0, 5)." - ".substr ($time_to_table, 0, 5);
}
@ -740,7 +740,7 @@ function show_alert_row_edit ($row2, $tdcolor = "datos", $id_tipo_modulo = 1, $c
$string = "";
if ($row2["disable"] == 1){
$string .= "<td class='$tdcolor'><b><i>".lang_string ('disabled')."</b></i>";
$string .= "<td class='$tdcolor'><b><i>".__('disabled')."</b></i>";
} elseif ($id_tipo_modulo != 0) {
$string .= "<td class='$tdcolor'><img src='images/".show_icon_type($id_tipo_modulo)."' border=0>";
} else {
@ -780,7 +780,7 @@ function show_alert_row_edit ($row2, $tdcolor = "datos", $id_tipo_modulo = 1, $c
// We have alert text ?
if ($row2["alert_text"]!= "") {
$string = $string."<td colspan=2 class='$tdcolor'>".lang_string ('text')."</td>";
$string = $string."<td colspan=2 class='$tdcolor'>".__('text')."</td>";
} else {
$string = $string."<td class='$tdcolor'>".$mymin."</td>";
$string = $string."<td class='$tdcolor'>".$mymax."</td>";
@ -795,16 +795,16 @@ function show_alert_row_edit ($row2, $tdcolor = "datos", $id_tipo_modulo = 1, $c
// Has recovery notify activated ?
if ($row2["recovery_notify"] > 0)
$recovery_notify = lang_string("Yes");
$recovery_notify = __('Yes');
else
$recovery_notify = lang_string("No");
$recovery_notify = __('No');
// calculate priority
$priority = get_alert_priority ($row2["priority"]);
// calculare firing conditions
if ($row2["alert_text"] != "") {
$firing_cond = lang_string("text")."(".substr($row2["alert_text"],0,8).")";
$firing_cond = __('text')."(".substr($row2["alert_text"],0,8).")";
} else {
$firing_cond = $row2["min_alerts"]." / ".$row2["max_alerts"];
}
@ -822,16 +822,16 @@ function show_alert_row_edit ($row2, $tdcolor = "datos", $id_tipo_modulo = 1, $c
<table cellspacing='2' cellpadding='0'
style='margin-left:2px;'>
<tr><th colspan='2' width='91'>".
lang_string("Recovery")."</th></tr>
__('Recovery')."</th></tr>
<tr><td colspan='2' class='datos' align='center'><b>$recovery_notify</b></td></tr>
<tr><th colspan='2' width='91'>".
lang_string("Priority")."</th></tr>
__('Priority')."</th></tr>
<tr><td colspan='2' class='datos' align='center'><b>$priority</b></td></tr>
<tr><th colspan='2' width='91'>".
lang_string("Alert Ctrl.")."</th></tr>
__('Alert Ctrl.')."</th></tr>
<tr><td colspan='2' class='datos' align='center'><b>".$firing_cond."</b></td></tr>
<tr><th colspan='2' width='91'>".
lang_string("Firing days")."</th></tr>
__('Firing days')."</th></tr>
<tr><td colspan='2' class='datos' align='center'><b>".$firing_days."</b></td></tr>
</table></span></A>";
@ -884,16 +884,16 @@ function show_alert_show_view ($data, $tdcolor = "datos", $combined = 0) {
// Has recovery notify activated ?
if ($data["recovery_notify"] > 0)
$recovery_notify = lang_string("Yes");
$recovery_notify = __('Yes');
else
$recovery_notify = lang_string("No");
$recovery_notify = __('No');
// calculate priority
$priority = get_alert_priority ($data["priority"]);
// calculare firing conditions
if ($data["alert_text"] != ""){
$firing_cond = lang_string("text")."(".substr($data["alert_text"],0,8).")";
$firing_cond = __('text')."(".substr($data["alert_text"],0,8).")";
} else {
$firing_cond = $data["min_alerts"]." / ".$data["max_alerts"];
}
@ -909,16 +909,16 @@ function show_alert_show_view ($data, $tdcolor = "datos", $combined = 0) {
<table cellspacing='2' cellpadding='0'
style='margin-left:2px;'>
<tr><th colspan='2' width='91'>".
lang_string("Recovery")."</th></tr>
__('Recovery')."</th></tr>
<tr><td colspan='2' class='datos' align='center'><b>$recovery_notify</b></td></tr>
<tr><th colspan='2' width='91'>".
lang_string("Priority")."</th></tr>
__('Priority')."</th></tr>
<tr><td colspan='2' class='datos' align='center'><b>$priority</b></td></tr>
<tr><th colspan='2' width='91'>".
lang_string("Alert Ctrl.")."</th></tr>
__('Alert Ctrl.')."</th></tr>
<tr><td colspan='2' class='datos' align='center'><b>".$firing_cond."</b></td></tr>
<tr><th colspan='2' width='91'>".
lang_string("Firing days")."</th></tr>
__('Firing days')."</th></tr>
<tr><td colspan='2' class='datos' align='center'><b>".$firing_days."</b></td></tr>
</table></span></a>";
@ -937,20 +937,20 @@ function show_alert_show_view ($data, $tdcolor = "datos", $combined = 0) {
$mymax = format_for_graph($mymax );
// Text alert ?
if ($data["alert_text"] != "")
echo "<td class='".$tdcolor."' colspan=2>".lang_string ('text')."</td>";
echo "<td class='".$tdcolor."' colspan=2>".__('text')."</td>";
else {
echo "<td class='".$tdcolor."'>".$mymin."</td>";
echo "<td class='".$tdcolor."'>".$mymax."</td>";
}
echo "<td align='center' class='".$tdcolor."'>".human_time_description($data["time_threshold"]);
if ($data["last_fired"] == "0000-00-00 00:00:00") {
echo "<td align='center' class='".$tdcolor."f9'>".lang_string ('never')."</td>";
echo "<td align='center' class='".$tdcolor."f9'>".__('never')."</td>";
} else {
echo "<td align='center' class='".$tdcolor."f9'>".human_time_comparation ($data["last_fired"])."</td>";
}
echo "<td align='center' class='".$tdcolor."'>".$data["times_fired"]."</td>";
if ($data["times_fired"] <> 0){
echo "<td class='".$tdcolor."' align='center'><img width='20' height='9' src='images/pixel_red.png' title='".lang_string ('fired')."'>";
echo "<td class='".$tdcolor."' align='center'><img width='20' height='9' src='images/pixel_red.png' title='".__('fired')."'>";
echo "</td>";
$id_grupo_alerta = get_db_value ("id_grupo", "tagente", "id_agente", $id_agente);
if (give_acl($config["id_user"], $id_grupo_alerta, "AW") == 1) {
@ -961,7 +961,7 @@ function show_alert_show_view ($data, $tdcolor = "datos", $combined = 0) {
}
} else {
echo "<td class='".$tdcolor."' align='center'>
<img width='20' height='9' src='images/pixel_green.png' title='".lang_string ('not_fired')."'></td>";
<img width='20' height='9' src='images/pixel_green.png' title='".__('not_fired')."'></td>";
}
}
@ -972,19 +972,19 @@ function show_alert_show_view ($data, $tdcolor = "datos", $combined = 0) {
*/
function get_report_types () {
$types = array ();
$types['simple_graph'] = lang_string ('simple_graph');
$types['custom_graph'] = lang_string ('custom_graph');
$types['SLA'] = lang_string ('SLA');
$types['event_report'] = lang_string ('event_report');
$types['alert_report'] = lang_string ('alert_report');
$types['monitor_report'] = lang_string ('monitor_report');
$types['avg_value'] = lang_string ('avg_value');
$types['max_value'] = lang_string ('max_value');
$types['min_value'] = lang_string ('min_value');
$types['sumatory'] = lang_string ('sumatory');
$types['general_group_report'] = lang_string ('general_group_report');
$types['monitor_health'] = lang_string ('monitor_health');
$types['agents_detailed'] = lang_string ('agents_detailed');
$types['simple_graph'] = __('simple_graph');
$types['custom_graph'] = __('custom_graph');
$types['SLA'] = __('SLA');
$types['event_report'] = __('event_report');
$types['alert_report'] = __('alert_report');
$types['monitor_report'] = __('monitor_report');
$types['avg_value'] = __('avg_value');
$types['max_value'] = __('max_value');
$types['min_value'] = __('min_value');
$types['sumatory'] = __('sumatory');
$types['general_group_report'] = __('general_group_report');
$types['monitor_health'] = __('monitor_health');
$types['agents_detailed'] = __('agents_detailed');
return $types;
}
@ -999,7 +999,7 @@ function get_report_types () {
function get_report_name ($type) {
$types = get_report_types ();
if (! isset ($types[$type]))
return lang_string ('unknown');
return __('unknown');
return $types[$type];
}
@ -1108,16 +1108,16 @@ function is_module_data_string ($module_name) {
*/
function get_event_types () {
$types = array ();
$types['unknown'] = lang_string ('unknown');
$types['monitor_up'] = lang_string ('monitor_up');
$types['monitor_down'] = lang_string ('monitor_down');
$types['alert_fired'] = lang_string ('alert_fired');
$types['alert_recovered'] = lang_string ('alert_recovered');
$types['alert_ceased'] = lang_string ('alert_ceased');
$types['alert_manual_validation'] = lang_string ('alert_manual_validation');
$types['recon_host_detected'] = lang_string ('recon_host_detected');
$types['system'] = lang_string ('sytem');
$types['error'] = lang_string ('error');
$types['unknown'] = __('unknown');
$types['monitor_up'] = __('monitor_up');
$types['monitor_down'] = __('monitor_down');
$types['alert_fired'] = __('alert_fired');
$types['alert_recovered'] = __('alert_recovered');
$types['alert_ceased'] = __('alert_ceased');
$types['alert_manual_validation'] = __('alert_manual_validation');
$types['recon_host_detected'] = __('recon_host_detected');
$types['system'] = __('sytem');
$types['error'] = __('error');
return $types;
}
@ -1129,11 +1129,11 @@ function get_event_types () {
*/
function get_priorities () {
$priorities = array ();
$priorities[0] = lang_string ("Maintenance");
$priorities[1] = lang_string ("Informational");
$priorities[2] = lang_string ("Normal");
$priorities[3] = lang_string ("Warning");
$priorities[4] = lang_string ("Critical");
$priorities[0] = __('Maintenance');
$priorities[1] = __('Informational');
$priorities[2] = __('Normal');
$priorities[3] = __('Warning');
$priorities[4] = __('Critical');
return $priorities;
}
@ -1148,17 +1148,17 @@ function return_priority ($priority) {
switch ($priority) {
case 0:
return lang_string ("Maintenance");
return __('Maintenance');
case 1:
return lang_string ("Informational");
return __('Informational');
case 2:
return lang_string ("Normal");
return __('Normal');
case 3:
return lang_string ("Warning");
return __('Warning');
case 4:
return lang_string ("Critical");
return __('Critical');
case -1:
return lang_string ("All");
return __('All');
}
}

View File

@ -70,11 +70,11 @@ function give_acl ($id_user, $id_group, $access) {
//Joined multiple queries into one. That saves on the query overhead and query cache.
if ($id_group == 0) {
$query1=sprintf("SELECT tperfil.incident_view,tperfil.incident_edit,tperfil.incident_management,tperfil.agent_view,tperfil.agent_edit,tperfil.alert_edit,tperfil.alert_management,tperfil.pandora_management,tperfil.db_management,tperfil.user_management FROM tusuario_perfil,tperfil WHERE tusuario_perfil.id_perfil = tperfil.id_perfil AND tusuario_perfil.id_usuario = '%s'",$id_user);
$query1=sprintf("SELECT tperfil.incident_view,tperfil.incident_edit,tperfil.incident_management,tperfil.agent_view,tperfil.agent_edit,tperfil.alert_edit,tperfil.alert_management,tperfil.pandora_management,tperfil.db_management,tperfil.user_management FROM tusuario_perfil,tperfil WHERE tusuario_perfil.id_perfil = tperfil.id_perfil AND tusuario_perfil.id_usuario = '%s'", $id_user);
//GroupID = 0, access doesnt matter (use with caution!) - Any user gets access to group 0
} else {
$query1=sprintf("SELECT tperfil.incident_view,tperfil.incident_edit,tperfil.incident_management,tperfil.agent_view,tperfil.agent_edit,tperfil.alert_edit,tperfil.alert_management,tperfil.pandora_management,tperfil.db_management,tperfil.user_management FROM tusuario_perfil,tperfil WHERE tusuario_perfil.id_perfil = tperfil.id_perfil
AND tusuario_perfil.id_usuario = '%s' AND (tusuario_perfil.id_grupo = %d OR tusuario_perfil.id_grupo= 1)",$id_user,$id_group);
AND tusuario_perfil.id_usuario = '%s' AND (tusuario_perfil.id_grupo = %d OR tusuario_perfil.id_grupo= 1)", $id_user, $id_group);
}
$rowdup = get_db_all_rows_sql($query1);
@ -373,8 +373,8 @@ function dame_nombre_agente ($id_agent) {
*
* @return Password of an user.
*/
function get_user_password ($id_usuario) {
return (string) get_db_value ('password', 'tusuario', 'id_usuario', (int) $id_usuario);
function get_user_password ($id_user) {
return (string) get_db_value ('password', 'tusuario', 'id_usuario', $id_user);
}
/**
@ -1090,19 +1090,19 @@ function show_server_type ($id){
function give_modulecategory_name ($id_category) {
switch ($id_category) {
case 0:
return lang_string ("cat_0");
return __('cat_0');
break;
case 1:
return lang_string ("cat_1");
return __('cat_1');
break;
case 2:
return lang_string ("cat_2");
return __('cat_2');
break;
case 3:
return lang_string ("cat_3");
return __('cat_3');
break;
}
return lang_string ("unknown");
return __('unknown');
}
/**
@ -1656,7 +1656,7 @@ function get_agent_module_value_sumatory ($id_agent_module, $period, $date = 0)
$module_name = get_db_value ('nombre', 'ttipo_modulo', 'id_tipo', $id_module_type);
if (is_module_data_string ($module_name)) {
return lang_string ('wrong_module_type');
return __('wrong_module_type');
}
// Get the whole interval of data
@ -1725,9 +1725,23 @@ function get_agent_module_value_sumatory ($id_agent_module, $period, $date = 0)
* @param file Filename of language definitions to load.
*/
function load_lang_file ($file) {
global $config;
if (file_exists ($file))
require_once ($config["homedir"]."/include/languages/language_".$config["language"].".php");
}
/**
* Get a translated string (alias version of lang_string().
*
* @param string String to translate
*
* @return The translated string. If not defined, the same string will be returned
*/
function __ ($string) {
return lang_string ($string);
}
/**
* Get a translated string.
*
@ -1780,16 +1794,16 @@ function show_alert_row_mini ($id_combined_alert) {
WHERE tcompound_alert.id_aam = talerta_agente_modulo.id_aam AND tcompound_alert.id = %d",$id_combined_alert);
$result = get_db_all_rows_sql ($sql);
echo "<table width=400 cellpadding=2 cellspacing=2 class='databox'>";
echo "<th>".lang_string("Name");
echo "<th>".lang_string("Oper");
echo "<th>".lang_string("Tt");
echo "<th>".lang_string("Firing");
echo "<th>".lang_string("Time");
echo "<th>".lang_string("Desc");
echo "<th>".lang_string("Recovery");
echo "<th>".lang_string("MinMax.Al");
echo "<th>".lang_string("Days");
echo "<th>".lang_string("Fired");
echo "<th>".__('Name');
echo "<th>".__('Oper');
echo "<th>".__('Tt');
echo "<th>".__('Firing');
echo "<th>".__('Time');
echo "<th>".__('Desc');
echo "<th>".__('Recovery');
echo "<th>".__('MinMax.Al');
echo "<th>".__('Days');
echo "<th>".__('Fired');
foreach ($result as $row2) {
if ($color == 1) {
$tdcolor = "datos";
@ -1830,13 +1844,13 @@ function show_alert_row_mini ($id_combined_alert) {
}
if (($mymin == 0) && ($mymax == 0)) {
$mymin = lang_string ("N/A");
$mymin = __('N/A');
$mymax = $mymin;
}
// We have alert text ?
if ($row2["alert_text"]!= "") {
echo "<td class='$tdcolor'>".lang_string ('text')."</td>";
echo "<td class='$tdcolor'>".__('text')."</td>";
} else {
echo "<td class='$tdcolor'>".$mymin."/".$mymax."</td>";
}
@ -1850,15 +1864,15 @@ function show_alert_row_mini ($id_combined_alert) {
// Has recovery notify activated ?
if ($row2["recovery_notify"] > 0) {
$recovery_notify = lang_string ("Yes");
$recovery_notify = __('Yes');
} else {
$recovery_notify = lang_string ("No");
$recovery_notify = __('No');
}
echo "</td><td class='$tdcolor'>".$recovery_notify;
// calculare firing conditions
if ($row2["alert_text"] != ""){
$firing_cond = lang_string ("text")."(".substr ($row2["alert_text"],0,8).")";
$firing_cond = __('text')."(".substr ($row2["alert_text"],0,8).")";
} else {
$firing_cond = $row2["min_alerts"]." / ".$row2["max_alerts"];
}
@ -1870,9 +1884,9 @@ function show_alert_row_mini ($id_combined_alert) {
// Fired ?
if ($row2["times_fired"]>0) {
echo "<td class='".$tdcolor."' align='center'><img width='20' height='9' src='images/pixel_red.png' title='".lang_string ("fired")."'></td>";
echo "<td class='".$tdcolor."' align='center'><img width='20' height='9' src='images/pixel_red.png' title='".__('fired')."'></td>";
} else {
echo "<td class='".$tdcolor."' align='center'><img width='20' height='9' src='images/pixel_green.png' title='".lang_string ("not_fired")."'></td>";
echo "<td class='".$tdcolor."' align='center'><img width='20' height='9' src='images/pixel_green.png' title='".__('not_fired')."'></td>";
}
}
echo "</table>";
@ -1893,14 +1907,14 @@ function smal_event_table ($filter = "", $limit = 10, $width = 440) {
$sql = sprintf ("SELECT * FROM tevento %s ORDER BY timestamp DESC LIMIT %d",$filter,$limit);
echo "<table cellpadding='4' cellspacing='4' width='$width' border=0 class='databox'>";
echo "<tr>";
echo "<th colspan=6>".lang_string ("Latest events");
echo "<th colspan=6>".__('Latest events');
echo "<tr>";
echo "<th class='datos3 f9'>".lang_string ("St")."</th>";
echo "<th class='datos3 f9'>".lang_string ("Type")."</th>";
echo "<th class='datos3 f9'>".lang_string ('event_name')."</th>";
echo "<th class='datos3 f9'>".lang_string ('agent_name')."</th>";
echo "<th class='datos3 f9'>".lang_string ('id_user')."</th>";
echo "<th class='datos3 f9'>".lang_string ('timestamp')."</th>";
echo "<th class='datos3 f9'>".__('St')."</th>";
echo "<th class='datos3 f9'>".__('Type')."</th>";
echo "<th class='datos3 f9'>".__('event_name')."</th>";
echo "<th class='datos3 f9'>".__('agent_name')."</th>";
echo "<th class='datos3 f9'>".__('id_user')."</th>";
echo "<th class='datos3 f9'>".__('timestamp')."</th>";
$result = get_db_all_rows_sql ($sql);
if($result === false)
$result = array();
@ -1986,9 +2000,9 @@ function smal_event_table ($filter = "", $limit = 10, $width = 440) {
// for System or SNMP generated alerts
} else {
if ($event["event_type"] == "system") {
echo "<td class='$tdclass'>".lang_string ("System");
echo "<td class='$tdclass'>".__('System');
} else {
echo "<td class='$tdclass'>".lang_string ("alert")."SNMP";
echo "<td class='$tdclass'>".__('alert')."SNMP";
}
}

View File

@ -236,10 +236,10 @@ function event_reporting ($id_group, $period, $date = 0, $return = false) {
$table->data = array ();
$table->head = array ();
$table->head[0] = lang_string ('status');
$table->head[1] = lang_string ('event_name');
$table->head[2] = lang_string ('id_user');
$table->head[3] = lang_string ('timestamp');
$table->head[0] = __('status');
$table->head[1] = __('event_name');
$table->head[2] = __('id_user');
$table->head[3] = __('timestamp');
$sql = sprintf ('SELECT * FROM tevento
WHERE id_agente = %d
@ -293,10 +293,10 @@ function get_fired_alerts_reporting_table ($alerts_fired) {
$table->data = array ();
$table->head = array ();
$table->head[0] = lang_string ('agent');
$table->head[1] = lang_string ('alert_description');
$table->head[2] = lang_string ('times_fired');
$table->head[3] = lang_string ('priority');
$table->head[0] = __('agent');
$table->head[1] = __('alert_description');
$table->head[2] = __('times_fired');
$table->head[3] = __('priority');
foreach ($agents as $alerts) {
$data = array ();
@ -338,8 +338,8 @@ function alert_reporting ($id_group, $period = 0, $date = 0, $return = false) {
$output .= '<img src="reporting/fgraph.php?tipo=alerts_fired_pipe&height=150&width=280&fired='.
$fired_percentage.'&not_fired='.$not_fired_percentage.'" style="float: right; border: 1px solid black">';
$output .= '<strong>'.lang_string ('fired_alerts').': '.sizeof ($alerts_fired).'</strong><br />';
$output .= '<strong>'.lang_string ('total_alerts_monitored').': '.sizeof ($alerts).'</strong><br />';
$output .= '<strong>'.__('fired_alerts').': '.sizeof ($alerts_fired).'</strong><br />';
$output .= '<strong>'.__('total_alerts_monitored').': '.sizeof ($alerts).'</strong><br />';
if (! sizeof ($alerts_fired)) {
if (!$return)
@ -387,8 +387,8 @@ function monitor_health_reporting ($id_group, $period = 0, $date = 0, $return =
$output .= '<img src="reporting/fgraph.php?tipo=monitors_health_pipe&height=150&width=280&down='.
$down_percentage.'&not_down='.$not_down_percentage.'" style="float: right; border: 1px solid black">';
$output .= '<strong>'.lang_string ('total_monitors').': '.sizeof ($monitors).'</strong><br />';
$output .= '<strong>'.lang_string ('monitors_down_on_period').': '.sizeof ($monitors_down).'</strong><br />';
$output .= '<strong>'.__('total_monitors').': '.sizeof ($monitors).'</strong><br />';
$output .= '<strong>'.__('monitors_down_on_period').': '.sizeof ($monitors_down).'</strong><br />';
$table = get_monitors_down_reporting_table ($monitors_down);
$table->width = '100%';
@ -419,8 +419,8 @@ function monitor_health_reporting ($id_group, $period = 0, $date = 0, $return =
function get_monitors_down_reporting_table ($monitors_down) {
$table->data = array ();
$table->head = array ();
$table->head[0] = lang_string ('agent');
$table->head[1] = lang_string ('monitor');
$table->head[0] = __('agent');
$table->head[1] = __('monitor');
$agents = array ();
foreach ($monitors_down as $monitor) {
@ -463,7 +463,7 @@ function get_monitors_down_reporting_table ($monitors_down) {
function general_group_reporting ($id_group, $return = false) {
$output = '';
$agents = get_agents_in_group ($id_group);
$output .= '<strong>'.lang_string ('agents_in_group').': '.sizeof ($agents).'</strong><br />';
$output .= '<strong>'.__('agents_in_group').': '.sizeof ($agents).'</strong><br />';
if (!$return)
echo $output;
@ -482,13 +482,13 @@ function general_group_reporting ($id_group, $return = false) {
function get_agent_alerts_reporting_table ($id_agent, $period = 0, $date = 0) {
$table->data = array ();
$table->head = array ();
$table->head[0] = lang_string ('type');
$table->head[1] = lang_string ('description');
$table->head[2] = lang_string ('min');
$table->head[3] = lang_string ('max');
$table->head[4] = lang_string ('threshold');
$table->head[5] = lang_string ('last_fired');
$table->head[6] = lang_string ('times_fired');
$table->head[0] = __('type');
$table->head[1] = __('description');
$table->head[2] = __('min');
$table->head[3] = __('max');
$table->head[4] = __('threshold');
$table->head[5] = __('last_fired');
$table->head[6] = __('times_fired');
$alerts = get_alerts_in_agent ($id_agent);
foreach ($alerts as $alert) {
@ -521,10 +521,10 @@ function get_agent_alerts_reporting_table ($id_agent, $period = 0, $date = 0) {
* @return A table object with the report.
*/
function get_agent_monitors_reporting_table ($id_agent, $period = 0, $date = 0) {
$n_a_string = lang_string ('N/A').'(*)';
$n_a_string = __('N/A').'(*)';
$table->head = array ();
$table->head[0] = lang_string ('monitor');
$table->head[1] = lang_string ('last_failure');
$table->head[0] = __('monitor');
$table->head[1] = __('last_failure');
$table->data = array ();
$monitors = get_monitors_in_agent ($id_agent);
@ -559,7 +559,7 @@ function get_agent_monitors_reporting_table ($id_agent, $period = 0, $date = 0)
*/
function get_agent_modules_reporting_table ($id_agent, $period = 0, $date = 0) {
$table->data = array ();
$n_a_string = lang_string ('N/A').'(*)';
$n_a_string = __('N/A').'(*)';
$modules = get_modules_in_agent ($id_agent);
$data = array ();
@ -584,12 +584,12 @@ function get_agent_modules_reporting_table ($id_agent, $period = 0, $date = 0) {
*/
function get_agent_detailed_reporting ($id_agent, $period = 0, $date = 0, $return = false) {
$output = '';
$n_a_string = lang_string ('N/A').'(*)';
$n_a_string = __('N/A').'(*)';
/* Show modules in agent */
$output .= '<div class="agent_reporting">';
$output .= '<h3 style="text-decoration: underline">'.lang_string ('agent').' - '.dame_nombre_agente ($id_agent).'</h3>';
$output .= '<h4>'.lang_string ('modules').'</h3>';
$output .= '<h3 style="text-decoration: underline">'.__('agent').' - '.dame_nombre_agente ($id_agent).'</h3>';
$output .= '<h4>'.__('modules').'</h3>';
$table_modules = get_agent_modules_reporting_table ($id_agent, $period, $date);
$table_modules->width = '99%';
$output .= print_table ($table_modules, true);
@ -598,7 +598,7 @@ function get_agent_detailed_reporting ($id_agent, $period = 0, $date = 0, $retur
$table_alerts = get_agent_alerts_reporting_table ($id_agent, $period, $date);
$table_alerts->width = '99%';
if (sizeof ($table_alerts->data)) {
$output .= '<h4>'.lang_string ('alerts').'</h4>';
$output .= '<h4>'.__('alerts').'</h4>';
$output .= print_table ($table_alerts, true);
}
@ -615,7 +615,7 @@ function get_agent_detailed_reporting ($id_agent, $period = 0, $date = 0, $retur
$table_monitors->align[1] = 'right';
$table_monitors->size = array ();
$table_monitors->align[1] = '10%';
$output .= '<h4>'.lang_string ('monitors').'</h4>';
$output .= '<h4>'.__('monitors').'</h4>';
$output .= print_table ($table_monitors, true);
$output .= '</div>';

View File

@ -128,7 +128,7 @@ function get_pdf_report ($report) {
switch ($content["type"]) {
case 1:
case 'simple_graph':
doTitle ($pdf, lang_string ("Module graph").': '.$agent_name.
doTitle ($pdf, __('Module graph').': '.$agent_name.
' - '.$module_name.' - '.$period);
$image = 'http://'.$_SERVER['HTTP_HOST'].$config["homeurl"].
'/reporting/fgraph.php?PHPSESSID='.$session_id.
@ -152,7 +152,7 @@ function get_pdf_report ($report) {
array_push ($modules, $content2['id_agent_module']);
array_push ($weights, $content2["weight"]);
}
doTitle ($pdf, lang_string ("Custom graph").': '.$graph["name"].
doTitle ($pdf, __('Custom graph').': '.$graph["name"].
' - '.$period);
$image = 'http://'.$_SERVER['HTTP_HOST'].$config["homeurl"].
'/reporting/fgraph.php?PHPSESSID='.$session_id.'&tipo=combined&id='.
@ -164,29 +164,29 @@ function get_pdf_report ($report) {
break;
case 3:
case 'SLA':
doTitle ($pdf, lang_string ('SLA').': '.$period);
doTitle ($pdf, __('SLA').': '.$period);
$slas = get_db_all_rows_field_filter ('treport_content_sla_combined',
'id_report_content', $content['id_rc']);
if (sizeof ($slas) == 0) {
$pdf->ezText ("<b>".lang_string ('no_defined_slas') . " %</b>", 18);
$pdf->ezText ("<b>".__('no_defined_slas') . " %</b>", 18);
}
$table->data = array ();
$table->head = array (lang_string ('Info'),
lang_string ('sla_result'));
$table->head = array (__('Info'),
__('sla_result'));
$sla_failed = false;
foreach ($slas as $sla) {
$data = array ();
$data[0] = lang_string ('agent')." : ".dame_nombre_agente_agentemodulo ($sla['id_agent_module'])."\n";
$data[0] .= lang_string ('module')." : ".dame_nombre_modulo_agentemodulo ($sla['id_agent_module'])."\n";
$data[0] .= lang_string ('sla_max')." : ".$sla['sla_max']."\n";
$data[0] .= lang_string ('sla_min')." : ".$sla['sla_min'];
$data[0] = __('agent')." : ".dame_nombre_agente_agentemodulo ($sla['id_agent_module'])."\n";
$data[0] .= __('module')." : ".dame_nombre_modulo_agentemodulo ($sla['id_agent_module'])."\n";
$data[0] .= __('sla_max')." : ".$sla['sla_max']."\n";
$data[0] .= __('sla_min')." : ".$sla['sla_min'];
$sla_value = get_agent_module_sla ($sla['id_agent_module'], $content['period'],
$sla['sla_min'], $sla['sla_max']);
if ($sla_value === false) {
$data[1] = lang_string ('unknown');
$data[1] = __('unknown');
} else {
if ($sla_value < $sla['sla_limit']) {
$pdf->setColor (0, 1, 0, 0); // Red
@ -201,16 +201,16 @@ function get_pdf_report ($report) {
$pdf->ezTable ($table->data, $table->head, "", $table_options);
if (! $sla_failed) {
$pdf->ezText ('<b>'.lang_string ('ok').'</b>', 8);
$pdf->ezText ('<b>'.__('ok').'</b>', 8);
} else {
$pdf->ezText ('<b>'.lang_string ('fail').'</b>', 8);
$pdf->ezText ('<b>'.__('fail').'</b>', 8);
}
unset ($slas);
break;
case 4:
case 'event_report':
doTitle ($pdf, lang_string ("event_report").' - '.$period);
doTitle ($pdf, __('event_report').' - '.$period);
$table_events = event_reporting ($report['id_group'], $content['period'], 0, true);
$pdf->ezTable ($table_events->data, $table_events->head,
"", $table_options);
@ -221,7 +221,7 @@ function get_pdf_report ($report) {
$alerts = get_alerts_in_group ($report['id_group']);
$alerts_fired = get_alerts_fired ($alerts, $content['period']);
doTitle ($pdf, lang_string ("alert_report").': '.$group_name.
doTitle ($pdf, __('alert_report').': '.$group_name.
' - '.$period);
$fired_percentage = round (sizeof ($alerts_fired) / sizeof ($alerts) * 100, 2);
$not_fired_percentage = 100 - $fired_percentage;
@ -230,8 +230,8 @@ function get_pdf_report ($report) {
'&tipo=alerts_fired_pipe&height=150&width=280&fired='.
$fired_percentage.'&not_fired='.$not_fired_percentage;
$pdf->ezImage ($image, 0, 150, 'none', 'left');
$pdf->ezText ('<b>'.lang_string ('fired_alerts').': '.sizeof ($alerts_fired).'</b>', 8);
$pdf->ezText ('<b>'.lang_string ('total_alerts_monitored').': '.sizeof ($alerts).'</b>', 8);
$pdf->ezText ('<b>'.__('fired_alerts').': '.sizeof ($alerts_fired).'</b>', 8);
$pdf->ezText ('<b>'.__('total_alerts_monitored').': '.sizeof ($alerts).'</b>', 8);
$pdf->ezText ("\n", 8);
$table_alerts = get_fired_alerts_reporting_table ($alerts_fired);
@ -244,19 +244,19 @@ function get_pdf_report ($report) {
case 6:
case 'monitor_report':
$value = get_agent_module_sla ($content["id_agent_module"], $content['period'], 1, 1);
doTitle ($pdf, lang_string ("monitor_report").': '.$agent_name.' - '.$module_name.
doTitle ($pdf, __('monitor_report').': '.$agent_name.' - '.$module_name.
' - '.$period);
$pdf->setColor (0, 0.9, 0, 0); // Red
$pdf->ezText ('<b>'.lang_string ('up').': '.format_for_graph ($value, 2) . " %</b>", 18);
$pdf->ezText ('<b>'.__('up').': '.format_for_graph ($value, 2) . " %</b>", 18);
$pdf->setColor (0.9, 0, 0, 1); // Grey
$pdf->ezText ('<b>'.lang_string ('down').': '.format_numeric (100 - $value, 2) . " %</b>", 18);
$pdf->ezText ('<b>'.__('down').': '.format_numeric (100 - $value, 2) . " %</b>", 18);
$pdf->setColor (0, 0, 0, 1); // Black
break;
case 7:
case 'avg_value':
$value = get_agent_module_value_average ($content["id_agent_module"], $content['period']);
doTitle ($pdf, lang_string("avg_value").': '.$agent_name.' - '.
doTitle ($pdf, __('avg_value').': '.$agent_name.' - '.
$module_name.' - '.$period);
$pdf->ezText ("<b>".format_for_graph ($value, 2)."</b>", 18);
@ -264,7 +264,7 @@ function get_pdf_report ($report) {
case 8:
case 'max_value':
$value = get_agent_module_value_max ($content["id_agent_module"], $content['period']);
doTitle ($pdf, lang_string ("max_value").': '.$agent_name.
doTitle ($pdf, __('max_value').': '.$agent_name.
' - '.$module_name.' - '.$period);
$pdf->ezText ("<b>".format_for_graph ($value, 2)."</b>", 18);
@ -272,7 +272,7 @@ function get_pdf_report ($report) {
case 9:
case 'min_value':
$value = get_agent_module_value_min ($content["id_agent_module"], $content['period']);
doTitle ($pdf, lang_string ("min_value").': '.$agent_name.
doTitle ($pdf, __('min_value').': '.$agent_name.
' - '.$module_name.' - '.$period);
$pdf->ezText ("<b>".format_for_graph ($value, 2)."</b>", 18);
@ -280,15 +280,15 @@ function get_pdf_report ($report) {
case 10:
case 'sumatory':
$value = get_agent_module_value_sumatory ($content["id_agent_module"], $content['period']);
doTitle ($pdf, lang_string ("sumatory").': '.$agent_name.
doTitle ($pdf, __('sumatory').': '.$agent_name.
' - '.$module_name.' - '.$period);
$pdf->ezText ("<b>".format_for_graph ($value, 2)."</b>", 18);
break;
case 11:
case 'general_group_report':
doTitle ($pdf, lang_string ("group").': '.$group_name);
$pdf->ezText ("<b>".lang_string ('agents_in_group').': '.sizeof ($agents)."</b>", 12);
doTitle ($pdf, __('group').': '.$group_name);
$pdf->ezText ("<b>".__('agents_in_group').': '.sizeof ($agents)."</b>", 12);
break;
case 12:
@ -296,7 +296,7 @@ function get_pdf_report ($report) {
$monitors = get_monitors_in_group ($report['id_group']);
$monitors_down = get_monitors_down ($monitors, $content['period']);
doTitle ($pdf, lang_string ("monitor_health").': '.
doTitle ($pdf, __('monitor_health').': '.
$group_name. ' - '.$period);
$down_percentage = round (sizeof ($monitors_down) / sizeof ($monitors) * 100, 2);
$not_down_percentage = 100 - $down_percentage;
@ -306,8 +306,8 @@ function get_pdf_report ($report) {
$down_percentage.'&not_down='.$not_down_percentage;
$pdf->ezImage ($image, 0, 150, 'none', 'left');
$pdf->ezText ("\n", 4);
$pdf->ezText ('<b>'.lang_string ('total_monitors').': '.sizeof ($monitors).'</b>', 8);
$pdf->ezText ('<b>'.lang_string ('monitors_down_on_period').': '.sizeof ($monitors_down).'</b>', 8);
$pdf->ezText ('<b>'.__('total_monitors').': '.sizeof ($monitors).'</b>', 8);
$pdf->ezText ('<b>'.__('monitors_down_on_period').': '.sizeof ($monitors_down).'</b>', 8);
$pdf->ezText ("\n", 8);
$table_monitors = get_monitors_down_reporting_table ($monitors_down);
@ -319,25 +319,25 @@ function get_pdf_report ($report) {
break;
case 13:
case 'agents_detailed':
doTitle ($pdf, lang_string ("agents_detailed").': '.
$group_name.' '.lang_string ('group'));
doTitle ($pdf, __('agents_detailed').': '.
$group_name.' '.__('group'));
foreach ($agents as $agent) {
$pdf->ezText ("<b>".$agent['nombre']."</b>", 18);
$table = get_agent_modules_reporting_table ($agent['id_agente'], $content['period']);
$pdf->ezText ("<b>".lang_string ('modules')."</b>", 12);
$pdf->ezText ("<b>".__('modules')."</b>", 12);
$pdf->ezText ("\n", 3);
$pdf->ezTable ($table->data, array (lang_string ('name')), "", $table_options);
$pdf->ezTable ($table->data, array (__('name')), "", $table_options);
$table = get_agent_alerts_reporting_table ($agent['id_agente'], $content['period']);
if (sizeof ($table->data)) {
$pdf->ezText ("<b>".lang_string ('alerts')."</b>", 12);
$pdf->ezText ("<b>".__('alerts')."</b>", 12);
$pdf->ezText ("\n", 3);
$pdf->ezTable ($table->data, $table->head, "", $table_options);
}
$table = get_agent_monitors_reporting_table ($agent['id_agente'], $content['period']);
if (sizeof ($table->data)) {
$pdf->ezText ("<b>".lang_string ('monitors')."</b>", 12);
$pdf->ezText ("<b>".__('monitors')."</b>", 12);
$pdf->ezText ("\n", 3);
$pdf->ezTable ($table->data, $table->head, "", $table_options);
}

View File

@ -137,8 +137,8 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines =
}
function get_layout_data_types () {
$types = array (0 => lang_string ("static_graph"),
1 => lang_string ("module_graph"));
$types = array (0 => __('static_graph'),
1 => __('module_graph'));
return $types;
}

View File

@ -106,7 +106,7 @@ if ($intervalo > 0){
}
?>
<title>Pandora FMS - <?php echo lang_string("header_title"); ?></title>
<title>Pandora FMS - <?php echo __('header_title'); ?></title>
<meta http-equiv="expires" content="0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="resource-type" content="document">
@ -184,8 +184,6 @@ if (! isset ($_SESSION['id_usuario']) && isset ($_GET["login"])) {
} else {
// There is session for id_usuario
$config["id_user"] = $_SESSION["id_usuario"];
// Temporal fix
$id_user = $config["id_user"];
}
// Log off
@ -249,7 +247,7 @@ if ($page != "") {
}
}
} else {
echo "<br><b class='error'>".lang_string("Sorry! I can't find the page!")."</b>";
echo "<br><b class='error'>".__('Sorry! I can\'t find the page!')."</b>";
}
} else
require ("general/logon_ok.php"); //default

View File

@ -22,21 +22,21 @@
echo "
<table cellpadding='3' cellspacing='3'>
<tr><td class='f9i'>
<img src='images/pixel_green.png' width=40 height=18> ".$lang_label["green_light"]."</td>
<img src='images/pixel_green.png' width=40 height=18> ".__('green_light')."</td>
<td class='f9i'>
<img src='images/pixel_red.png' width=40 height=18> ".$lang_label["red_light"]."</td>
<img src='images/pixel_red.png' width=40 height=18> ".__('red_light')."</td>
<td class='f9i'>
<img src='images/pixel_yellow.png' width=40 height=18> ".$lang_label["yellow_light"]."</td>
<img src='images/pixel_yellow.png' width=40 height=18> ".__('yellow_light')."</td>
<td class='f9i'>
<img src='images/pixel_red.png' width=20 height=10> ".$lang_label["fired"]."</td>
<img src='images/pixel_red.png' width=20 height=10> ".__('fired')."</td>
<tr><td class='f9i'>
<img src='images/pixel_gray.png' width=40 height=18> ".$lang_label["no_light"]."</td>
<img src='images/pixel_gray.png' width=40 height=18> ".__('no_light')."</td>
<td class='f9i'>
<img src='images/pixel_blue.png' width=40 height=18> ".$lang_label["blue_light"]."</td>
<img src='images/pixel_blue.png' width=40 height=18> ".__('blue_light')."</td>
<td class='f9i'>
<img src='images/pixel_fucsia.png' width=40 height=18> ".$lang_label["broken_light"]."</td>
<img src='images/pixel_fucsia.png' width=40 height=18> ".__('broken_light')."</td>
<td class='f9i'>
<img src='images/pixel_green.png' width=20 height=10> ".$lang_label["not_fired"]."</td>
<img src='images/pixel_green.png' width=20 height=10> ".__('not_fired')."</td>
</tr>
</table>
";

View File

@ -20,69 +20,77 @@
// Load global vars
require ("include/config.php");
check_login();
if (give_acl ($config['id_user'], 0, "AR")!=1) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Data view");
require ("general/noaccess.php");
exit;
}
function datos_raw ($id_agente_modulo, $periodo){
global $config;
global $config;
require("include/languages/language_".$config["language"].".php");
$id_user = $config["id_user"];
$periodo_label = $periodo;
switch ($periodo) {
case "mes":
$periodo = 2592000;
$et=$lang_label["last_month"];
break;
case "semana":
$periodo = 604800;
$et=$lang_label["last_week"];
break;
case "dia":
$periodo = 86400;
$et=$lang_label["last_24"];
break;
case "mes":
$periodo = 2592000;
$et=__('last_month');
break;
case "semana":
$periodo = 604800;
$et=__('last_week');
break;
case "dia":
$periodo = 86400;
$et=__('last_24');
break;
}
$periodo = time () - $periodo;
$id_agent = give_agent_id_from_module_id ($id_agente_modulo);
$id_group = get_db_value ("id_grupo", "tagente", "id_agente", $id_agent);
// Different query for string data type
$id_tipo_modulo = dame_id_tipo_modulo_agentemodulo($id_agente_modulo);
if ( (dame_nombre_tipo_modulo($id_tipo_modulo) == "generic_data_string" ) OR
(dame_nombre_tipo_modulo($id_tipo_modulo) == "remote_tcp_string" ) OR
(dame_nombre_tipo_modulo($id_tipo_modulo) == "remote_snmp_string" )) {
if ( (dame_nombre_tipo_modulo ($id_tipo_modulo) == "generic_data_string" ) ||
(dame_nombre_tipo_modulo ($id_tipo_modulo) == "remote_tcp_string" ) ||
(dame_nombre_tipo_modulo ($id_tipo_modulo) == "remote_snmp_string" )) {
$sql1="SELECT * FROM tagente_datos_string WHERE id_agente_modulo = ".
$id_agente_modulo." AND id_agente = $id_agent AND utimestamp > '".$periodo."'
ORDER BY timestamp DESC";
$string_type = 1;
}
else {
$sql1="SELECT * FROM tagente_datos WHERE id_agente_modulo = ".
$id_agente_modulo." AND id_agente = $id_agent AND utimestamp > '".$periodo."'
ORDER BY timestamp DESC";
$sql1 = "SELECT * FROM tagente_datos WHERE id_agente_modulo = ".
$id_agente_modulo." AND id_agente = $id_agent AND utimestamp > '".$periodo."'
ORDER BY timestamp DESC";
$string_type = 0;
}
$result=mysql_query($sql1);
$nombre_agente = dame_nombre_agente_agentemodulo($id_agente_modulo);
$nombre_modulo = dame_nombre_modulo_agentemodulo($id_agente_modulo);
$result = mysql_query ($sql1);
$nombre_agente = dame_nombre_agente_agentemodulo ($id_agente_modulo);
$nombre_modulo = dame_nombre_modulo_agentemodulo ($id_agente_modulo);
echo "<h2>".$lang_label["data_received"]."
echo "<h2>".__('data_received')."
'$nombre_agente' / '$nombre_modulo' </h2>";
echo "<h3>". $et ."</h3>";
if (mysql_num_rows($result)){
if (mysql_num_rows ($result)) {
echo "<table cellpadding='3' cellspacing='3' width='600' class='databox'>";
$color=1;
echo "<th>".$lang_label["delete"]."</th>";
echo "<th>".$lang_label["timestamp"]."</th>";
echo "<th width='400'>".$lang_label["data"]."</th>";
echo "<th>".__('delete')."</th>";
echo "<th>".__('timestamp')."</th>";
echo "<th width='400'>".__('data')."</th>";
while ($row=mysql_fetch_array($result)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
} else {
$tdcolor = "datos2";
$color = 1;
}
echo "<tr>";
if ((give_acl($id_user, $id_group, "AW") ==1) AND ($string_type == 0)){
if ((give_acl ($config['id_user'], $id_group, "AW") ==1) && ($string_type == 0)) {
echo "<td class='".$tdcolor."' width=20>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/datos_agente&tipo=$periodo_label&id=$id_agente_modulo&delete=".$row["id_agente_datos"]."'><img src='images/cross.png' border=0>";
} else {
@ -90,16 +98,15 @@ function datos_raw ($id_agente_modulo, $periodo){
}
echo "<td class='".$tdcolor."' style='width:150px'>".$row["timestamp"]."</td>";
echo "<td class='".$tdcolor."'>";
if (is_numeric($row["datos"])) {
if (is_numeric ($row["datos"])) {
echo format_for_graph ($row["datos"]);
} else {
echo salida_limpia($row["datos"]);
echo salida_limpia ($row["datos"]);
}
echo "</td></tr>";
}
echo "</table>";
}
else {
} else {
echo "<div class='nf'>no_data</div>";
}
}
@ -108,31 +115,20 @@ function datos_raw ($id_agente_modulo, $periodo){
// Page begin
// ---------------
check_login();
$id_user = $_SESSION["id_usuario"];
if (give_acl($id_user, 0, "AR")!=1) {
audit_db ($id_user, $REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Data view");
require ("general/noaccess.php");
exit;
}
if (isset($_GET["tipo"]) AND isset($_GET["id"])) {
$id =entrada_limpia($_GET["id"]);
$tipo= entrada_limpia($_GET["tipo"]);
if (isset ($_GET["tipo"]) && isset ($_GET["id"])) {
$id = get_parameter ("id");
$tipo= get_parameter ("tipo");
} else {
echo "<h3 class='error'>".$lang_label["graf_error"]."</h3>";
echo "<h3 class='error'>".__('graf_error')."</h3>";
exit;
}
if (isset($_GET["delete"])) {
$delete =$_GET["delete"];
$sql = "DELETE FROM tagente_datos WHERE id_agente_datos = $delete";
$result=mysql_query($sql);
$result = process_sql ($sql);
}
datos_raw ($id,$tipo);
datos_raw ($id, $tipo);
?>

View File

@ -20,20 +20,20 @@
// Load global vars
require("include/config.php");
if (comprueba_login() == 0){
$iduser_temp=$_SESSION['id_usuario'];
if (give_acl($iduser_temp, 0, "AR") == 1){
echo "<h2>".$lang_label["ag_title"]." &gt; ";
echo $lang_label["db_stat_agent"]."</h2>";
echo "<table border=0>";
echo "<tr><td><img src='reporting/fgraph.php?tipo=db_agente_modulo'><br>";
echo "<tr><td><br>";
echo "<tr><td><img src='reporting/fgraph.php?tipo=db_agente_paquetes'><br>";
echo "</table>";
}
else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Agent estatistics");
require ("general/noaccess.php");
}
check_login ();
if (! give_acl ($config['id_user'], 0, "AR")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Agent estatistics");
require ("general/noaccess.php");
return;
}
?>
echo "<h2>".__('ag_title')." &gt; ";
echo __('db_stat_agent')."</h2>";
echo "<table border=0>";
echo "<tr><td><img src='reporting/fgraph.php?tipo=db_agente_modulo'><br>";
echo "<tr><td><br>";
echo "<tr><td><img src='reporting/fgraph.php?tipo=db_agente_paquetes'><br>";
echo "</table>";
?>

View File

@ -20,8 +20,9 @@
require ("include/config.php");
check_login ();
if (give_acl($id_user, 0, "AR") == 0) {
audit_db ($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access agent main list view");
if (! give_acl ($config['id_user'], 0, "AR")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access agent main list view");
require ("general/noaccess.php");
exit;
}
@ -37,7 +38,7 @@ if (isset($_GET["ag_group_refresh"])){
}
$search = get_parameter ("search", "");
echo "<h2>".$lang_label["ag_title"]." &gt; ".$lang_label["summary"]."</h2>";
echo "<h2>".__('ag_title')." &gt; ".__('summary')."</h2>";
// Show group selector (POST)
if (isset($_POST["ag_group"])){
@ -52,7 +53,7 @@ if (isset($_POST["ag_group"])){
}
echo "<table cellpadding='4' cellspacing='4' class='databox'><tr>";
echo "<td valign='top'>".$lang_label["group"]."</td>";
echo "<td valign='top'>".__('group')."</td>";
echo "<td valign='top'>";
echo "<select name='ag_group' onChange='javascript:this.form.submit();'
class='w130'>";
@ -61,23 +62,23 @@ if ($ag_group > 1){
echo "<option value='".$ag_group."'>".dame_nombre_grupo($ag_group).
"</option>";
}
$mis_grupos=list_group ($id_user); //Print combo for groups and set an array with all groups
$mis_grupos = list_group ($config['id_user']); //Print combo for groups and set an array with all groups
echo "</select>";
echo "<td valign='top'>
<noscript>
<input name='uptbutton' type='submit' class='sub'
value='".$lang_label["show"]."'>
value='".__('show')."'>
</noscript>
</td></form><td valign='top'>";
echo $lang_label["free_text_search"];
echo __('free_text_search');
echo "</td><td valign='top'>";
echo "<form method='post' action='index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60'>";
echo "<input type=text name='search' size='15'>";
echo "</td><td valign='top'>";
echo "<input name='srcbutton' type='submit' class='sub'
value='".$lang_label["search"]."'>";
value='".__('search')."'>";
echo "</form>";
echo "</td></table>";
@ -94,53 +95,71 @@ if ($ag_group > 1){
AND disabled = 0 $search_sql ORDER BY nombre LIMIT $offset, ".$config["block_size"];
$sql2="SELECT COUNT(id_agente) FROM tagente WHERE id_grupo=$ag_group
AND disabled = 0 $search_sql ORDER BY nombre";
// Not selected any specific group
} else {
// Is admin user ??
if (get_db_sql ("SELECT * FROM tusuario WHERE id_usuario ='$id_user'", "nivel") == 1){
$sql="SELECT * FROM tagente WHERE disabled = 0 $search_sql ORDER BY nombre, id_grupo LIMIT $offset, ".$config["block_size"];
$sql2="SELECT COUNT(id_agente) FROM tagente WHERE disabled = 0 $search_sql ORDER BY nombre, id_grupo";
// Is admin user ??
$sql = sprintf ("SELECT * FROM tusuario WHERE id_usuario ='%s'", $config['id_user']);
if (get_db_sql ($sql, "nivel") == 1) {
$sql = "SELECT * FROM tagente WHERE disabled = 0 $search_sql ORDER BY nombre, id_grupo LIMIT $offset, ".$config["block_size"];
$sql2 = "SELECT COUNT(id_agente) FROM tagente WHERE disabled = 0 $search_sql ORDER BY nombre, id_grupo";
// standard user
} else {
// User has explicit permission on group 1 ?
$sql = sprintf ("SELECT COUNT(id_grupo) FROM tusuario_perfil WHERE id_usuario='%s' AND id_grupo = 1", $config['id_user']);
$all_group = get_db_sql ($sql);
// standard user
} else {
// User has explicit permission on group 1 ?
$all_group = get_db_sql ("SELECT COUNT(id_grupo) FROM tusuario_perfil WHERE id_usuario='$id_user' AND id_grupo = 1");
if ($all_group > 0) {
$sql = sprintf ("SELECT * FROM tagente
WHERE disabled = 0 %s
ORDER BY nombre, id_grupo LIMIT %d,%d",
$search_sql, $offset,
$config["block_size"]);
$sql2 = sprint ("SELECT COUNT(id_agente)
FROM tagente WHERE disabled = 0 %s
ORDER BY nombre, id_grupo",
$search_sql);
} else {
$sql = sprintf ("SELECT * FROM tagente
WHERE disabled = 0 %s
AND id_grupo IN (SELECT id_grupo
FROM tusuario_perfil
WHERE id_usuario='%s')
ORDER BY nombre, id_grupo LIMIT %d,%d",
$search_sql, $config['id_user'], $offset,
$config["block_size"]);
$sql2 = sprintf ("SELECT COUNT(id_agente)
FROM tagente
WHERE disabled = 0 %s
AND id_grupo IN (SELECT id_grupo
FROM tusuario_perfil
WHERE id_usuario='%s')
ORDER BY nombre, id_grupo",
$search_sql, $config['id_user']);
}
if ($all_group > 0){
$sql="SELECT * FROM tagente WHERE disabled = 0 $search_sql
ORDER BY nombre, id_grupo LIMIT $offset, ".$config["block_size"];
$sql2="SELECT COUNT(id_agente) FROM tagente WHERE disabled = 0 $search_sql
ORDER BY nombre, id_grupo";
} else {
$sql="SELECT * FROM tagente WHERE disabled = 0 $search_sql AND id_grupo IN (SELECT id_grupo FROM tusuario_perfil WHERE id_usuario='$id_user')
ORDER BY nombre, id_grupo LIMIT $offset,".$config["block_size"];
$sql2="SELECT COUNT(id_agente) FROM tagente WHERE disabled = 0 $search_sql AND id_grupo IN (SELECT id_grupo FROM tusuario_perfil WHERE id_usuario='$id_user') ORDER BY nombre, id_grupo";
}
}
}
}
$result2=mysql_query($sql2);
$row2=mysql_fetch_array($result2);
$result2 = mysql_query ($sql2);
$row2 = mysql_fetch_array ($result2);
$total_events = $row2[0];
// Prepare pagination
pagination ($total_events,
"index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=$ag_group&refr=60", $offset);
"index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=$ag_group&refr=60",
$offset);
// Show data.
$result=mysql_query($sql);
if (mysql_num_rows($result)){
echo "<table cellpadding='4' cellspacing='4' width='700' class='databox' style='margin-top: 10px'>";
echo "<th>".$lang_label["agent"]."</th>";
echo "<th>".$lang_label["os"]."</th>";
echo "<th>".$lang_label["interval"]."</th>";
echo "<th>".$lang_label["group"]."</th>";
echo "<th>".$lang_label["modules"]."</th>";
echo "<th>".$lang_label["status"]."</th>";
echo "<th>".$lang_label["alerts"]."</th>";
echo "<th>".$lang_label["last_contact"]."</th>";
echo "<th>".__('agent')."</th>";
echo "<th>".__('os')."</th>";
echo "<th>".__('interval')."</th>";
echo "<th>".__('group')."</th>";
echo "<th>".__('modules')."</th>";
echo "<th>".__('status')."</th>";
echo "<th>".__('alerts')."</th>";
echo "<th>".__('last_contact')."</th>";
// For every agent defined in the agent table
$color = 1;
while ($row=mysql_fetch_array($result)){
@ -230,7 +249,7 @@ if (mysql_num_rows($result)){
}
echo "<tr>";
echo "<td class='$tdcolor'>";
if (give_acl($id_user, $id_grupo, "AW")==1){
if (give_acl ($config['id_user'], $id_grupo, "AW")) {
echo "<a href='index.php?sec=gagente&amp;
sec2=godmode/agentes/configurar_agente&amp;
id_agente=".$id_agente."'>
@ -299,21 +318,21 @@ echo '<img class="bot" src="images/groups_small/'.show_icon_group($id_grupo).'.p
if ($numero_monitor <> 0){
if ($estado_general <> 0){
if ($estado_cambio == 0){
echo "<img src='images/pixel_red.png' width=40 height=18 title='".$lang_label["red_light"]."'>";
echo "<img src='images/pixel_red.png' width=40 height=18 title='".__('red_light')."'>";
} else {
echo "<img src='images/pixel_yellow.png' width=40 height=18 title='".$lang_label["yellow_light"]."'>";
echo "<img src='images/pixel_yellow.png' width=40 height=18 title='".__('yellow_light')."'>";
}
} elseif ($monitor_ok > 0) {
echo "<img src='images/pixel_green.png' width=40 height=18 title='".$lang_label["green_light"]."'>";
echo "<img src='images/pixel_green.png' width=40 height=18 title='".__('green_light')."'>";
}
elseif ($numero_datamodules > 0) {
echo "<img src='images/pixel_gray.png' width=40 height=18 title='".$lang_label["no_light"]."'>";
echo "<img src='images/pixel_gray.png' width=40 height=18 title='".__('no_light')."'>";
}
elseif ($monitor_down > 0) {
echo "<img src='images/pixel_fucsia.png' width=40 height=18 title='".$lang_label["broken_light"]."'>";
echo "<img src='images/pixel_fucsia.png' width=40 height=18 title='".__('broken_light')."'>";
}
} else
echo "<img src='images/pixel_blue.png' width=40 height=18 title='".$lang_label["blue_light"]."'>";
echo "<img src='images/pixel_blue.png' width=40 height=18 title='".__('blue_light')."'>";
// checks if an alert was fired recently
echo "<td class='$tdcolor' align='center'>";
@ -321,14 +340,14 @@ echo '<img class="bot" src="images/groups_small/'.show_icon_group($id_grupo).'.p
echo "<img src='images/pixel_gray.png' width=20 height=9>";
else {
if (check_alert_fired($id_agente) == 1)
echo "<img src='images/pixel_red.png' width=20 height=9 title='".$lang_label["fired"]."'>";
echo "<img src='images/pixel_red.png' width=20 height=9 title='".__('fired')."'>";
else
echo "<img src='images/pixel_green.png' width=20 height=9 title='".$lang_label["not_fired"]."'>";
echo "<img src='images/pixel_green.png' width=20 height=9 title='".__('not_fired')."'>";
}
echo "</td>";
echo "<td class='$tdcolor'>";
if ( $ultimo_contacto == "0000-00-00 00:00:00"){
echo $lang_label["never"];
echo __('never');
} else {
$ultima = strtotime($ultimo_contacto);
$ahora = strtotime("now");
@ -355,12 +374,16 @@ echo '<img class="bot" src="images/groups_small/'.show_icon_group($id_grupo).'.p
echo "</table><br>";
require "bulbs.php";
} else {
echo '</table><br><div class="nf">'.$lang_label["no_agent"].'</div>';
$id_user = $_SESSION["id_usuario"];
if ( (give_acl($id_user, 0, "LM")==1) OR (give_acl($id_user, 0, "AW")==1 ) OR (give_acl($id_user, 0, "PM")==1) OR (give_acl($id_user, 0, "DM")==1) OR (give_acl($id_user, 0, "UM")==1 )){
echo '</table><br><div class="nf">'.__('no_agent').'</div>';
if (give_acl ($config['id_user'], 0, "LM")
|| give_acl ($config['id_user'], 0, "AW")
|| give_acl ($config['id_user'], 0, "PM")
|| give_acl ($config['id_user'], 0, "DM")
|| give_acl ($config['id_user'], 0, "UM")) {
echo "&nbsp;<form method='post' action='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&create_agent=1'><input type='submit' class='sub next' name='crt'
value='".$lang_label["create_agent"]."'></form>";
sec2=godmode/agentes/configurar_agente&create_agent=1'><input type='submit' class='sub next' name='crt'
value='".__('create_agent')."'></form>";
}
}

View File

@ -19,26 +19,17 @@
// Load global vars
require ("include/config.php");
// Login check
$id_usuario=$_SESSION["id_usuario"];
global $REMOTE_ADDR;
if (check_login() != 0) {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access alert view");
check_login ();
if (! give_acl ($config["id_user"], 0, "AR") && ! give_acl ($config["id_user"], 0, "AW")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access alert view");
include ("general/noaccess.php");
exit;
}
if ((give_acl($config["id_user"], 0, "AR")!=1) AND (!give_acl($config["id_user"],0,"AW")) AND (dame_admin($config["id_user"])!=1)) {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access alert view");
include ("general/noaccess.php");
exit;
}
// -------------------------------
// Show alerts for specific agent
// -------------------------------
if (isset($_GET["id_agente"])){
$id_agente = $_GET["id_agente"];
@ -50,29 +41,29 @@ if (isset($_GET["id_agente"])){
}
if (isset($_GET["tab"])){
echo "<h2>".$lang_label["ag_title"]." &gt; ".$lang_label["alert_listing"]."</h2>";
echo "<h2>".__('ag_title')." &gt; ".__('alert_listing')."</h2>";
}
$query_gen='SELECT talerta_agente_modulo.* FROM talerta_agente_modulo, tagente_modulo WHERE talerta_agente_modulo.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente ='.$id_agente;
$query_gen='SELECT talerta_agente_modulo.* FROM talerta_agente_modulo, tagente_modulo WHERE talerta_agente_modulo.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente ='.$id_agente;
$result_gen=mysql_query($query_gen);
if (mysql_num_rows ($result_gen)) {
if (!isset($_GET["tab"])) {
echo "<h3>".$lang_label["alert_listing"]."</h3>";
echo "<h3>".__('alert_listing')."</h3>";
}
echo "<table cellpadding='4' cellspacing='4' width=750 border=0 class='databox'>";
echo "<tr>
<th>".$lang_label["type"]."<th>".$lang_label["name"]."</th>
<th>".$lang_label["description"]."</th>
<th>".$lang_label["Info"]."</th>
<th>".$lang_label["min."]."</th>
<th>".$lang_label["max."]."</th>
<th>".$lang_label["time_threshold"]."</th>
<th>".$lang_label["last_fired"]."</th>
<th>".$lang_label["times_fired"]."</th>
<th>".$lang_label["status"]."</th>
<th>".$lang_label["validate"]."</th>";
<th>".__('type')."<th>".__('name')."</th>
<th>".__('description')."</th>
<th>".__('Info')."</th>
<th>".__('min.')."</th>
<th>".__('max.')."</th>
<th>".__('time_threshold')."</th>
<th>".__('last_fired')."</th>
<th>".__('times_fired')."</th>
<th>".__('status')."</th>
<th>".__('validate')."</th>";
$color=1;
while ($data=mysql_fetch_array($result_gen)){
if ($color == 1){
@ -87,28 +78,27 @@ if (isset($_GET["id_agente"])){
show_alert_show_view ($data, $tdcolor, 0);
}
// Show combined alerts for this agent
$result_com = mysql_query("SELECT * FROM talerta_agente_modulo WHERE id_agent = $id_agente");
if (mysql_num_rows ($result_com)) {
echo "<tr><td colspan=11 class='datos3'><center>".lang_string("Combined alerts")."</center>";
}
while ($data_com=mysql_fetch_array($result_com)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo "<tr>";
show_alert_show_view ($data_com, $tdcolor, 1);
}
// Show combined alerts for this agent
$result_com = mysql_query("SELECT * FROM talerta_agente_modulo WHERE id_agent = $id_agente");
if (mysql_num_rows ($result_com)) {
echo "<tr><td colspan=11 class='datos3'><center>".__('Combined alerts')."</center>";
}
while ($data_com=mysql_fetch_array($result_com)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
} else {
$tdcolor = "datos2";
$color = 1;
}
echo "<tr>";
show_alert_show_view ($data_com, $tdcolor, 1);
}
echo '</table>';
} else {
echo "<div class='nf'>".$lang_label["no_alerts"]."</div>";
echo "<div class='nf'>".__('no_alerts')."</div>";
}
// Show alert for no defined agent
@ -117,20 +107,20 @@ if (isset($_GET["id_agente"])){
// SHOW ALL ALERTS (GENERAL PAGE)
// -------------------------------
echo "<h2>".$lang_label["ag_title"]." &gt; ";
echo $lang_label["alert_listing"]."</h2>";
echo "<h2>".__('ag_title')." &gt; ";
echo __('alert_listing')."</h2>";
$iduser_temp=$_SESSION['id_usuario'];
$ag_group = get_parameter ("ag_group", -1);
$ag_group = get_parameter ("ag_group", -1);
if ($ag_group != -1)
if ($ag_group != -1)
echo "<form method='post' action='index.php?sec=estado&sec2=operation/agentes/estado_alertas&refr=60&ag_group=".$ag_group."'>";
else
echo "<form method='post' action='index.php?sec=estado&sec2=operation/agentes/estado_alertas&refr=60'>";
echo "<table cellpadding='4' cellspacing='4' class='databox'>";
echo "<tr>";
echo "<td>".$lang_label["group"]."</td>";
echo "<tr>";
echo "<td>".__('group')."</td>";
echo "<td valign='middle'>";
echo "<select name='ag_group' onChange='javascript:this.form.submit();' class='w150'>";
@ -143,31 +133,30 @@ if (isset($_GET["id_agente"])){
echo "</select></td>";
echo "<td valign='middle'>
<noscript>
<input name='uptbutton' type='submit' class='sub' value='".$lang_label["show"]."'>
<input name='uptbutton' type='submit' class='sub' value='".__('show')."'>
</noscript></td></form>";
// Display single alerts
// =======================
if ($ag_group > 1)
$sql='SELECT id_agente, nombre, disabled FROM tagente WHERE id_grupo='.$ag_group.' ORDER BY nombre';
else
$sql='SELECT id_agente, nombre, disabled FROM tagente ORDER BY id_grupo, nombre';
$sql = "SELECT id_agente, nombre, disabled FROM tagente WHERE tagente.disabled = 0 ";
// Agent group selector
if ($ag_group > 1)
$sql .=" AND tagente.id_grupo = ".$ag_group;
else {
// User has explicit permission on group 1 ?
$all_group = get_db_sql ("SELECT COUNT(id_grupo) FROM tusuario_perfil WHERE id_usuario='".$config["id_user"]."' AND id_grupo = 1");
if ($all_group == 0)
$sql .=" AND tagente.id_grupo IN (SELECT id_grupo FROM tusuario_perfil WHERE id_usuario='".$config["id_user"]."')";
}
$sql = "SELECT id_agente, nombre, disabled FROM tagente WHERE tagente.disabled = 0 ";
// Agent group selector
if ($ag_group > 1)
$sql .=" AND tagente.id_grupo = ".$ag_group;
else {
// User has explicit permission on group 1 ?
$all_group = get_db_sql ("SELECT COUNT(id_grupo) FROM tusuario_perfil WHERE id_usuario='".$config["id_user"]."' AND id_grupo = 1");
if ($all_group == 0)
$sql .=" AND tagente.id_grupo IN (SELECT id_grupo FROM tusuario_perfil WHERE id_usuario='".$config["id_user"]."')";
}
$color=1; $string = '';
$result=mysql_query($sql);
if ($result)
while ($row=mysql_fetch_array($result)){ //while there are agents
$color=1; $string = '';
$result=mysql_query($sql);
if ($result)
while ($row=mysql_fetch_array($result)) { //while there are agents
$id_agente = $row['id_agente'];
$nombre_agente = strtoupper($row["nombre"]);
$query_gen='SELECT talerta_agente_modulo.id_alerta,
@ -197,9 +186,9 @@ if (isset($_GET["id_agente"])){
<b>".$nombre_agente."</b>";
$string .= "<td class='$tdcolor' align='center'>";
if ($data["times_fired"] <> 0)
$string .= "<img src='images/pixel_red.png' width=40 height=18 title='".$lang_label["fired"]."'>";
$string .= "<img src='images/pixel_red.png' width=40 height=18 title='".__('fired')."'>";
else
$string .= "<img src='images/pixel_green.png' width=40 height=18 title='".$lang_label["not_fired"]."'>";
$string .= "<img src='images/pixel_green.png' width=40 height=18 title='".__('not_fired')."'>";
$string = $string."<td class='".$tdcolor."'>"
.dame_nombre_alerta($data["id_alerta"])."</td>";
@ -207,7 +196,7 @@ if (isset($_GET["id_agente"])){
$data["descripcion"]."</td>";
if ($data["last_fired"] == "0000-00-00 00:00:00") {
$string=$string."<td class='".$tdcolor."'>".
$lang_label["never"]."</td>";
__('never')."</td>";
} else {
$string=$string."<td class='".$tdcolor."'>".
human_time_comparation($data["last_fired"])."</td>";
@ -217,97 +206,95 @@ if (isset($_GET["id_agente"])){
}
} //end while
// Display combined alerts
// =======================
$sql = "SELECT id_agente, nombre, disabled FROM tagente WHERE tagente.disabled = 0 ";
// Agent group selector
if ($ag_group > 1)
$sql .=" AND tagente.id_grupo = ".$ag_group;
else {
// User has explicit permission on group 1 ?
$all_group = get_db_sql ("SELECT COUNT(id_grupo) FROM tusuario_perfil WHERE id_usuario='".$config["id_user"]."' AND id_grupo = 1");
if ($all_group == 0)
$sql .=" AND tagente.id_grupo IN (SELECT id_grupo FROM tusuario_perfil WHERE id_usuario='".$config["id_user"]."')";
}
// Display combined alerts
// =======================
$sql = "SELECT id_agente, nombre, disabled FROM tagente WHERE tagente.disabled = 0 ";
// Agent group selector
if ($ag_group > 1)
$sql .=" AND tagente.id_grupo = ".$ag_group;
else {
// User has explicit permission on group 1 ?
$all_group = get_db_sql ("SELECT COUNT(id_grupo) FROM tusuario_perfil WHERE id_usuario='".$config["id_user"]."' AND id_grupo = 1");
if ($all_group == 0)
$sql .=" AND tagente.id_grupo IN (SELECT id_grupo FROM tusuario_perfil WHERE id_usuario='".$config["id_user"]."')";
}
$result=mysql_query($sql);
$color=1;
if ($result)
while ($row=mysql_fetch_array($result)){ //while there are agents
$id_agente = $row['id_agente'];
$nombre_agente = strtoupper($row["nombre"]);
$query_gen='SELECT talerta_agente_modulo.id_alerta,
talerta_agente_modulo.descripcion,
talerta_agente_modulo.last_fired,
talerta_agente_modulo.times_fired,
talerta_agente_modulo.id_agent
FROM talerta_agente_modulo
WHERE talerta_agente_modulo.id_agent = '.$id_agente.' AND talerta_agente_modulo.disable = 0 ';
$result_gen=mysql_query($query_gen);
if (mysql_num_rows ($result_gen)) {
while ($data=mysql_fetch_array($result_gen)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
if (!isset($string)) {
$string='';
}
$string = $string."<tr><td class='".$tdcolor."'>
<a href='index.php?sec=estado&
sec2=operation/agentes/ver_agente&
id_agente=".$id_agente."'>
<b>".$nombre_agente."</b> (*)";
$string .= "<td class='$tdcolor' align='center'>";
if ($data["times_fired"] <> 0)
$string .= "<img src='images/pixel_red.png' width=40 height=18 title='".$lang_label["fired"]."'>";
else
$string .= "<img src='images/pixel_green.png' width=40 height=18 title='".$lang_label["not_fired"]."'>";
$string = $string."<td class='".$tdcolor."'>"
.dame_nombre_alerta($data["id_alerta"])."</td>";
$string=$string."<td class='".$tdcolor."'>".
$data["descripcion"]."</td>";
if ($data["last_fired"] == "0000-00-00 00:00:00") {
$string=$string."<td class='".$tdcolor."'>".
$lang_label["never"]."</td>";
} else {
$string=$string."<td class='".$tdcolor."'>".
human_time_comparation($data["last_fired"])."</td>";
}
$string=$string."<td class='".$tdcolor."'>".
$data["times_fired"]."</td>";
}
}
} //end while
$result=mysql_query($sql);
$color=1;
if ($result)
while ($row=mysql_fetch_array($result)){ //while there are agents
$id_agente = $row['id_agente'];
$nombre_agente = strtoupper($row["nombre"]);
$query_gen='SELECT talerta_agente_modulo.id_alerta,
talerta_agente_modulo.descripcion,
talerta_agente_modulo.last_fired,
talerta_agente_modulo.times_fired,
talerta_agente_modulo.id_agent
FROM talerta_agente_modulo
WHERE talerta_agente_modulo.id_agent = '.$id_agente.' AND talerta_agente_modulo.disable = 0 ';
$result_gen=mysql_query($query_gen);
if (mysql_num_rows ($result_gen)) {
while ($data=mysql_fetch_array($result_gen)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
if (!isset($string)) {
$string='';
}
$string = $string."<tr><td class='".$tdcolor."'>
<a href='index.php?sec=estado&
sec2=operation/agentes/ver_agente&
id_agente=".$id_agente."'>
<b>".$nombre_agente."</b> (*)";
$string .= "<td class='$tdcolor' align='center'>";
if ($data["times_fired"] <> 0)
$string .= "<img src='images/pixel_red.png' width=40 height=18 title='".__('fired')."'>";
else
$string .= "<img src='images/pixel_green.png' width=40 height=18 title='".__('not_fired')."'>";
$string = $string."<td class='".$tdcolor."'>"
.dame_nombre_alerta($data["id_alerta"])."</td>";
$string=$string."<td class='".$tdcolor."'>".
$data["descripcion"]."</td>";
if ($data["last_fired"] == "0000-00-00 00:00:00") {
$string=$string."<td class='".$tdcolor."'>".
__('never')."</td>";
} else {
$string=$string."<td class='".$tdcolor."'>".
human_time_comparation($data["last_fired"])."</td>";
}
$string=$string."<td class='".$tdcolor."'>".
$data["times_fired"]."</td>";
}
}
} //end while
if ($string != "") {
echo "<td class='f9' style='padding-left: 30px;'>";
echo "<img src='images/pixel_red.png' width=18 height=18> ".$lang_label["fired"]."</td>";
echo "<img src='images/pixel_red.png' width=18 height=18> ".__('fired')."</td>";
echo "<td class='f9' style='padding-left: 30px;'>";
echo "<img src='images/pixel_green.png' width=18 height=18> ".$lang_label["not_fired"];
echo "</td><td class='f9' valign='bottom' style='padding-left: 10px;'>(*) ".lang_string("Combined alert")."</tr></table>";
echo "<img src='images/pixel_green.png' width=18 height=18> ".__('not_fired');
echo "</td><td class='f9' valign='bottom' style='padding-left: 10px;'>(*) ".__('Combined alert')."</tr></table>";
echo "<br>";
echo "<table cellpadding='4' cellspacing='4' width='700' class='databox'>";
echo "<tr>
<th>".$lang_label["agent"]."</th>
<th>".$lang_label["status"]."</th>
<th>".$lang_label["type"]."</th>
<th>".$lang_label["description"]."</th>
<th>".$lang_label["last_fired"]."</th>
<th>".$lang_label["times_fired"]."</th>";
<th>".__('agent')."</th>
<th>".__('status')."</th>
<th>".__('type')."</th>
<th>".__('description')."</th>
<th>".__('last_fired')."</th>
<th>".__('times_fired')."</th>";
echo $string; //built table of alerts
echo "</table>";
}
else {
echo "</table><br><div class='nf'>".
$lang_label["no_alert"]."</div>";
__('no_alert')."</div>";
}
} // Main alert view
?>

View File

@ -40,7 +40,7 @@ if (isset($_GET["id_agente"])){
$disabled= $row["disabled"];
$network_server = $row["id_network_server"];
} else {
echo "<h3 class='error'>".$lang_label["agent_error"]."</h3>";
echo "<h3 class='error'>".__('agent_error')."</h3>";
echo "</table>";
echo "</div><div id='foot'>";
include ("general/footer.php");
@ -49,7 +49,7 @@ if (isset($_GET["id_agente"])){
}
}
echo "<h2>".$lang_label["ag_title"]." &gt; ".$lang_label["view_agent_general_data"]."</h2>";
echo "<h2>".__('ag_title')." &gt; ".__('view_agent_general_data')."</h2>";
// Blank space below title
echo "<div style='height: 10px'> </div>";
@ -58,14 +58,14 @@ echo '<table cellspacing="0" cellpadding="0" width="750" border=0 class="databox
echo "<tr><td>";
echo '<table cellspacing="4" cellpadding="4" border=0 class="databox">';
echo '<tr>
<td class="datos"><b>'.$lang_label["agent_name"].'</b></td>
<td class="datos"><b>'.__('agent_name').'</b></td>
<td class="datos"><b>'.strtoupper(salida_limpia($nombre_agente)).'</b></td>';
echo "<td class='datos2' width='40'>
<a class='info' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$id_agente."&refr=60'><span>".$lang_label["refresh_data"]."</span><img src='images/refresh.png' class='top' border=0></a>&nbsp;";
<a class='info' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$id_agente."&refr=60'><span>".__('refresh_data')."</span><img src='images/refresh.png' class='top' border=0></a>&nbsp;";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&flag_agent=1&id_agente=$id_agente'><img src='images/target.png' border=0></A>";
// Data base access graph
echo '</td></tr>';
echo '<tr><td class="datos2"><b>'.$lang_label["ip_address"].'</b></td><td class="datos2" colspan=2>';
echo '<tr><td class="datos2"><b>'.__('ip_address').'</b></td><td class="datos2" colspan=2>';
// Show all address for this agent, show first the main IP (taken from tagente table)
echo "<select style='padding:0px' name='notused' size='1'>";
echo "<option>".salida_limpia($direccion_agente)."</option>";
@ -81,7 +81,7 @@ while ($row=mysql_fetch_array($result_t)){
}
echo "</select>";
echo '<tr><td class="datos"><b>'.$lang_label["os"].'</b></td><td class="datos" colspan="2"><img src="images/'.dame_so_icon($id_os).'"> - '.dame_so_name($id_os);
echo '<tr><td class="datos"><b>'.__('os').'</b></td><td class="datos" colspan="2"><img src="images/'.dame_so_icon($id_os).'"> - '.dame_so_name($id_os);
if ($os_version != "") {
echo ' '.salida_limpia($os_version);
@ -91,28 +91,28 @@ echo '</td>';
echo '</tr>';
// Parent
echo '<tr><td class="datos2"><b>'.lang_string("Parent").'</b></td><td class="datos2" colspan=2>';
echo '<tr><td class="datos2"><b>'.__('Parent').'</b></td><td class="datos2" colspan=2>';
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_parent'>";
echo dame_nombre_agente($id_parent).'</a></td>';
// Agent Interval
echo '<tr><td class="datos"><b>'.$lang_label["interval"].'</b></td><td class="datos" colspan=2>'. human_time_description_raw($intervalo).'</td></tr>';
echo '<tr><td class="datos"><b>'.__('interval').'</b></td><td class="datos" colspan=2>'. human_time_description_raw($intervalo).'</td></tr>';
// Comments
echo '<tr><td class="datos2"><b>'.$lang_label["description"].'</b></td><td class="datos2" colspan=2>'.$comentarios.'</td></tr>';
echo '<tr><td class="datos2"><b>'.__('description').'</b></td><td class="datos2" colspan=2>'.$comentarios.'</td></tr>';
// Group
echo '<tr><td class="datos"><b>'.$lang_label["group"].'</b></td><td class="datos" colspan="2">';
echo '<tr><td class="datos"><b>'.__('group').'</b></td><td class="datos" colspan="2">';
echo "<a href='index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id=$id_grupo'>";
echo '<img class="bot" src="images/groups_small/'.show_icon_group($id_grupo).'.png" title="'. dame_grupo($id_grupo).'"></A></td></tr>';
// Agent version
echo '<tr><td class="datos2"><b>'.lang_string ("agentversion"). '</b>';
echo '<tr><td class="datos2"><b>'.__('agentversion'). '</b>';
echo '<td class="datos2" colspan=2>'.salida_limpia($agent_version). '</td>';
// Total packets
echo '<tr><td class="datos"><b>'. lang_string ("total_packets"). '</b></td>';
echo '<tr><td class="datos"><b>'. __('total_packets'). '</b></td>';
echo '<td class="datos" colspan=2>';
$total_paketes= 0;
$sql_3='SELECT COUNT(*) FROM tagente_datos WHERE id_agente = '.$id_agente;
@ -123,10 +123,10 @@ echo $total_paketes;
echo '</td></tr>';
// Last contact
echo '<tr><td class="datos2f9"><b>'.$lang_label["last_contact"]." / ".$lang_label["remote"].'</b></td><td class="datos2 f9" colspan="2">';
echo '<tr><td class="datos2f9"><b>'.__('last_contact')." / ".__('remote').'</b></td><td class="datos2 f9" colspan="2">';
if ($ultima_act == "0000-00-00 00:00:00"){
echo $lang_label["never"];
echo __('never');
} else {
echo $ultima_act;
}
@ -134,7 +134,7 @@ if ($ultima_act == "0000-00-00 00:00:00"){
echo " / ";
if ($ultima_act_remota == "0000-00-00 00:00:00"){
echo $lang_label["never"];
echo __('never');
} else {
echo $ultima_act_remota;
}
@ -156,17 +156,17 @@ if ($row_maxi=mysql_fetch_array($result_maxi))
} else {
$percentil = -1;
}
echo "<tr><td class='datos'><b>".$lang_label['next_contact']."</b>
echo "<tr><td class='datos'><b>".__('next_contact')."</b>
<td class='datosf9' colspan=2>
<img src='reporting/fgraph.php?tipo=progress&percent=".$percentil."&height=20&width=200'>
</td></tr></table>
<td valign='top'><table border=0>
<tr><td><b>".$lang_label["agent_access_rate"]."</b><br><br>
<tr><td><b>".__('agent_access_rate')."</b><br><br>
<img border=1 src='reporting/fgraph.php?id=".$id_agente."&tipo=agentaccess&periodo=1440&height=70&width=280'>
</td></tr>
<tr><td><div style='height:25px'> </div>
<b>".lang_string("Events generated -by module-")."</b><br><br>
<b>".__('Events generated -by module-')."</b><br><br>
<img src='reporting/fgraph.php?tipo=event_module&width=250&height=180&id_agent=".$id_agente."' >
</td></tr>
</table></td></tr>

View File

@ -21,26 +21,26 @@ require ("include/config.php");
if (! isset($config["show_lastalerts"]))
$config["show_lastalerts"] = 1;
if (give_acl ($id_user, 0, "AR") != 1) {
audit_db ($id_user, $REMOTE_ADDR, "ACL Violation",
if (! give_acl ($config['id_user'], 0, "AR")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Agent view (Grouped)");
require ("general/noaccess.php");
exit;
}
echo "<h2>".$lang_label["ag_title"]." &gt; ".$lang_label["group_view"]."</h2>";
echo "<h2>".__('ag_title')." &gt; ".__('group_view')."</h2>";
// Update network modules for this group
// Check for Network FLAG change request
// Made it a subquery, much faster on both the database and server side
if (isset ($_GET["update_netgroup"])) {
if (give_acl ($id_user, $_GET["update_netgroup"], "AW") == 1) {
if (give_acl ($config['id_user'], $_GET["update_netgroup"], "AW")) {
$sql = sprintf ("UPDATE tagente_modulo SET `flag` = '1' WHERE `id_agente` = ANY(SELECT id_agente FROM tagente WHERE `id_grupo` = '%d')",$_GET["update_netgroup"]);
mysql_query ($sql);
}
}
// Get group list that user has access
$groups = get_user_groups ($id_user);
$groups = get_user_groups ($config['id_user']);
$groups_info = array ();
$total_agents = 0;
$now = time ();
@ -110,11 +110,15 @@ foreach ($groups as $id_group => $group_name) {
}
if ($total_agents == 0) {
echo "<div class='nf'>".$lang_label["no_group_def"]."</div>";
$id_user = $_SESSION["id_usuario"];
if ( (give_acl($id_user, 0, "LM")==1) OR (give_acl($id_user, 0, "AW")==1 ) OR (give_acl($id_user, 0, "PM")==1) OR (give_acl($id_user, 0, "DM")==1) OR (give_acl($id_user, 0, "UM")==1 )){
echo "<div class='nf'>".__('no_group_def')."</div>";
if (give_acl ($config['id_user'], 0, "LM")
|| give_acl ($config['id_user'], 0, "AW")
|| give_acl ($config['id_user'], 0, "PM")
|| give_acl ($config['id_user'], 0, "DM")
|| give_acl ($config['id_user'], 0, "UM")) {
echo "&nbsp;<form method='post' action='index.php?sec=gagente&sec2=godmode/groups/configure_group&create_g=1'><input type='submit' class='sub next' name='crt'
value='".$lang_label["create_group"]."'></form>";
value='".__('create_group')."'></form>";
}
return;
}
@ -142,30 +146,30 @@ for ($table = 0; $table < $ancho; $table++) {
$icono_type = "";
if ($group_info["bad"] > 0) {
$icono_type .= '<img src="images/dot_red.png"
title="'.lang_string ('modules_bad').'">';
title="'.__('modules_bad').'">';
}
if ($group_info["ok"] > 0) {
$icono_type .= '<img src="images/dot_green.png"
title="'.lang_string ('modules_ok').'">';
title="'.__('modules_ok').'">';
}
// Show yellow light if there are recent alerts fired for this group
if ($group_info["alerts"] > 0 ) {
$icono_type .= '<img src="images/dot_yellow.png"
title="'.lang_string ('alerts_fired').'">';
title="'.__('alerts_fired').'">';
}
// Show grey light if there are agent down for this group
if ($group_info["down"] > 0 ) {
$icono_type .= '<img src="images/dot_white.png"
title="'.lang_string ('agents_down').'">';
title="'.__('agents_down').'">';
}
// Show red flag is group has disabled alert system
if (give_disabled_group ($group_info["id_group"])) {
$icono_type .= '<img src="images/flag_red.png"
title="'.lang_string ('disabled_alerts').'">';
title="'.__('disabled_alerts').'">';
}
// By default green border
@ -205,7 +209,7 @@ for ($table = 0; $table < $ancho; $table++) {
<table cellspacing='2' cellpadding='0'
style='margin-left:2px;'>
<tr><th colspan='2' width='91'>".
$lang_label["agents"].": </th></tr>
__('agents').": </th></tr>
<tr><td colspan='2' class='datos' align='center'><b>".
$group_info["agent"]."</b></td></tr>
</table>
@ -213,12 +217,12 @@ for ($table = 0; $table < $ancho; $table++) {
style='margin-left:2px'>
<tr>
<th colspan='2' width='90'>".
ucfirst ($lang_label["monitors"]).":</th>
ucfirst (__('monitors')).":</th>
</tr>
<tr>
<td class='datos'>
<img src='images/b_green.png' align='top' alt='' >
".$lang_label["ok"].": </td>
".__('ok').": </td>
<td class='datos'>
<font class='greenb'>".$group_info["ok"]."</font>
</td>
@ -226,16 +230,16 @@ for ($table = 0; $table < $ancho; $table++) {
<tr>
<td class='datos'>
<img src='images/b_red.png' align='top' alt=''>
".$lang_label["fail"].": </td>
".__('fail').": </td>
<td class='datos'><font class='redb'>".
$group_info["bad"]."</font></td>
</tr>";
if ($config["show_unknown"] > 0){
if ($config["show_unknown"] > 0) {
$celda .= "
<tr>
<td class='datos'>
<img src='images/b_white.png' align='top' alt=''>
".$lang_label["down"].": </td>
".__('down').": </td>
<td class='datos'><font class='redb'>".
$group_info["down"]."</font></td></tr>";
}
@ -243,14 +247,14 @@ for ($table = 0; $table < $ancho; $table++) {
$celda .= "<tr>
<td class='datos'>
<img src='images/b_yellow.png' align='top' alt=''>
".$lang_label["alerts"].": </td>
".__('alerts').": </td>
<td class='datos'><font class='grey'>".
$group_info["alerts"]."</font></td>
</tr>";
$celda .= "</table></span></a>";
// Render network exec module button, only when this group is writtable by user
if (give_acl ($id_user, $group_info["id_group"], "AW") == 1) {
if (give_acl ($config['id_user'], $group_info["id_group"], "AW")) {
$celda .= "&nbsp;<a href='index.php?
sec=estado&
sec2=operation/agentes/estado_grupo&
@ -263,7 +267,6 @@ for ($table = 0; $table < $ancho; $table++) {
echo $celda;
$real_count++;
}
echo "</tr>";
}
echo "</table>";

View File

@ -28,15 +28,15 @@ check_login();
$sql_t='SELECT * FROM tagente_estado, tagente_modulo WHERE tagente_modulo.disabled = 0 AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente='.$id_agente.' AND tagente_estado.estado != 100 AND tagente_estado.utimestamp != 0 ORDER BY tagente_modulo.nombre';
$result_t=mysql_query($sql_t);
if (mysql_num_rows ($result_t)) {
echo "<h3>".$lang_label["monitor_listing"]."</h3>";
echo "<h3>".__('monitor_listing')."</h3>";
echo "<table width='750' cellpadding=4 cellspacing=4 class='databox'>";
echo "<tr><th>X</th>";
echo "<th>".$lang_label["type"]."</th>
<th>".$lang_label["module_name"]."</th>
<th>".$lang_label["description"]."</th>
<th>".$lang_label["status"]."</th>
<th>".$lang_label["interval"]."</th>
<th>".$lang_label["last_contact"]."</th>";
echo "<th>".__('type')."</th>
<th>".__('module_name')."</th>
<th>".__('description')."</th>
<th>".__('status')."</th>
<th>".__('interval')."</th>
<th>".__('last_contact')."</th>";
$color=0;
while ($row_t=mysql_fetch_array($result_t)){
# For evey module in the status table
@ -89,11 +89,11 @@ check_login();
echo "<td class='".$tdcolor."' align='center'>";
if ($est_estado == 1){
if ($est_cambio == 1)
echo "<img src='images/pixel_yellow.png' width=40 height=18 title='".$lang_label["yellow_light"]."'>";
echo "<img src='images/pixel_yellow.png' width=40 height=18 title='".__('yellow_light')."'>";
else
echo "<img src='images/pixel_red.png' width=40 height=18 title='".$lang_label["red_light"]."'>";
echo "<img src='images/pixel_red.png' width=40 height=18 title='".__('red_light')."'>";
} else
echo "<img src='images/pixel_green.png' width=40 height=18 title='".$lang_label["green_light"]."'>";
echo "<img src='images/pixel_green.png' width=40 height=18 title='".__('green_light')."'>";
echo "<td align='center' class='".$tdcolor."'>";
if ($temp_interval != $intervalo)
@ -108,7 +108,7 @@ check_login();
echo "<span>";
}
if ($row_t["timestamp"]=='0000-00-00 00:00:00') {
echo $lang_label["never"];
echo __('never');
} else {
echo human_time_comparation($row_t["timestamp"]);
}
@ -118,7 +118,7 @@ check_login();
echo '</table>';
} else {
echo "<div class='nf'>".$lang_label["no_monitors"]."</div>";
echo "<div class='nf'>".__('no_monitors')."</div>";
}
?>

View File

@ -36,8 +36,8 @@ $label_group = 0;
$last_label = "";
// Title
echo "<h2>".$lang_label["ag_title"]." &gt; ";
echo $lang_label["last_data_chunk"];
echo "<h2>".__('ag_title')." &gt; ";
echo __('last_data_chunk');
echo "&nbsp;<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=data'><img src='images/refresh.png'></A>";
echo "</h2>";
@ -46,14 +46,14 @@ $result3=mysql_query($sql3);
if (mysql_num_rows ($result3)) {
echo "<table width='750' cellpadding='3' cellspacing='3' class='databox'>";
echo "<th></th>";
echo "<th>".$lang_label["module_name"]."</th>";
echo "<th>".$lang_label["type"]."</th>";
echo "<th>".$lang_label["int"]."</th>";
echo "<th>".$lang_label["description"]."</th>";
echo "<th>".$lang_label["data"]."</th>";
echo "<th>".$lang_label["graph"]."</th>";
echo "<th>".$lang_label["raw_data"]."</th>";
echo "<th>".$lang_label["timestamp"]."</th>";
echo "<th>".__('module_name')."</th>";
echo "<th>".__('type')."</th>";
echo "<th>".__('int')."</th>";
echo "<th>".__('description')."</th>";
echo "<th>".__('data')."</th>";
echo "<th>".__('graph')."</th>";
echo "<th>".__('raw_data')."</th>";
echo "<th>".__('timestamp')."</th>";
$texto=''; $last_modulegroup = 0;
$color = 1;
while ($row3=mysql_fetch_array($result3)){
@ -82,8 +82,7 @@ if (mysql_num_rows ($result3)) {
// Is a network module
// Has flag = 0
$id_grupo = $row_t["id_grupo"];
$id_usuario=$_SESSION["id_usuario"];
if (give_acl($id_usuario, $id_grupo, "AW")==1){
if (give_acl ($config['id_user'], $id_grupo, "AW")) {
if (($row3["id_modulo"] > 1) AND ($row3["id_tipo_modulo"] < 100)) {
if ($row3["flag"] == 0){
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$id_agente."&id_agente_modulo=".$row3["id_agente_modulo"]."&flag=1&tab=data&refr=60'><img src='images/target.png' border='0'></a>";
@ -192,7 +191,7 @@ if (mysql_num_rows ($result3)) {
echo "<td class='".$tdcolor."f9'>";
if ($row3["timestamp"] == "0000-00-00 00:00:00"){
echo $lang_label["never"];
echo __('never');
} else {
$ahora = time();
// Async modules
@ -212,7 +211,7 @@ if (mysql_num_rows ($result3)) {
echo '</table>';
}
else {
echo "<div class='nf'>".$lang_label["no_modules"]."</div>";
echo "<div class='nf'>".__('no_modules')."</div>";
}
?>

View File

@ -23,31 +23,29 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
include ("../../include/config.php");
include ("../../include/functions.php");
include ("../../include/functions_db.php");
require ("include/config.php");
session_start();
check_login ();
$id_user = $_SESSION["id_usuario"];
if ( (give_acl($id_user, 0, "AR")==0) AND (give_acl($id_user, 0, "AW")==0) ){
if (! give_acl($config['id_user'], 0, "AR") && ! give_acl ($config['id_user'], 0, "AW")){
require ("../../general/noaccess.php");
exit;
return;
}
if ( isset ($_GET["agentmodule"]) && isset ($_GET["agent"]) ){
if (isset ($_GET["agentmodule"]) && isset ($_GET["agent"]) ){
$id_agentmodule = $_GET["agentmodule"];
$id_agent = $_GET["agent"];
$agentmodule_name = dame_nombre_modulo_agentemodulo($id_agentmodule);
if (give_acl($id_user,dame_id_grupo($id_agent),"AR")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Agent Export Data");
$agentmodule_name = dame_nombre_modulo_agentemodulo ($id_agentmodule);
if (! give_acl ($config['id_user'], dame_id_grupo ($id_agent), "AR") != 1) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Export Data");
require ("../../general/noaccess.php");
exit;
}
$now = date("Y/m/d H:i:s");
// Show contentype header
// Show contentype header
Header("Content-type: text/txt");
header('Content-Disposition: attachment; filename="pandora_export_'.$agentmodule_name.'.txt"');

View File

@ -25,6 +25,15 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global vars
require("include/config.php");
check_login();
if (! give_acl ($config['id_user'], 0, "AR") && ! give_acl ($config['id_user'], 0, "AW")) {
require ("general/noaccess.php");
return;
}
function give_average_from_module ($id_agente, $id_agente_modulo, $hour, $day, $start_date, $end_date){
// Return average value from an agentmodule, for a specific hour of specific day of week,
@ -48,14 +57,14 @@ function generate_average_table ($id_de_mi_agente, $id_agente_modulo, $fecha_ini
// Genera una tabla con los promedios de los datos de un módulo no-string
require ("include/config.php");
require ("include/languages/language_".$language_code.".php");
$dias_de_la_semana = array ($lang_label["sunday"],$lang_label["monday"],$lang_label["tuesday"],$lang_label["wednesday"],$lang_label["thurdsday"],$lang_label["friday"],$lang_label["saturday"]);
$dias_de_la_semana = array (__('sunday'),__('monday'), __('tuesday'), __('wednesday'), __('thurdsday'), __('friday'), __('saturday'));
$nombre_modulo = dame_nombre_modulo_agentemodulo($id_agente_modulo);
// Table header
echo "<table border=0 cellpadding=4 cellspacing=4 width=600 class='databox'>";
echo "<tr>
<th rowspan='2'>".$lang_label["hour"]."</th>";
echo "<th colspan='7'>".$lang_label["day"]."</th>
<th rowspan='2'>".__('hour')."</th>";
echo "<th colspan='7'>".__('day')."</th>
</tr>";
echo "<tr>";
for ($dia=0;$dia<7;++$dia)
@ -70,7 +79,7 @@ function generate_average_table ($id_de_mi_agente, $id_agente_modulo, $fecha_ini
$tdcolor = "datos2";
$color = 1;
}
echo "<tr><th class='datos3'> $hora ".$lang_label["hr"]."</th>";
echo "<tr><th class='datos3'> $hora ".__('hr')."</th>";
for ($dia=0; $dia<7; ++$dia){
echo "<td class='$tdcolor'>";
echo format_numeric (give_average_from_module ($id_de_mi_agente, $id_agente_modulo, $hora, $dia, $fecha_inicio, $fecha_fin));
@ -81,21 +90,6 @@ function generate_average_table ($id_de_mi_agente, $id_agente_modulo, $fecha_ini
echo "</table>";
}
// ----------------------------------
// Main code
// ----------------------------------
// Load global vars
require("include/config.php");
// Security checks
check_login();
$id_user = $_SESSION["id_usuario"];
if ( (give_acl($id_user, 0, "AR")==0) AND (give_acl($id_user, 0, "AW")==0) ){
require ("general/noaccess.php");
exit;
}
if ((isset($_POST["export"])) AND (! isset($_POST["update_agent"]))){
@ -105,15 +99,16 @@ if ((isset($_POST["export"])) AND (! isset($_POST["update_agent"]))){
$export_type = 3; // Standard table;
// Header
echo "<h2>".$lang_label["ag_title"]." &gt; ";
echo $lang_label["export_title"]."</h2>";
echo "<h2>".__('ag_title')." &gt; ";
echo __('export_title')."</h2>";
if ($export_type == 1) { // CSV
if (isset ($_POST["origen_modulo"])){
$origen = $_POST["origen"];
if (give_acl($id_user, dame_id_grupo($origen), "AR")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Agent Export Data");
if (! give_acl ($config['id_user'], dame_id_grupo ($origen), "AR")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Export Data");
require ("general/noaccess.php");
}
$origen_modulo = $_POST["origen_modulo"];
@ -126,11 +121,11 @@ if ((isset($_POST["export"])) AND (! isset($_POST["update_agent"]))){
$to_date = $end_date." ".$end_time;
$agentmodule_name = dame_nombre_modulo_agentemodulo($origen_modulo[0]);
echo $lang_label["db_agent_bra"]. "<b>" . dame_nombre_agente($origen). "- $agentmodule_name</b>". $lang_label["from2"]. "<b>". $from_date. "</b>". $lang_label["to2"]. "<b>". $to_date. "</b><br>";
echo __('db_agent_bra'). "<b>" . dame_nombre_agente($origen). "- $agentmodule_name</b>". __('from2'). "<b>". $from_date. "</b>". __('to2'). "<b>". $to_date. "</b><br>";
echo "<a href='operation/agentes/export_csv.php?from_date=$from_date&to_date=$to_date&agent=$origen&agentmodule=$id_agentemodulo'><img src='images/disk.png'> ".$lang_label["get_file"]."</a> pandora_export_$agentmodule_name.txt";
echo "<a href='operation/agentes/export_csv.php?from_date=$from_date&to_date=$to_date&agent=$origen&agentmodule=$id_agentemodulo'><img src='images/disk.png'> ".__('get_file')."</a> pandora_export_$agentmodule_name.txt";
} else
echo "<b class='error'>".$lang_label["no_sel_mod"]."</b>";
echo "<b class='error'>".__('no_sel_mod')."</b>";
}
if ($export_type == 2){ // Avarage day/hour matrix
@ -146,7 +141,7 @@ if ((isset($_POST["export"])) AND (! isset($_POST["update_agent"]))){
$from_date = $start_date." ".$start_time;
$to_date = $end_date." ".$end_time;
echo $lang_label["db_agent_bra"]. "<b>" . dame_nombre_agente($origen). "- $agentmodule_name</b>". $lang_label["from2"]. "<b>". $from_date. "</b>". $lang_label["to2"]. "<b>". $to_date. "</b><br>";
echo __('db_agent_bra'). "<b>" . dame_nombre_agente($origen). "- $agentmodule_name</b>". __('from2'). "<b>". $from_date. "</b>". __('to2'). "<b>". $to_date. "</b><br>";
echo "<br>";
// For each module
@ -163,8 +158,9 @@ if ((isset($_POST["export"])) AND (! isset($_POST["update_agent"]))){
if ($export_type == 3) { // Standard table
if (isset ($_POST["origen_modulo"])){
$origen = $_POST["origen"];
if (give_acl($id_user,dame_id_grupo($origen),"AR")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Agent Export Data");
if (! give_acl ($config['id_user'], dame_id_grupo ($origen), "AR")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Export Data");
require ("general/noaccess.php");
}
$origen_modulo = $_POST["origen_modulo"];
@ -177,12 +173,12 @@ if ((isset($_POST["export"])) AND (! isset($_POST["update_agent"]))){
$from_date = $start_date." ".$start_time;
$to_date = $end_date." ".$end_time;
echo $lang_label["db_agent_bra"]. "<b>" . dame_nombre_agente($origen). "- $agentmodule_name</b>". $lang_label["from2"]. "<b>". $from_date. "</b>". $lang_label["to2"]. "<b>". $to_date. "</b><br>";
echo __('db_agent_bra'). "<b>" . dame_nombre_agente($origen). "- $agentmodule_name</b>". __('from2'). "<b>". $from_date. "</b>". __('to2'). "<b>". $to_date. "</b><br>";
echo "<br><table cellpadding='4' cellspacing='4' width='600' class='databox'>";
echo "<tr>
<th class='datos'>".$lang_label["module"]."</th>
<th class='datos'>".$lang_label["data"]."</th>
<th class='datos'>".__('module')."</th>
<th class='datos'>".__('data')."</th>
<th class='datos'>Timestamp</th>";
// Begin the render !
@ -215,7 +211,7 @@ if ((isset($_POST["export"])) AND (! isset($_POST["update_agent"]))){
}
echo "</table>";
} else
echo "<b class='error'>".$lang_label["no_sel_mod"]."</b>";
echo "<b class='error'>".__('no_sel_mod')."</b>";
}
@ -242,13 +238,13 @@ if ((isset($_POST["export"])) AND (! isset($_POST["update_agent"]))){
$date_to = $ahora;
echo "<script type='text/javaScript' src='include/javascript/calendar.js'></script>";
echo "<h2>".$lang_label["ag_title"]." &gt; ";
echo $lang_label["export_data"]."</h2>";
echo "<h2>".__('ag_title')." &gt; ";
echo __('export_data')."</h2>";
echo '<form method="post" action="index.php?sec=estado&sec2=operation/agentes/exportdata" name="export_form">';
echo '<table width=550 border=0 cellspacing=3 cellpadding=5 class=databox_color>';
echo '<tr>';
echo "<td class='datos'><b>".$lang_label["source_agent"]."</b></td>";
echo "<td class='datos'><b>".__('source_agent')."</b></td>";
echo "<td class='datos'>";
@ -261,70 +257,68 @@ if ((isset($_POST["export"])) AND (! isset($_POST["update_agent"]))){
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
if ( (isset($_POST["update_agent"])) AND (isset($_POST["origen"])) ){
if (give_acl($id_user, $row["id_grupo"], "AR")==1)
if (give_acl($config['id_user'], $row["id_grupo"], "AR"))
if ( $_POST["origen"] != $row["id_agente"])
echo "<option value=".$row["id_agente"].">".$row["nombre"]."</option>";
}
else
if (give_acl($id_user, $row["id_grupo"], "AR")==1)
} else {
if (give_acl($config['id_user'], $row["id_grupo"], "AR"))
echo "<option value=".$row["id_agente"].">".$row["nombre"]."</option>";
}
}
echo "</select> &nbsp;&nbsp;";
echo "<input type=submit name='update_agent' class='sub upd' value='".$lang_label["get_info"]."'>";
echo "<input type=submit name='update_agent' class='sub upd' value='".__('get_info')."'>";
echo '<tr>';
echo "<td class='datos2'>";
echo "<b>".$lang_label["modules"]."</b>";
echo "<b>".__('modules')."</b>";
echo "<td class='datos2'>";
// Combo with modules
echo "<select name='origen_modulo[]' size=8 class='w130'>";
if ((isset($_POST["update_agent"])) AND (isset($_POST["origen"])) ) {
if ((isset($_POST["update_agent"])) && (isset($_POST["origen"])) ) {
// Populate Module/Agent combo
$agente_modulo = $_POST["origen"];
$sql1="SELECT * FROM tagente_modulo WHERE id_agente = ".$agente_modulo;
$result = mysql_query($sql1);
while ($row=mysql_fetch_array($result)){
$sql = "SELECT * FROM tagente_modulo WHERE id_agente = ".$agente_modulo;
$result = mysql_query ($sql);
while ($row=mysql_fetch_array($result)) {
echo "<option value=".$row["id_agente_modulo"].">".$row["nombre"];
}
} else {
echo "<option value=-1>".$lang_label["N/A"]."</option>";
echo "<option value=-1>".__('N/A')."</option>";
}
echo "</select>";
echo "<tr><td class='datos'>";
echo "<b>".$lang_label["begin_date"]."</b>";
echo "<b>".__('begin_date')."</b>";
echo "<td class='datos'>";
echo "<input type='text' id='start_date' name='start_date' size=10 value='".substr($date_from,0,10)."'> <img src='images/calendar_view_day.png' onclick='scwShow(scwID(\"start_date\"),this);'> ";
echo "<input type='text' name='start_time' size=10 value='".substr($date_from,11,8)."'>";
echo "<input type='text' id='start_date' name='start_date' size=10 value='".substr ($date_from, 0, 10)."'> <img src='images/calendar_view_day.png' onclick='scwShow(scwID(\"start_date\"),this);'> ";
echo "<input type='text' name='start_time' size=10 value='".substr ($date_from, 11, 8)."'>";
echo "<tr><td class='datos2'>";
echo "<b>".$lang_label["end_date"]."</b>";
echo "<b>".__('end_date')."</b>";
echo "<td class='datos2'>";
echo "<input type='text' id='end_date' name='end_date' size=10 value='".substr($date_to,0,10)."'> <img src='images/calendar_view_day.png' onclick='scwShow(scwID(\"end_date\"),this);'> ";
echo "<input type='text' name='end_time' size=10 value='".substr($date_to,11,8)."'>";
echo "<input type='text' id='end_date' name='end_date' size=10 value='".substr ($date_to, 0, 10)."'> <img src='images/calendar_view_day.png' onclick='scwShow(scwID(\"end_date\"),this);'> ";
echo "<input type='text' name='end_time' size=10 value='".substr ($date_to, 11, 8)."'>";
echo "<tr><td class='datos'>";
echo "<b>".$lang_label["export_type"]."</b>";
echo "<b>".__('export_type')."</b>";
echo "<td class='datos'>";
// Combo for data export type
echo "<select name='export_type'>";
echo "<option value=3>".$lang_label["datatable"]."</option>";
echo "<option value=1>".$lang_label["csv"]."</option>";
echo "<option value=2>".$lang_label["average_per_hourday"]."</option>";
echo "<option value=3>".__('datatable')."</option>";
echo "<option value=1>".__('csv')."</option>";
echo "<option value=2>".__('average_per_hourday')."</option>";
echo "</select>";
echo "</table>";
// Submit button
echo "<table width=550>";
echo "<tr><td align='right'>";
echo "<input type=submit name='export' class='sub wand' value=".$lang_label["export"].">";
echo "</table>";
echo '<div class="action-buttons" style="width: 550">';
print_submit_button (__('export'), 'export', false, 'class="sub wand"');
echo "</div>";
echo "</form>";
}
?>

View File

@ -15,6 +15,16 @@
// Load global vars
require("include/config.php");
check_login();
if (! give_acl ($config['id_user'], 0, "AR")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access node graph builder");
include ("general/noaccess.php");
exit;
}
$pandora_name = 'Pandora FMS';
// Generate a dot graph definition for graphviz
@ -233,23 +243,11 @@ $simple = (boolean) get_parameter ('simple', 0);
$regen = (boolean) get_parameter ('regen',0);
$font_size = (int) get_parameter ('font_size', 12);
// Login check
$id_user = $_SESSION["id_usuario"];
global $REMOTE_ADDR;
check_login();
if ((give_acl($id_user, 0, "AR") != 1 ) && (dame_admin($id_user) !=1 )) {
audit_db($id_user, $REMOTE_ADDR, "ACL Violation", "Trying to access node graph builder");
include("general/noaccess.php");
exit;
}
echo '<h2>'.lang_string ('ag_title').' &gt; '.lang_string("Network Map").'&nbsp';
echo '<h2>'.__('ag_title').' &gt; '.__('Network Map').'&nbsp';
if ($pure == 1) {
echo '<a href="index.php?sec=estado&sec2=operation/agentes/networkmap&pure=0"><img src="images/monitor.png" title="' . lang_string('Normal screen') . '"></a>';
echo '<a href="index.php?sec=estado&sec2=operation/agentes/networkmap&pure=0"><img src="images/monitor.png" title="' . __('Normal screen') . '"></a>';
} else {
echo '<a href="index.php?sec=estado&sec2=operation/agentes/networkmap&pure=1"><img src="images/monitor.png" title="' . lang_string('Full screen') . '"></a>';
echo '<a href="index.php?sec=estado&sec2=operation/agentes/networkmap&pure=1"><img src="images/monitor.png" title="' . __('Full screen') . '"></a>';
}
echo '</h2>';
@ -264,19 +262,19 @@ $layout_array = array (
echo '<form name="input" action="index.php?sec=estado&sec2=operation/agentes/networkmap&pure=' . $pure . '" method="post">';
echo '<table cellpadding="4" cellspacing="4" class="databox">';
echo '<tr>';
echo '<td valign="top">' . lang_string('Layout') . ' &nbsp;';
echo '<td valign="top">' . __('Layout') . ' &nbsp;';
print_select ($layout_array, 'layout', $layout, '', '', '');
echo '</td>';
echo '<td valign="top">' . lang_string('No Overlap') . ' &nbsp;';
echo '<td valign="top">' . __('No Overlap') . ' &nbsp;';
print_checkbox ('nooverlap', '1', $nooverlap);
echo '</td>';
echo '<td valign="top">' . lang_string('Simple') . ' &nbsp;';
echo '<td valign="top">' . __('Simple') . ' &nbsp;';
print_checkbox ('simple', '1', $simple);
echo '</td>';
echo '<td valign="top">' . lang_string('Regenerate') . ' &nbsp;';
echo '<td valign="top">' . __('Regenerate') . ' &nbsp;';
print_checkbox ('regen', '1', $regen);
echo '</td>';
@ -291,7 +289,7 @@ if ($pure == "1") {
'5' => 'x10',
);
echo '<td valign="top">' . lang_string('Zoom') . ' &nbsp;';
echo '<td valign="top">' . __('Zoom') . ' &nbsp;';
print_select ($zoom_array, 'zoom', $zoom, '', '', '');
echo '</td>';
@ -299,18 +297,18 @@ if ($pure == "1") {
if ($nooverlap == 1){
echo "<td>";
echo lang_string('Distance between nodes') . ' &nbsp;';
echo __('Distance between nodes') . ' &nbsp;';
print_input_text ('ranksep', $ranksep, $alt = 'Separation between elements in the map (in Non-overlap mode)', 3, 4, 0);
}
echo "<td>";
echo lang_string('Font size') . ' &nbsp;';
echo __('Font size') . ' &nbsp;';
print_input_text ('font_size', $font_size, $alt = 'Font size (in pt)', 3, 4, 0);
//echo ' Display groups <input type="checkbox" name="group" value="group" class="chk"/>';
echo '<td>';
echo '<input name="updbutton" type="submit" class="sub upd" value="'. lang_string ("update"). '">';
echo '<input name="updbutton" type="submit" class="sub upd" value="'. __('update'). '">';
echo '</td>';
echo '</table>';
echo '</form>';
@ -345,7 +343,7 @@ if ($regen != 1 && file_exists ($filename_img) && filemtime ($filename_img) > ti
if ($result !== false) {
if (! file_exists ($filename_map)) {
echo '<h2 class="err">'.lang_string ('Map could not be generated').'</h2>';
echo '<h2 class="err">'.__('Map could not be generated').'</h2>';
echo $result;
echo "<br /> Apparently something went wrong reading the output.<br /> Is ".$filter." (usually part of GraphViz) installed and able to be executed by the webserver?";
echo "<br /> Is ".$config["attachment_store"]." writeable by the webserver?";
@ -354,7 +352,7 @@ if ($result !== false) {
echo '<img src="'.$filename_img.'" usemap="#networkmap" />';
include $filename_map;
} else {
echo '<h2 class="err">'.lang_string ('Map could not be generated').'</h2>';
echo '<h2 class="err">'.__('Map could not be generated').'</h2>';
echo $result;
echo "<br /> Apparently something went wrong executing the command.";
echo "<br /> Is ".$filter." (usually part of GraphViz) and echo installed and able to be executed by the webserver?";

View File

@ -17,37 +17,35 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global vars
global $config;
require("include/config.php");
check_login();
$id_user = $config["id_user"];
if ((give_acl($id_user, 0, "AR") != 1) AND (give_acl($id_user,0,"AW") != 1)) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access SLA View");
if (! give_acl ($config['id_user'], 0, "AR") && ! give_acl ($config['id_user'], 0, "AW")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access SLA View");
require ("general/noaccess.php");
exit;
}
require ("include/functions_reporting.php");
echo "<h2>".lang_string("SLA view")."</h2>";
echo "<h2>".__('SLA view')."</h2>";
$id_agent = get_parameter ("id_agente", "0");
// Get all module from agent
$sql_t='SELECT * FROM tagente_estado, tagente_modulo WHERE tagente_modulo.disabled = 0 AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente='.$id_agent.' AND tagente_estado.estado != 100 AND tagente_estado.utimestamp != 0 ORDER BY tagente_modulo.nombre';
$result_t=mysql_query($sql_t);
if (mysql_num_rows ($result_t)) {
echo "<h3>".lang_string ("Automatic SLA for monitors")."</h3>";
echo "<h3>".__('Automatic SLA for monitors')."</h3>";
echo "<table width='750' cellpadding=4 cellspacing=4 class='databox'>";
echo "<tr><th>X</th>";
echo "<th>".$lang_label["type"]."</th>
<th>".$lang_label["module_name"]."</th>
<th>".$lang_label["SLA"]."</th>
<th>".$lang_label["status"]."</th>
<th>".$lang_label["interval"]."</th>
<th>".$lang_label["last_contact"]."</th>";
echo "<th>".__('type')."</th>
<th>".__('module_name')."</th>
<th>".__('SLA')."</th>
<th>".__('status')."</th>
<th>".__('interval')."</th>
<th>".__('last_contact')."</th>";
$color=0;
while ($module_data=mysql_fetch_array($result_t)){
# For evey module in the status table
@ -96,7 +94,7 @@ if (mysql_num_rows ($result_t)) {
$temp = get_agent_module_sla ($module_data["id_agente_modulo"], $config["sla_period"], 1, 2147483647);
if ($temp === false)
echo lang_string("N/A");
echo __('N/A');
else {
echo format_numeric ($temp)." %</td>";;
}
@ -104,11 +102,11 @@ if (mysql_num_rows ($result_t)) {
echo "<td class='".$tdcolor."' align='center'>";
if ($est_estado == 1){
if ($est_cambio == 1)
echo "<img src='images/pixel_yellow.png' width=40 height=18 title='" . lang_string ("yellow_light") . "'>";
echo "<img src='images/pixel_yellow.png' width=40 height=18 title='" . __('yellow_light') . "'>";
else
echo "<img src='images/pixel_red.png' width=40 height=18 title='". lang_string ("red_light") . "'>";
echo "<img src='images/pixel_red.png' width=40 height=18 title='". __('red_light') . "'>";
} else
echo "<img src='images/pixel_green.png' width=40 height=18 title='". lang_string ("green_light") . "'>";
echo "<img src='images/pixel_green.png' width=40 height=18 title='". __('green_light') . "'>";
echo "<td align='center' class='".$tdcolor."'>";
if ($temp_interval != $intervalo)
@ -123,7 +121,7 @@ if (mysql_num_rows ($result_t)) {
echo "<span>";
}
if ($module_data["timestamp"] == '0000-00-00 00:00:00') {
echo lang_string ("never");
echo __('never');
} else {
echo human_time_comparation($module_data["timestamp"]);
}
@ -135,18 +133,18 @@ if (mysql_num_rows ($result_t)) {
// Get all SLA report components
$sql_t = "SELECT tagente_modulo.id_agente_modulo, sla_max, sla_min, sla_limit, tagente_modulo.id_tipo_modulo, tagente_modulo.nombre, tagente_modulo.descripcion FROM treport_content_sla_combined, tagente_modulo WHERE tagente_modulo.id_agente = $id_agent AND tagente_modulo.id_agente_modulo = treport_content_sla_combined.id_agent_module AND tagente_modulo.id_tipo_modulo IN (1,4,7,8,11,15,16,22,24)";
$result_t=mysql_query($sql_t);
$sql = "SELECT tagente_modulo.id_agente_modulo, sla_max, sla_min, sla_limit, tagente_modulo.id_tipo_modulo, tagente_modulo.nombre, tagente_modulo.descripcion FROM treport_content_sla_combined, tagente_modulo WHERE tagente_modulo.id_agente = $id_agent AND tagente_modulo.id_agente_modulo = treport_content_sla_combined.id_agent_module AND tagente_modulo.id_tipo_modulo IN (1,4,7,8,11,15,16,22,24)";
$result_t = mysql_query ($sql);
if (mysql_num_rows ($result_t)) {
$color=0;
echo "<h3>".lang_string ("User-defined SLA items")." - ";
echo "<h3>".__('User-defined SLA items')." - ";
echo human_time_description_raw($config["sla_period"]). " </h3>";
echo "<table width='750' cellpadding=4 cellspacing=4 class='databox'>";
echo "<tr>";
echo "<th>" . lang_string ("type") . "</th>";
echo "<th>" . lang_string ("module_name") . "</th>";
echo "<th>" . lang_string ("SLA") . "</th>";
echo "<th>" . lang_string ("status") . "</th>";
echo "<th>" . __('type') . "</th>";
echo "<th>" . __('module_name') . "</th>";
echo "<th>" . __('SLA') . "</th>";
echo "<th>" . __('status') . "</th>";
while ($module_data = mysql_fetch_array($result_t)){
if ($color == 1){
@ -177,15 +175,15 @@ if (mysql_num_rows ($result_t)) {
$temp = get_agent_module_sla ($id_agent_module, $config["sla_period"], $sla_min, $sla_max);
if ($temp === false){
echo lang_string("N/A");
echo __('N/A');
echo "<td class='$tdcolor'>";
} else {
echo format_numeric($temp)." %</td>";
echo "<td class='$tdcolor'>";
if ($temp > $sla_limit)
echo "<img src='images/pixel_green.png' width=40 height=18 title='" . lang_string ("green_light") . "'>";
echo "<img src='images/pixel_green.png' width=40 height=18 title='" . __('green_light') . "'>";
else
echo "<img src='images/pixel_red.png' width=40 height=18 title='" . lang_string ("red_light") . "'>";
echo "<img src='images/pixel_red.png' width=40 height=18 title='" . __('red_light') . "'>";
}
}
echo '</table>';

View File

@ -25,7 +25,7 @@ if (!isset($id_agente)){
exit;
}
echo "<h3>".lang_string ("Latest events for this agent")."</h3>";
echo "<h3>".__('Latest events for this agent')."</h3>";
smal_event_table ("WHERE id_agente = $id_agente", $limit = 10, $width=750);
?>

View File

@ -17,20 +17,19 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global vars
global $config;
$id_user = $config["id_user"];
require ("include/config.php");
check_login();
if ((give_acl($id_user, 0, "AR")!=1) AND (give_acl($id_user,0,"AW")!=1)) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
require ("general/noaccess.php");
exit;
if (! give_acl ($config['id_user'], 0, "AR") && ! give_acl ($config['id_user'], 0, "AW")) {
audit_db ($config['id_user'],$REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
require ("general/noaccess.php");
exit;
}
echo "<h2>".$lang_label["ag_title"]." &gt; ";
echo $lang_label["monitor_listing"]."</h2>";
echo "<h2>".__('ag_title')." &gt; ";
echo __('monitor_listing')."</h2>";
$ag_freestring = get_parameter ("ag_freestring", "");
$ag_modulename = get_parameter ("ag_modulename", "");
@ -61,7 +60,7 @@ echo $URL;
echo "'>";
echo "<table cellspacing='4' cellpadding='4' width='600' class='databox'>";
echo "<tr><td valign='middle'>".$lang_label["group"]."</td>";
echo "<tr><td valign='middle'>".__('group')."</td>";
echo "<td valign='middle'>";
echo "<select name='ag_group' onChange='javascript:this.form.submit();' class='w130'>";
@ -69,46 +68,46 @@ if ( $ag_group > 1 ){
echo "<option value='".$ag_group."'>".dame_nombre_grupo($ag_group)."</option>";
}
echo "<option value=1>".dame_nombre_grupo(1)."</option>";
list_group ($id_user);
list_group ($config['id_user']);
echo "</select>";
echo "</td>";
echo "<td>";
echo lang_string ("Monitor status");
echo __('Monitor status');
echo "<td>";
echo "<select name='status'>";
if ($status == -1){
echo "<option value=-1>".lang_string("All")."</option>";
echo "<option value=0>".lang_string("Monitors down")."</option>";
echo "<option value=1>".lang_string("Monitors up")."</option>";
echo "<option value=2>".lang_string("Monitors unknown")."</option>";
echo "<option value=-1>".__('All')."</option>";
echo "<option value=0>".__('Monitors down')."</option>";
echo "<option value=1>".__('Monitors up')."</option>";
echo "<option value=2>".__('Monitors unknown')."</option>";
} elseif ($status == 0){
echo "<option value=0>".lang_string("Monitors down")."</option>";
echo "<option value=-1>".lang_string("All")."</option>";
echo "<option value=1>".lang_string("Monitors up")."</option>";
echo "<option value=2>".lang_string("Monitors unknown")."</option>";
echo "<option value=0>".__('Monitors down')."</option>";
echo "<option value=-1>".__('All')."</option>";
echo "<option value=1>".__('Monitors up')."</option>";
echo "<option value=2>".__('Monitors unknown')."</option>";
} elseif ($status == 2){
echo "<option value=2>".lang_string("Monitors unknown")."</option>";
echo "<option value=0>".lang_string("Monitors down")."</option>";
echo "<option value=-1>".lang_string("All")."</option>";
echo "<option value=1>".lang_string("Monitors up")."</option>";
echo "<option value=2>".__('Monitors unknown')."</option>";
echo "<option value=0>".__('Monitors down')."</option>";
echo "<option value=-1>".__('All')."</option>";
echo "<option value=1>".__('Monitors up')."</option>";
} else {
echo "<option value=1>".lang_string("Monitors up")."</option>";
echo "<option value=0>".lang_string("Monitors down")."</option>";
echo "<option value=2>".lang_string("Monitors unknown")."</option>";
echo "<option value=-1>".lang_string("All")."</option>";
echo "<option value=1>".__('Monitors up')."</option>";
echo "<option value=0>".__('Monitors down')."</option>";
echo "<option value=2>".__('Monitors unknown')."</option>";
echo "<option value=-1>".__('All')."</option>";
}
echo "</select>";
echo "</tr>";
echo "<tr>";
echo "<td valign='middle'>".$lang_label["module_name"]."</td>";
echo "<td valign='middle'>".__('module_name')."</td>";
echo "<td valign='middle'>
<select name='ag_modulename' onChange='javascript:this.form.submit();'>";
if ( isset($ag_modulename)){
echo "<option>".$ag_modulename."</option>";
}
echo "<option>".$lang_label["all"]."</option>";
echo "<option>".__('all')."</option>";
$sql='SELECT DISTINCT nombre
FROM tagente_modulo
WHERE id_tipo_modulo in (2, 6, 9, 18, 21, 100)';
@ -118,11 +117,11 @@ while ($row=mysql_fetch_array($result)){
}
echo "</select>";
echo "<td valign='middle'>";
echo lang_string ("Free text");
echo __('Free text');
echo "<td valign='middle'>";
echo "<input type=text name='ag_freestring' size=15 value='$ag_freestring'>";
echo "<td valign='middle'>";
echo "<input name='uptbutton' type='submit' class='sub' value='".$lang_label["show"]."'";
echo "<input name='uptbutton' type='submit' class='sub' value='".__('show')."'";
echo "</form>";
echo "</table>";
@ -139,9 +138,10 @@ if ($ag_group > 1)
$SQL .=" AND tagente.id_grupo = ".$ag_group;
else {
// User has explicit permission on group 1 ?
$all_group = get_db_sql ("SELECT COUNT(id_grupo) FROM tusuario_perfil WHERE id_usuario='$id_user' AND id_grupo = 1");
$sql = sprintf ("SELECT COUNT(id_grupo) FROM tusuario_perfil WHERE id_usuario='%s' AND id_grupo = 1", $config['id_user']);
$all_group = get_db_sql ($sql);
if ($all_group == 0)
$SQL .=" AND tagente.id_grupo IN (SELECT id_grupo FROM tusuario_perfil WHERE id_usuario='$id_user') ";
$SQL .= sprintf (" AND tagente.id_grupo IN (SELECT id_grupo FROM tusuario_perfil WHERE id_usuario='%s') ", $config['id_user']);
}
// Module name selector
@ -179,13 +179,13 @@ if ($counter > 0) {
echo "<table cellpadding='4' cellspacing='4' width='750' class='databox'>
<tr>
<th>
<th>".$lang_label["agent"]."</th>
<th>".$lang_label["type"]."</th>
<th>".$lang_label["name"]."</th>
<th>".$lang_label["description"]."</th>
<th>".$lang_label["interval"]."</th>
<th>".$lang_label["status"]."</th>
<th>".$lang_label["timestamp"]."</th>";
<th>".__('agent')."</th>
<th>".__('type')."</th>
<th>".__('name')."</th>
<th>".__('description')."</th>
<th>".__('interval')."</th>
<th>".__('status')."</th>
<th>".__('timestamp')."</th>";
$color =1;
$result=mysql_query($SQL_FINAL);
@ -224,9 +224,9 @@ if ($counter > 0) {
echo "<td class='$tdcolor' align='center' width=20>";
if ($data[8] > 0){
echo "<img src='images/pixel_green.png' width=40 height=18 title='".lang_string("Monitor up")."'>";
echo "<img src='images/pixel_green.png' width=40 height=18 title='".__('Monitor up')."'>";
} else {
echo "<img src='images/pixel_red.png' width=40 height=18 title='".lang_string ("Monitor down")."'>";
echo "<img src='images/pixel_red.png' width=40 height=18 title='".__('Monitor down')."'>";
}
echo "<td class='".$tdcolor."f9'>";
@ -241,15 +241,15 @@ if ($counter > 0) {
}
echo "</table>";
} else {
echo "<div class='nf'>".$lang_label["no_monitors_g"]."</div>";
echo "<div class='nf'>".__('no_monitors_g')."</div>";
}
echo "<table width=700 border=0>";
echo "<tr>";
echo "<td class='f9'>";
echo "<img src='images/pixel_green.png' width=40 height=18>&nbsp;&nbsp;".lang_string("Monitor up")."</td>";
echo "<img src='images/pixel_green.png' width=40 height=18>&nbsp;&nbsp;".__('Monitor up')."</td>";
echo "<td class='f9'";
echo "<img src='images/pixel_red.png' width=40 height=18>&nbsp;&nbsp;".lang_string("Monitor down")."</td>";
echo "<img src='images/pixel_red.png' width=40 height=18>&nbsp;&nbsp;".__('Monitor down')."</td>";
echo "</table>";
?>

View File

@ -17,23 +17,23 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global vars
require("include/config.php");
require("include/functions_reporting.php");
$id_user = $_SESSION["id_usuario"];
if (give_acl ($id_user, 0, "AR") != 1) {
audit_db ($id_user, $REMOTE_ADDR, "ACL Violation",
require ("include/config.php");
check_login ();
if (give_acl ($config['id_user'], 0, "AR") != 1) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Agent view (Grouped)");
require ("general/noaccess.php");
exit;
}
echo "<h2>".lang_string ("ag_title")." &gt; ";
echo lang_string ("tactical_view")."</h2>";
$data = general_stats ($id_user,-1);
require ("include/functions_reporting.php");
echo "<h2>".__('ag_title')." &gt; ";
echo __('tactical_view')."</h2>";
$data = general_stats ($config['id_user'],-1);
$monitor_checks = $data[0];
$monitor_ok = $data[1];
@ -91,21 +91,21 @@ echo "<table class='databox' celldpadding=4 cellspacing=4 width=250>";
// Summary
echo "<tr><td colspan='2'><b>".lang_string("Monitor health")."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$monitor_health' title='$monitor_health % ".lang_string("of monitors UP")."'>";
echo "<tr><td colspan='2'><b>".lang_string("Data health")."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$data_health' title='$data_health % ".lang_string("of modules with updated data")."'>";
echo "<tr><td colspan='2'><b>".lang_string("Global health")."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$global_health' title='$global_health % ".lang_string("of modules with good data")."'>";
echo "<tr><td colspan='2'><b>".lang_string("Module sanity")."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$module_sanity ' title='$module_sanity % ".lang_string("of well initialized modules")."'>";
echo "<tr><td colspan='2'><b>".lang_string("Alert level")."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$alert_level' title='$alert_level % ".lang_string("of non-fired alerts")."'>";
echo "<tr><td colspan='2'><b>".__('Monitor health')."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$monitor_health' title='$monitor_health % ".__('of monitors UP')."'>";
echo "<tr><td colspan='2'><b>".__('Data health')."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$data_health' title='$data_health % ".__('of modules with updated data')."'>";
echo "<tr><td colspan='2'><b>".__('Global health')."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$global_health' title='$global_health % ".__('of modules with good data')."'>";
echo "<tr><td colspan='2'><b>".__('Module sanity')."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$module_sanity ' title='$module_sanity % ".__('of well initialized modules')."'>";
echo "<tr><td colspan='2'><b>".__('Alert level')."</th>";
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$alert_level' title='$alert_level % ".__('of non-fired alerts')."'>";
echo "<br><br>";
// Monitor checks
echo "<tr>";
echo "<th colspan=2>".lang_string ("monitor_checks")."</th>";
echo "<th colspan=2>".__('monitor_checks')."</th>";
echo "<tr><td class=datos2><b>"."Monitor checks"."</b></td>";
echo "<td style='font: bold 2em Arial;' class='datos2'>";
echo "<a class='big_data' href='index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=-1'>";
@ -166,7 +166,7 @@ echo "<td class=datos2 style='font: bold 2em Arial'>".$monitor_alert_total;
// Data checks
// ~~~~~~~~~~~~~~~
echo "<tr><th colspan=2>".lang_string ("data_checks")."</th>";
echo "<tr><th colspan=2>".__('data_checks')."</th>";
echo "<tr><td class=datos2><b>"."Data checks"."</b></td>";
echo "<td class=datos2 style='font: bold 2em Arial'>".$data_checks;
echo "<tr><td class=datos><b>"."Data Unknown"."</b></td>";
@ -199,7 +199,7 @@ echo "<td class=datos2 style='font: bold 2em Arial'>".$data_alert_total;
// Summary
// ~~~~~~~~~~~~~~~
echo "<tr><th colspan='2'>".lang_string ("summary")."</th>";
echo "<tr><th colspan='2'>".__('summary')."</th>";
echo "<tr><td class='datos2'><b>"."Total agents"."</b></td>";
echo "<td class='datos2' style='font: bold 2em Arial, Sans-serif;'>".$total_agents;
echo "<tr><td class='datos'><b>"."Total checks"."</b></td>";
@ -208,7 +208,7 @@ echo "<td class='datos' style='font: bold 2em Arial, Sans-serif;'>".$total_check
echo "<tr><td class='datos2'><b>"."Server sanity"."</b></td>";
echo "<td class='datos2' style='font: bold 1em Arial, Sans-serif;'>";
echo format_numeric($notinit_percentage);
echo "% ".lang_string("Uninitialized modules");
echo "% ".__('Uninitialized modules');
echo "</table>";
@ -225,12 +225,12 @@ $result=mysql_query($sql);
if (mysql_num_rows($result)){
echo "<table cellpadding='4' cellspacing='4' witdh='440' class='databox'>";
echo "<tr><th colspan=5>";
echo lang_string("tactical_server_information");
echo "<tr><td class='datos3'>".lang_string ("name")."</th>";
echo "<td class='datos3'>".lang_string ('status')."</th>";
echo "<td class='datos3'>".lang_string ('load')."</th>";
echo "<td class='datos3'>".lang_string ('modules')."</th>";
echo "<td class='datos3'>".lang_string ('lag')."</th>";
echo __('tactical_server_information');
echo "<tr><td class='datos3'>".__('name')."</th>";
echo "<td class='datos3'>".__('status')."</th>";
echo "<td class='datos3'>".__('load')."</th>";
echo "<td class='datos3'>".__('modules')."</th>";
echo "<td class='datos3'>".__('lag')."</th>";
$color=1;
while ($row=mysql_fetch_array($result)){
if ($color == 1){
@ -285,7 +285,7 @@ if (mysql_num_rows($result)){
// Modules
echo "<td class='$tdcolor' align='middle'>";
echo $serverinfo["modules"] . " ".lang_string("of")." ". $total_modules;
echo $serverinfo["modules"] . " ".__('of')." ". $total_modules;
// Lag
echo "<td class='$tdcolor' align='middle'>";

View File

@ -18,6 +18,7 @@
// Load global vars
require("include/config.php");
check_login();
if (defined ('AJAX')) {
$get_agent_json = (bool) get_parameter ('get_agent_json');
@ -44,13 +45,13 @@ if (defined ('AJAX')) {
$id_agent = (int) get_parameter ('id_agent');
$agent = get_db_row ('tagente', 'id_agente', $id_agent);
echo '<h3>'.$agent['nombre'].'</h3>';
echo '<strong>'.lang_string ('Main IP').':</strong> '.$agent['direccion'].'<br />';
echo '<strong>'.lang_string ('Group').':</strong> ';
echo '<strong>'.__('Main IP').':</strong> '.$agent['direccion'].'<br />';
echo '<strong>'.__('Group').':</strong> ';
echo '<img src="images/groups_small/'.dame_grupo_icono ($agent['id_grupo']).'.png" /> ';
echo dame_nombre_grupo ($agent['id_grupo']).'<br />';
echo '<strong>'.lang_string ('Last contact').':</strong> '.human_time_comparation($agent['ultimo_contacto']).'<br />';
echo '<strong>'.lang_string ('Last remote contact').':</strong> '.human_time_comparation($agent['ultimo_contacto_remoto']).'<br />';
echo '<strong>'.__('Last contact').':</strong> '.human_time_comparation($agent['ultimo_contacto']).'<br />';
echo '<strong>'.__('Last remote contact').':</strong> '.human_time_comparation($agent['ultimo_contacto_remoto']).'<br />';
$sql = sprintf ('SELECT tagente_modulo.descripcion, tagente_modulo.nombre
FROM tagente_estado, tagente_modulo
@ -74,7 +75,7 @@ if (defined ('AJAX')) {
// Modules down
if ($size_bad_modules > 0) {
echo '<strong>'.lang_string ('Monitors down').':</strong> '.$size_bad_modules.' / '.$total_modules;
echo '<strong>'.__('Monitors down').':</strong> '.$size_bad_modules.' / '.$total_modules;
echo '<ul>';
foreach ($bad_modules as $module) {
echo '<li>';
@ -101,7 +102,7 @@ if (defined ('AJAX')) {
if ($alert_modules > 0){
$sql = sprintf ('SELECT tagente_modulo.nombre, talerta_agente_modulo.last_fired FROM talerta_agente_modulo, tagente_modulo, tagente WHERE tagente.id_agente = %d AND tagente.disabled = 0 AND tagente.id_agente = tagente_modulo.id_agente AND tagente_modulo.disabled = 0 AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo AND talerta_agente_modulo.times_fired > 0 ', $id_agent);
$alerts = get_db_all_rows_sql ($sql);
echo '<strong>'.lang_string ('Alerts fired').':</strong>';
echo '<strong>'.__('Alerts fired').':</strong>';
echo "<ul>";
foreach ($alerts as $alert_item) {
echo '<li>';
@ -122,138 +123,130 @@ if (defined ('AJAX')) {
exit ();
}
check_login();
$id_agente = (int) get_parameter ("id_agente");
if (! $id_agente) {
return;
}
// get group for this id_agente
$id_grupo = get_db_value ('id_grupo', 'tagente', 'id_agente', $id_agente);
if (! give_acl ($config['id_user'], $id_grupo, "AR")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access (read) to agent ".dame_nombre_agente($id_agente));
include ("general/noaccess.php");
return;
}
$id_agente = get_parameter("id_agente",-1);
if ($id_agente != -1){
// get group for this id_agente
$query="SELECT * FROM tagente WHERE id_agente = ".$id_agente;
$res=mysql_query($query);
$row=mysql_fetch_array($res);
$id_grupo = $row["id_grupo"];
$id_usuario=$config["id_user"];
if (give_acl($id_usuario, $id_grupo, "AR")==1){
// Check for validate alert request
$validate_alert = get_parameter ("validate_alert");
if ($validate_alert != ""){
if (give_acl($id_usuario, $id_grupo, "AW")==1){
$alert_row = get_db_row ("talerta_agente_modulo", "id_aam", $validate_alert);
if ($alert_row["id_agente_modulo"] != 0){
$am_row = get_db_row ("tagente_modulo", "id_agente_modulo", $alert_row["id_agente_modulo"]);
$ag_row = get_db_row ("tagente", "id_agente", $am_row["id_agente"]);
} else {
$ag_row = get_db_row ("tagente", "id_agente", $alert_row ["id_agent"]);
}
$alert_name = $alert_row["descripcion"];
// Single alerts
if ($alert_row["id_agente_modulo"] != 0){
event_insert("Manual validation of alert for '$alert_name'", $ag_row["id_grupo"], $am_row["id_agente"], 1, $config["id_user"], "alert_manual_validation", 1, $alert_row["id_agente_modulo"], $validate_alert);
// Combined alerts
} else {
event_insert("Manual validation of alert for '$alert_name'", $ag_row["id_grupo"], $alert_row ["id_agent"], 1, $config["id_user"], "alert_manual_validation", 1, 0, $validate_alert);
}
$sql='UPDATE talerta_agente_modulo SET times_fired = 0, internal_counter = 0 WHERE id_aam = '.$validate_alert;
$result=mysql_query($sql);
}
}
// Check for Network FLAG change request
if (isset($_GET["flag"])){
if ($_GET["flag"]==1){
if (give_acl($id_usuario, $id_grupo, "AW")==1){
$query ="UPDATE tagente_modulo SET flag=1 WHERE id_agente_modulo = ".$_GET["id_agente_modulo"];
$res=mysql_query($query);
}
}
}
// Check for Network FLAG change request
if (isset($_GET["flag_agent"])){
if ($_GET["flag_agent"]==1){
if (give_acl($id_usuario, $id_grupo, "AW")==1){
$query ="UPDATE tagente_modulo SET flag=1 WHERE id_agente = ". $id_agente;
$res=mysql_query($query);
}
}
}
if (give_acl($id_usuario,$id_grupo, "AR") == 1){
echo "<div id='menu_tab_frame_view'>";
echo "<div id='menu_tab_left'><ul class='mn'><li class='view'>
<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='images/bricks.png' class='top' border=0>&nbsp; ".substr(dame_nombre_agente($id_agente),0,15)." - ".$lang_label["view_mode"]."</a>";
echo "</li>";
echo "</ul></div>";
$tab = get_parameter ("tab", "main");
echo "<div id='menu_tab'><ul class='mn'>";
if (give_acl($id_usuario,$id_grupo, "AW") == 1){
if ($tab == "manage") {
echo "<li class='nomn_high'>";
} else {
echo "<li class='nomn'>";
// Manage agent
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=$id_agente'><img src='images/setup.png' width='16' class='top' border=0> ".$lang_label["Manage"]." </a>";
echo "</li>";
}
} // Main view
if ($tab == "main") {
echo "<li class='nomn_high'>";
} else {
echo "<li class='nomn'>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='images/monitor.png' class='top' border=0> ".$lang_label["Main"]." </a>";
echo "</li>";
}
// Data
if ($tab == "data") {
echo "<li class='nomn_high'>";
} else {
echo "<li class='nomn'>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=data'><img src='images/lightbulb.png' class='top' border=0> ".$lang_label["Data"]." </a>";
echo "</li>";
}
// Alerts
if ($tab == "alert") {
echo "<li class='nomn_high'>";
} else {
echo "<li class='nomn'>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=alert'><img src='images/bell.png' class='top' border=0> ".$lang_label["Alerts"]." </a>";
echo "</li>";
}
// Go to SLA view
echo "<li class='nomn'>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=sla&id_agente=$id_agente'><img src='images/images.png' class='top' border=0> ".lang_string("SLA")." </a>";
echo "</li>";
echo "</ul>";
echo "</div>";
echo "</div>";
echo "<div style='height: 25px'> </div>";
switch ($tab) {
case "sla":
require "sla_view.php";
break;
case "manage":
require "estado_generalagente.php";
break;
case "main":
require "estado_generalagente.php";
require "estado_monitores.php";
require "estado_alertas.php";
require "status_events.php";
break;
case "data":
require "estado_ultimopaquete.php";
break;
case "alert":
require "estado_alertas.php";
break;
}
// Check for validate alert request
$validate_alert = get_parameter ("validate_alert");
if ($validate_alert != ""){
if (give_acl ($config['id_user'], $id_grupo, "AW")==1){
$alert_row = get_db_row ("talerta_agente_modulo", "id_aam", $validate_alert);
if ($alert_row["id_agente_modulo"] != 0){
$am_row = get_db_row ("tagente_modulo", "id_agente_modulo", $alert_row["id_agente_modulo"]);
$ag_row = get_db_row ("tagente", "id_agente", $am_row["id_agente"]);
} else {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to read data from agent ".dame_nombre_agente($id_agente));
require ("general/noaccess.php");
$ag_row = get_db_row ("tagente", "id_agente", $alert_row ["id_agent"]);
}
} else {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access (read) to agent ".dame_nombre_agente($id_agente));
include ("general/noaccess.php");
$alert_name = $alert_row["descripcion"];
// Single alerts
if ($alert_row["id_agente_modulo"] != 0){
event_insert("Manual validation of alert for '$alert_name'", $ag_row["id_grupo"], $am_row["id_agente"], 1, $config["id_user"], "alert_manual_validation", 1, $alert_row["id_agente_modulo"], $validate_alert);
// Combined alerts
} else {
event_insert("Manual validation of alert for '$alert_name'", $ag_row["id_grupo"], $alert_row ["id_agent"], 1, $config["id_user"], "alert_manual_validation", 1, 0, $validate_alert);
}
$sql='UPDATE talerta_agente_modulo SET times_fired = 0, internal_counter = 0 WHERE id_aam = '.$validate_alert;
$result=mysql_query($sql);
}
}
// Check for Network FLAG change request
if (isset($_GET["flag"])) {
if ($_GET["flag"] == 1 && give_acl ($config['id_user'], $id_grupo, "AW")) {
$sql = "UPDATE tagente_modulo SET flag=1 WHERE id_agente_modulo = ".$_GET["id_agente_modulo"];
process_sql ($sql);
}
}
// Check for Network FLAG change request
if (isset($_GET["flag_agent"])){
if ($_GET["flag_agent"] == 1 && give_acl ($config['id_user'], $id_grupo, "AW")) {
$sql ="UPDATE tagente_modulo SET flag=1 WHERE id_agente = ". $id_agente;
process_sql ($sql);
}
}
echo "<div id='menu_tab_frame_view'>";
echo "<div id='menu_tab_left'><ul class='mn'><li class='view'>
<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='images/bricks.png' class='top' border=0>&nbsp; ".substr(dame_nombre_agente($id_agente),0,15)." - ".__('view_mode')."</a>";
echo "</li>";
echo "</ul></div>";
$tab = get_parameter ("tab", "main");
echo "<div id='menu_tab'><ul class='mn'>";
if (give_acl ($config['id_user'],$id_grupo, "AW")) {
if ($tab == "manage") {
echo "<li class='nomn_high'>";
} else {
echo "<li class='nomn'>";
// Manage agent
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=$id_agente'><img src='images/setup.png' width='16' class='top' border=0> ".__('Manage')." </a>";
echo "</li>";
}
}
// Main view
if ($tab == "main") {
echo "<li class='nomn_high'>";
} else {
echo "<li class='nomn'>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='images/monitor.png' class='top' border=0> ".__('Main')." </a>";
echo "</li>";
}
// Data
if ($tab == "data") {
echo "<li class='nomn_high'>";
} else {
echo "<li class='nomn'>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=data'><img src='images/lightbulb.png' class='top' border=0> ".__('Data')." </a>";
echo "</li>";
}
// Alerts
if ($tab == "alert") {
echo "<li class='nomn_high'>";
} else {
echo "<li class='nomn'>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=alert'><img src='images/bell.png' class='top' border=0> ".__('Alerts')." </a>";
echo "</li>";
}
// Go to SLA view
echo "<li class='nomn'>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=sla&id_agente=$id_agente'><img src='images/images.png' class='top' border=0> ".__('SLA')." </a>";
echo "</li>";
echo "</ul>";
echo "</div>";
echo "</div>";
echo "<div style='height: 25px'> </div>";
switch ($tab) {
case "sla":
require "sla_view.php";
break;
case "manage":
require "estado_generalagente.php";
break;
case "main":
require "estado_generalagente.php";
require "estado_monitores.php";
require "estado_alertas.php";
require "status_events.php";
break;
case "data":
require "estado_ultimopaquete.php";
break;
case "alert":
require "estado_alertas.php";
break;
}
?>

View File

@ -20,26 +20,26 @@
// Load global vars
require("include/config.php");
if (comprueba_login() == 0) {
$id_usuario =$_SESSION["id_usuario"];
if (give_acl($id_usuario, 0, "AR")==1) {
echo "<h2>".$lang_label["events"]." &gt; ";
echo $lang_label["event_statistics"]."</h2>";
echo "<br><br>";
echo "<table width=95%>";
echo "<tr><td valign='top'>";
echo "<h3>".$lang_label["graph_event_total"]."</h3>";
echo '<img src="reporting/fgraph.php?tipo=total_events&width=300&height=200" border=0>';
echo "<td valign='top'>";
echo "<h3>".$lang_label["graph_event_user"]."</h3>";
echo '<img src="reporting/fgraph.php?tipo=user_events&width=300&height=200" border=0>';
echo "<tr><td>";
echo "<h3>".$lang_label["graph_event_group"]."</h3>";
echo '<img src="reporting/fgraph.php?tipo=group_events&width=300&height=200" border=0>';
echo "</table>";
} else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access event viewer");
require ("general/noaccess.php");
}
check_login ();
if (! give_acl ($config['id_user'], 0, "AR")) {
audit_db ($config['id_user'],$REMOTE_ADDR, "ACL Violation","Trying to access event viewer");
require ("general/noaccess.php");
return;
}
?>
echo "<h2>".__('events')." &gt; ";
echo __('event_statistics')."</h2>";
echo "<br><br>";
echo "<table width=95%>";
echo "<tr><td valign='top'>";
echo "<h3>".__('graph_event_total')."</h3>";
echo '<img src="reporting/fgraph.php?tipo=total_events&width=300&height=200" border=0>';
echo "<td valign='top'>";
echo "<h3>".__('graph_event_user')."</h3>";
echo '<img src="reporting/fgraph.php?tipo=user_events&width=300&height=200" border=0>';
echo "<tr><td>";
echo "<h3>".__('graph_event_group')."</h3>";
echo '<img src="reporting/fgraph.php?tipo=group_events&width=300&height=200" border=0>';
echo "</table>";
?>

View File

@ -55,38 +55,38 @@
// Load global vars
require("include/config.php");
if (comprueba_login() != 0) {
audit_db("Noauth",$REMOTE_ADDR, "No authenticated acces","Trying to access event viewer");
no_permission();
check_login ();
if (! give_acl ($config["id_user"], 0, "AR")) {
audit_db ($config["id_user"], $REMOTE_ADDR, "ACL Violation",
"Trying to access event viewer");
require ("general/noaccess.php");
return;
}
$accion = "";
if (give_acl($config["id_user"], 0, "AR")!=1) {
audit_db($config["id_user"],$REMOTE_ADDR, "ACL Violation","Trying to access event viewer");
no_permission();
}
// OPERATIONS
// Delete Event (only incident management access).
if (isset($_GET["delete"])){
if (isset ($_GET["delete"])) {
$id_evento = $_GET["delete"];
// Look for event_id following parameters: id_group.
$id_group = gime_idgroup_from_idevent($id_evento);
if (give_acl($id_user, $id_group, "IM") ==1){
if (give_acl ($config['id_user'], $id_group, "IM")) {
$sql2="DELETE FROM tevento WHERE id_evento =".$id_evento;
$result2=mysql_query($sql2);
if ($result) {
echo "<h3 class='suc'>".$lang_label["delete_event_ok"]."</h3>";
audit_db($id_user,$REMOTE_ADDR, "Event deleted","Deleted event: ".return_event_description ($id_evento));
echo "<h3 class='suc'>".__('delete_event_ok')."</h3>";
audit_db ($config['id_user'], $REMOTE_ADDR,
"Event deleted","Deleted event: ".return_event_description ($id_evento));
}
} else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to delete event ID".$id_evento);
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to delete event ID".$id_evento);
}
}
// Check Event (only incident write access).
if (isset($_GET["check"])){
if (isset ($_GET["check"])) {
$id_evento = $_GET["check"];
// Look for event_id following parameters: id_group.
$id_group = gime_idgroup_from_idevent($id_evento);
@ -94,30 +94,33 @@ if (isset($_GET["check"])){
$sql2="UPDATE tevento SET estado = 1, id_usuario = '".$config["id_user"]."' WHERE id_evento = ".$id_evento;
$result2=mysql_query($sql2);
if ($result2) {
echo "<h3 class='suc'>".$lang_label["validate_event_ok"]."</h3>";
echo "<h3 class='suc'>".__('validate_event_ok')."</h3>";
audit_db($config["id_user"],$REMOTE_ADDR, "Event validated","Validate event: ".return_event_description ($id_evento));
} else {
echo "<h3 class='error'>".$lang_label["validate_event_failed"]."</h3>";
echo "<h3 class='error'>".__('validate_event_failed')."</h3>";
}
} else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to checkout event ".return_event_description ($id_evento));
audit_db ($config['id_user'],$REMOTE_ADDR, "ACL Violation",
"Trying to checkout event ".return_event_description ($id_evento));
}
}
// Mass-process DELETE
if (isset($_POST["deletebt"])){
if (isset ($_POST["deletebt"])){
$count=0;
while ($count <= $config["block_size"]){
if (isset($_POST["eventid".$count])){
$event_id = $_POST["eventid".$count];
// Look for event_id following parameters: id_group.
$id_group = gime_idgroup_from_idevent($event_id);
if (give_acl($id_user, $id_group, "IM") ==1){
mysql_query("DELETE FROM tevento WHERE id_evento = ".$event_id);
audit_db($id_user,$REMOTE_ADDR, "Event deleted","Deleted event: ".return_event_description ($event_id));
if (give_acl ($config['id_user'], $id_group, "IM")) {
process_sql ("DELETE FROM tevento WHERE id_evento = ".$event_id);
audit_db ($config['id_user'], $REMOTE_ADDR,
"Event deleted","Deleted event: ".return_event_description ($event_id));
} else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to delete event ".return_event_description ($event_id));
audit_db ($config['id_user'], $REMOTE_ADDR,
"ACL Violation","Trying to delete event ".return_event_description ($event_id));
}
}
$count++;
@ -125,18 +128,20 @@ if (isset($_POST["deletebt"])){
}
// Mass-process UPDATE
if (isset($_POST["updatebt"])){
$count=0;
while ($count <= $config["block_size"]){
if (isset($_POST["eventid".$count])){
if (isset ($_POST["updatebt"])) {
$count = 0;
while ($count <= $config["block_size"]) {
if (isset ($_POST["eventid".$count])) {
$id_evento = $_POST["eventid".$count];
$id_group = gime_idgroup_from_idevent($id_evento);
if (give_acl($id_user, $id_group, "IW") ==1){
$sql2="UPDATE tevento SET estado=1, id_usuario = '".$id_user."' WHERE estado = 0 AND id_evento = ".$id_evento;
$result2=mysql_query($sql2);
audit_db($id_user,$REMOTE_ADDR, "Event validated","Validate event: ".return_event_description ($id_evento));
if (give_acl ($config['id_user'], $id_group, "IW")) {
$sql = "UPDATE tevento SET estado=1, id_usuario = '".$config['id_user']."' WHERE estado = 0 AND id_evento = ".$id_evento;
$result = process_sql ($sql);
audit_db ($config['id_user'], $REMOTE_ADDR,
"Event validated","Validate event: ".return_event_description ($id_evento));
} else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to checkout event ID".$id_evento);
audit_db ($config['id_user'], $REMOTE_ADDR,
"ACL Violation","Trying to checkout event ID".$id_evento);
}
}
$count++;
@ -175,18 +180,18 @@ if ($id_agent != -1)
$sql_post .= " AND id_agente = $id_agent";
$url = "index.php?sec=eventos&sec2=operation/events/events&search=$search&event_type=$event_type&severity=$severity&status=$status&ev_group=$ev_group&refr=60&id_agent=$id_agent";
echo "<h2>".$lang_label["events"]." &gt; ".lang_string ("event_main_view"). "&nbsp";
echo "<h2>".__('events')." &gt; ".__('event_main_view'). "&nbsp";
if ($config["pure"] == 1)
echo "<a target='_top' href='$url&pure=0'><img src='images/monitor.png' title='".lang_string("Normal screen")."'></a>";
echo "<a target='_top' href='$url&pure=0'><img src='images/monitor.png' title='".__('Normal screen')."'></a>";
else {
// Fullscreen
echo "<a target='_top' href='$url&pure=1'><img src='images/monitor.png' title='".lang_string("Full screen")."'></a>";
echo "<a target='_top' href='$url&pure=1'><img src='images/monitor.png' title='".__('Full screen')."'></a>";
}
echo "</h2>";
echo "<a href=\"javascript:;\" onmousedown=\"toggleDiv('event_control');\">";
echo "<b>".lang_string("Event control filter")." ".'<img src="images/wand.png"></A></b>';
echo "<b>".__('Event control filter')." ".'<img src="images/wand.png"></A></b>';
if ($config["pure"] == 1)
echo "<div id='event_control' style='display:none'>";
@ -203,7 +208,7 @@ echo "<tr>";
echo "<form method='post' action='index.php?sec=eventos&sec2=operation/events/events&refr=60&id_agent=$id_agent&pure=".$config["pure"]."'>";
// Group combo
echo "<td>".lang_string ("group")."</td>";
echo "<td>".__('group')."</td>";
echo "<td>";
echo "<select name='ev_group' onChange='javascript:this.form.submit();' class='w130'>";
if ( $ev_group > 1 ){
@ -214,52 +219,52 @@ list_group ($config["id_user"]);
echo "</select></td>";
// Event type
echo "<td>".lang_string ("Event type")."</td>";
echo "<td>".__('Event type')."</td>";
echo "<td>";
echo print_select (get_event_types (), 'event_type', $event_type, '', 'all', "");
echo "<tr>";
// Severity
echo "<td>".lang_string ("Severity")."</td>";
echo "<td>".__('Severity')."</td>";
echo "<td>";
print_select (get_priorities (), "severity", $severity, '', 'all', '-1');
// Status
echo "<td>".lang_string ("Event status")."</td>";
echo "<td>".__('Event status')."</td>";
echo "<td>";
echo "<select name='status' onChange='javascript:this.form.submit();'>";
if ($status == 1){
echo "<option value=1>". lang_string ("Only validated");
echo "<option value=-1>". lang_string ("All event");
echo "<option value=0>". lang_string ("Only pending");
echo "<option value=1>". __('Only validated');
echo "<option value=-1>". __('All event');
echo "<option value=0>". __('Only pending');
} elseif ($status == 0) {
echo "<option value=0>". lang_string ("Only pending");
echo "<option value=1>". lang_string ("Only validated");
echo "<option value=-1>". lang_string ("All event");
echo "<option value=0>". __('Only pending');
echo "<option value=1>". __('Only validated');
echo "<option value=-1>". __('All event');
} elseif ($status == -1) {
echo "<option value=-1>". lang_string ("All event");
echo "<option value=0>". lang_string ("Only pending");
echo "<option value=1>". lang_string ("Only validated");
echo "<option value=-1>". __('All event');
echo "<option value=0>". __('Only pending');
echo "<option value=1>". __('Only validated');
}
echo "</select></td>";
echo "<tr>";
// Free search
echo "<td>".lang_string ("Free search")."</td>";
echo "<td>".__('Free search')."</td>";
echo "<td>";
echo "<input type='text' size=15 value='".$search."' name='search'>";
echo "<td colspan=2>";
echo "<input type=submit value='".lang_string("Update")."' class='sub upd'>";
echo "<input type=submit value='".__('Update')."' class='sub upd'>";
echo "&nbsp;&nbsp;&nbsp;";
// CSV
echo "<a href='operation/events/export_csv.php?ev_group=$ev_group&event_type=$event_type&search=$search&severity=$severity&status=$status&id_agent=$id_agent'>";
echo "<img src='images/disk.png' title='Export to CSV file'></A>";
// Marquee
echo "&nbsp;<a target='_top' href='operation/events/events_marquee.php'><img src='images/heart.png' title='".lang_string("Marquee display")."'></a>";
echo "&nbsp;<a target='_top' href='operation/events/events_marquee.php'><img src='images/heart.png' title='".__('Marquee display')."'></a>";
// RSS
echo "&nbsp;<a target='_top' href='operation/events/events_rss.php'><img src='images/transmit.png' title='".lang_string("RSS Events")."'></a>";
echo "&nbsp;<a target='_top' href='operation/events/events_rss.php'><img src='images/transmit.png' title='".__('RSS Events')."'></a>";
echo "</table>";
@ -292,17 +297,17 @@ if ($total_events > 0){
else
echo "<table cellpadding='4' cellspacing='4' class='databox'>";
echo "<tr>";
echo "<th class=f9>".lang_string ("St")."</th>";
echo "<th class=f9>".lang_string ("Type")."</th>";
echo "<th class=f9>".$lang_label["event_name"]."</th>";
echo "<th class=f9>".$lang_label["agent_name"]."</th>";
echo "<th class=f9>".lang_string ("source")."</th>";
echo "<th class=f9>".$lang_label["group"]."</th>";
echo "<th class=f9>".$lang_label["id_user"]."</th>";
echo "<th class=f9>".$lang_label["timestamp"]."</th>";
echo "<th class=f9>".$lang_label["action"]."</th>";
echo "<th class=f9>".__('St')."</th>";
echo "<th class=f9>".__('Type')."</th>";
echo "<th class=f9>".__('event_name')."</th>";
echo "<th class=f9>".__('agent_name')."</th>";
echo "<th class=f9>".__('source')."</th>";
echo "<th class=f9>".__('group')."</th>";
echo "<th class=f9>".__('id_user')."</th>";
echo "<th class=f9>".__('timestamp')."</th>";
echo "<th class=f9>".__('action')."</th>";
echo "<th class='p10'>";
echo "<label for='checkbox' class='p21'>".$lang_label["all"]." </label>";
echo "<label for='checkbox' class='p21'>".__('all')." </label>";
echo '<input type="checkbox" class="chk" name="allbox" onclick="CheckAll();"></th>';
echo "<form name='eventtable' method='POST' action='$url&pure=".$config["pure"]."'>";
$id_evento = 0;
@ -404,9 +409,9 @@ if ($total_events > 0){
// for System or SNMP generated alerts
} else {
if ($row2["event_type"] == "system") {
echo "<td class='$tdclass' colspan=3>".lang_string("System");
echo "<td class='$tdclass' colspan=3>".__('System');
} else {
echo "<td class='$tdclass' colspan=3>".$lang_label["alert"]."SNMP";
echo "<td class='$tdclass' colspan=3>".__('alert')."SNMP";
}
}
@ -440,26 +445,26 @@ if ($total_events > 0){
echo "</table>";
echo "<table width='750'><tr><td align='right'>";
echo "<input class='sub ok' type='submit' name='updatebt' value='".$lang_label["validate"]."'> ";
echo "<input class='sub ok' type='submit' name='updatebt' value='".__('validate')."'> ";
if (give_acl($config["id_user"], 0,"IM") ==1){
echo "<input class='sub delete' type='submit' name='deletebt' value='".$lang_label["delete"]."'>";
echo "<input class='sub delete' type='submit' name='deletebt' value='".__('delete')."'>";
}
echo "</form></table>";
echo "<table>";
echo "<tr>";
echo "<td rowspan='4' class='f9' style='padding-left: 30px; line-height: 17px; vertical-align: top;'>";
echo "<h3>".$lang_label["status"]."</h3>";
echo "<img src='images/dot_green.png'> - ".$lang_label["validated_event"];
echo "<h3>".__('status')."</h3>";
echo "<img src='images/dot_green.png'> - ".__('validated_event');
echo "<br>";
echo "<img src='images/dot_red.png'> - ".$lang_label["not_validated_event"];
echo "<img src='images/dot_red.png'> - ".__('not_validated_event');
echo "</td>";
echo "<td rowspan='4' class='f9' style='padding-left: 30px; line-height: 17px; vertical-align: top;'>";
echo "<h3>".$lang_label["action"]."</h3>";
echo "<img src='images/ok.png'> - ".$lang_label["validate_event"];
echo "<h3>".__('action')."</h3>";
echo "<img src='images/ok.png'> - ".__('validate_event');
echo "<br>";
echo "<img src='images/cross.png'> - ".$lang_label["delete_event"];
echo "<img src='images/cross.png'> - ".__('delete_event');
echo "<br>";
echo "<img src='images/page_lightning.png'> - ".$lang_label["create_incident"];
echo "<img src='images/page_lightning.png'> - ".__('create_incident');
echo "</td></tr></table>";
} // no events to show
?>

View File

@ -17,21 +17,22 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
if (give_acl ($config['id_user'], 0, "AR") != 1 && dame_admin ($config['id_user']) != 1) {
audit_db ($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access extensions list");
if (! give_acl ($config['id_user'], 0, "AR")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access extensions list");
include ("general/noaccess.php");
exit;
}
if (sizeof ($config['extensions']) == 0) {
echo '<h3>'.lang_string ('There are no extensions defined').'</h3>';
echo '<h3>'.__('There are no extensions defined').'</h3>';
return;
}
echo '<h2>'.lang_string ('Defined extensions')."</h2>";
echo '<h2>'.__('Defined extensions')."</h2>";
$table->width = '95%';
$table->head = array ();
$table->head[0] = lang_string ('Name');
$table->head[0] = __('Name');
$table->data = array ();
foreach ($config['extensions'] as $extension) {

View File

@ -17,16 +17,12 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
$accion = "";
require("include/config.php");
if (comprueba_login() != 0) {
audit_db("Noauth",$REMOTE_ADDR, "No authenticated acces","Trying to access incident viewer");
require ("general/noaccess.php");
exit;
}
require ("include/config.php");
$id_usuario =$_SESSION["id_usuario"];
if (give_acl($id_usuario, 0, "IR")!=1) {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access incident viewer");
check_login ();
if (! give_acl ($config['id_user'], 0, "IR")) {
audit_db($config['id_user'],$REMOTE_ADDR, "ACL Violation","Trying to access incident viewer");
require ("general/noaccess.php");
exit;
}
@ -47,13 +43,13 @@ if (isset($_GET["quick_delete"])){
$row2=mysql_fetch_array($result2);
if ($row2) {
$id_author_inc = $row2["id_usuario"];
if ((give_acl($id_usuario, $row2["id_grupo"], "IM") ==1) OR ($_SESSION["id_usuario"] == $id_author_inc) ){
if (give_acl ($config['id_user'], $row2["id_grupo"], "IM") || $config["id_user"] == $id_author_inc) {
borrar_incidencia($id_inc);
echo "<h3 class='suc'>".$lang_label["del_incid_ok"]."</h3>";
audit_db($id_author_inc,$REMOTE_ADDR,"Incident deleted","User ".$id_usuario." deleted incident #".$id_inc);
echo "<h3 class='suc'>".__('del_incid_ok')."</h3>";
audit_db($id_author_inc,$REMOTE_ADDR,"Incident deleted","User ".$config['id_user']." deleted incident #".$id_inc);
} else {
audit_db($id_author_inc,$REMOTE_ADDR,"ACL Forbidden","User ".$_SESSION["id_usuario"]." try to delete incident");
echo "<h3 class='error'>".$lang_label["del_incid_no"]."</h3>";
echo "<h3 class='error'>".__('del_incid_no')."</h3>";
no_permission();
}
}
@ -64,7 +60,7 @@ if ((isset($_GET["action"])) AND ($_GET["action"]=="update")){
$id_inc = $_POST["id_inc"];
$grupo = entrada_limpia($_POST['grupo_form']);
$usuario= entrada_limpia($_POST["usuario_form"]);
if ((give_acl($id_usuario, $grupo, "IM")==1) OR ($usuario == $id_usuario)) { // Only admins (manage incident) or owners can modify incidents
if (give_acl ($config['id_user'], $grupo, "IM") || $usuario == $config['id_user']) { // Only admins (manage incident) or owners can modify incidents
$id_author_inc = give_incident_author($id_inc);
$titulo = entrada_limpia($_POST["titulo"]);
$descripcion = entrada_limpia($_POST['descripcion']);
@ -74,14 +70,14 @@ if ((isset($_GET["action"])) AND ($_GET["action"]=="update")){
$ahora=date("Y/m/d H:i:s");
$sql = "UPDATE tincidencia SET actualizacion = '".$ahora."', titulo = '".$titulo."', origen= '".$origen."', estado = '".$estado."', id_grupo = '".$grupo."', id_usuario = '".$usuario."', prioridad = '".$prioridad."', descripcion = '".$descripcion."' WHERE id_incidencia = ".$id_inc;
$result=mysql_query($sql);
audit_db($id_author_inc,$REMOTE_ADDR,"Incident updated","User ".$id_usuario." deleted updated #".$id_inc);
audit_db($id_author_inc,$REMOTE_ADDR,"Incident updated","User ".$config['id_user']." deleted updated #".$id_inc);
if ($result)
echo "<h3 class='suc'>".$lang_label["upd_incid_ok"]."</h3>";
echo "<h3 class='suc'>".__('upd_incid_ok')."</h3>";
else
echo "<h3 class='suc'>".$lang_label["upd_incid_no"]."</h3>";
echo "<h3 class='suc'>".__('upd_incid_no')."</h3>";
} else {
audit_db($id_usuario,$REMOTE_ADDR,"ACL Forbidden","User ".$_SESSION["id_usuario"]." try to update incident");
echo "<h3 class='error'>".$lang_label["upd_incid_no"]."</h3>";
audit_db($config['id_user'],$REMOTE_ADDR,"ACL Forbidden","User ".$_SESSION["id_usuario"]." try to update incident");
echo "<h3 class='error'>".__('upd_incid_no')."</h3>";
no_permission();
}
}
@ -89,7 +85,7 @@ if ((isset($_GET["action"])) AND ($_GET["action"]=="update")){
if ((isset($_GET["action"])) AND ($_GET["action"]=="insert")){
$grupo = entrada_limpia($_POST['grupo_form']);
$usuario= entrada_limpia($_POST["usuario_form"]);
if ((give_acl($id_usuario, $grupo, "IM") == 1) OR ($usuario == $id_usuario)) { // Only admins (manage
if (give_acl ($config['id_user'], $grupo, "IM") || $usuario == $config['id_user']) { // Only admins (manage
// Read input variables
$titulo = entrada_limpia($_POST['titulo']);
$inicio = date("Y/m/d H:i:s");
@ -98,16 +94,16 @@ if ((isset($_GET["action"])) AND ($_GET["action"]=="insert")){
$origen = entrada_limpia($_POST['origen_form']);
$prioridad = entrada_limpia($_POST['prioridad_form']);
$actualizacion = $inicio;
$id_creator = $id_usuario;
$id_creator = $config['id_user'];
$estado = entrada_limpia($_POST["estado_form"]);
$sql = " INSERT INTO tincidencia (inicio,actualizacion,titulo,descripcion,id_usuario,origen,estado,prioridad,id_grupo, id_creator) VALUES ('".$inicio."','".$actualizacion."','".$titulo."','".$descripcion."','".$usuario."','".$origen."','".$estado."','".$prioridad."','".$grupo."','".$id_creator."') ";
if (mysql_query($sql)){
echo "<h3 class='suc'>".$lang_label["create_incid_ok"]."</h3>";
echo "<h3 class='suc'>".__('create_incid_ok')."</h3>";
$id_inc=mysql_insert_id();
audit_db($usuario,$REMOTE_ADDR,"Incident created","User ".$id_usuario." created incident #".$id_inc);
audit_db($usuario,$REMOTE_ADDR,"Incident created","User ".$config['id_user']." created incident #".$id_inc);
}
} else {
audit_db($id_usuario,$REMOTE_ADDR,"ACL Forbidden","User ".$_SESSION["id_usuario"]." try to create incident");
audit_db($config['id_user'],$REMOTE_ADDR,"ACL Forbidden","User ".$_SESSION["id_usuario"]." try to create incident");
no_permission();
}
}
@ -183,10 +179,10 @@ $sql1_count="SELECT COUNT(id_incidencia) FROM tincidencia ".$sql1;
$sql1=$sql0;
$sql1=$sql1." LIMIT $offset, ".$config["block_size"];
echo "<h2>".$lang_label["incident_manag"]." &gt; ";
echo $lang_label["manage_incidents"]."</h2>";
echo "<h2>".__('incident_manag')." &gt; ";
echo __('manage_incidents')."</h2>";
if (isset($_POST['operacion'])){
echo $lang_label["incident_view_filter"]." - ".$_POST['operacion']."</h2>";
echo __('incident_view_filter')." - ".$_POST['operacion']."</h2>";
}
?>
@ -194,7 +190,7 @@ if (isset($_POST['operacion'])){
<table class="databox" cellpadding="4" cellspacing="4">
<tr>
<td valign="middle">
<h3><?php echo $lang_label["filter"]; ?></h3>
<h3><?php echo __('filter'); ?></h3>
<select name="estado" onChange="javascript:this.form.submit();" class="w155">
<?php
// Tipo de estado (Type)
@ -211,41 +207,41 @@ if (isset($_POST['operacion'])){
$estado = $_POST["estado"];
echo "<option value='".$estado."'>";
switch ($estado){
case -1: echo $lang_label["all_inc"]."</option>"; break;
case 0: echo $lang_label["opened_inc"]."</option>"; break;
case 13: echo $lang_label["closed_inc"]."</option>"; break;
case 2: echo $lang_label["rej_inc"]."</option>"; break;
case 3: echo $lang_label["exp_inc"]."</option>"; break;
case -1: echo __('all_inc')."</option>"; break;
case 0: echo __('opened_inc')."</option>"; break;
case 13: echo __('closed_inc')."</option>"; break;
case 2: echo __('rej_inc')."</option>"; break;
case 3: echo __('exp_inc')."</option>"; break;
}
}
echo "<option value='-1'>".$lang_label["all_inc"]."</option>";
echo "<option value='0'>".$lang_label["opened_inc"]."</option>";
echo "<option value='13'>".$lang_label["closed_inc"]."</option>";
echo "<option value='2'>".$lang_label["rej_inc"]."</option>";
echo "<option value='3'>".$lang_label["exp_inc"]."</option>";
echo "<option value='-1'>".__('all_inc')."</option>";
echo "<option value='0'>".__('opened_inc')."</option>";
echo "<option value='13'>".__('closed_inc')."</option>";
echo "<option value='2'>".__('rej_inc')."</option>";
echo "<option value='3'>".__('exp_inc')."</option>";
?>
</select>
</td>
<td valign="middle">
<noscript><input type="submit" class="sub" value="<?php echo $lang_label["show"] ?>" border="0"></noscript>
<noscript><input type="submit" class="sub" value="<?php echo __('show') ?>" border="0"></noscript>
</td>
<td rowspan="5" class="f9" style="padding-left: 30px; vertical-align: top;">
<h3><?php echo $lang_label["status"] ?></h3>
<img src='images/dot_red.png'> - <?php echo $lang_label["opened_inc"] ?><br>
<img src='images/dot_yellow.png'> - <?php echo $lang_label["openedcom_inc"] ?><br>
<img src='images/dot_blue.png'> - <?php echo $lang_label["rej_inc"] ?><br>
<img src='images/dot_green.png'> - <?php echo $lang_label["closed_inc"] ?><br>
<img src='images/dot_white.png'> - <?php echo $lang_label["exp_inc"] ?></td>
<h3><?php echo __('status') ?></h3>
<img src='images/dot_red.png'> - <?php echo __('opened_inc') ?><br>
<img src='images/dot_yellow.png'> - <?php echo __('openedcom_inc') ?><br>
<img src='images/dot_blue.png'> - <?php echo __('rej_inc') ?><br>
<img src='images/dot_green.png'> - <?php echo __('closed_inc') ?><br>
<img src='images/dot_white.png'> - <?php echo __('exp_inc') ?></td>
<td rowspan="5" class="f9" style="padding-left: 30px; vertical-align: top;">
<h3><?php echo $lang_label["priority"] ?></h3>
<img src='images/dot_red.png'><img src='images/dot_red.png'><img src='images/dot_red.png'> - <?php echo $lang_label["very_serious"] ?><br>
<img src='images/dot_yellow.png'><img src='images/dot_red.png'><img src='images/dot_red.png'> - <?php echo $lang_label["serious"] ?><br>
<img src='images/dot_yellow.png'><img src='images/dot_yellow.png'><img src='images/dot_red.png'> - <?php echo $lang_label["medium"] ?><br>
<img src='images/dot_green.png'><img src='images/dot_yellow.png'><img src='images/dot_yellow.png'> - <?php echo $lang_label["low"] ?><br>
<img src='images/dot_green.png'><img src='images/dot_green.png'><img src='images/dot_yellow.png'> - <?php echo $lang_label["informative"] ?><br>
<img src='images/dot_green.png'><img src='images/dot_green.png'><img src='images/dot_green.png'> - <?php echo $lang_label["maintenance"] ?><br>
<h3><?php echo __('priority') ?></h3>
<img src='images/dot_red.png'><img src='images/dot_red.png'><img src='images/dot_red.png'> - <?php echo __('very_serious') ?><br>
<img src='images/dot_yellow.png'><img src='images/dot_red.png'><img src='images/dot_red.png'> - <?php echo __('serious') ?><br>
<img src='images/dot_yellow.png'><img src='images/dot_yellow.png'><img src='images/dot_red.png'> - <?php echo __('medium') ?><br>
<img src='images/dot_green.png'><img src='images/dot_yellow.png'><img src='images/dot_yellow.png'> - <?php echo __('low') ?><br>
<img src='images/dot_green.png'><img src='images/dot_green.png'><img src='images/dot_yellow.png'> - <?php echo __('informative') ?><br>
<img src='images/dot_green.png'><img src='images/dot_green.png'><img src='images/dot_green.png'> - <?php echo __('maintenance') ?><br>
<tr><td>
<select name="prioridad" onChange="javascript:this.form.submit();" class="w155">
<?php
@ -257,26 +253,26 @@ if ((isset($_GET["prioridad"])) OR (isset($_GET["prioridad"]))){
$prioridad = $_POST["prioridad"];
echo "<option value=".$prioridad.">";
switch ($prioridad){
case -1: echo $lang_label["all"]." ".$lang_label["priority"]; break;
case 0: echo $lang_label["informative"]; break;
case 1: echo $lang_label["low"]; break;
case 2: echo $lang_label["medium"]; break;
case 3: echo $lang_label["serious"]; break;
case 4: echo $lang_label["very_serious"]; break;
case 10: echo $lang_label["maintenance"]; break;
case -1: echo __('all')." ".__('priority'); break;
case 0: echo __('informative'); break;
case 1: echo __('low'); break;
case 2: echo __('medium'); break;
case 3: echo __('serious'); break;
case 4: echo __('very_serious'); break;
case 10: echo __('maintenance'); break;
}
}
echo "<option value='-1'>".$lang_label["all"]." ".$lang_label["priority"]."</option>"; // al priorities (default)
echo '<option value="0">'.$lang_label["informative"]."</option>";
echo '<option value="1">'.$lang_label["low"]."</option>";
echo '<option value="2">'.$lang_label["medium"]."</option>";
echo '<option value="3">'.$lang_label["serious"]."</option>";
echo '<option value="4">'.$lang_label["very_serious"]."</option>";
echo '<option value="10">'.$lang_label["maintenance"]."</option>";
echo "<option value='-1'>".__('all')." ".__('priority')."</option>"; // al priorities (default)
echo '<option value="0">'.__('informative')."</option>";
echo '<option value="1">'.__('low')."</option>";
echo '<option value="2">'.__('medium')."</option>";
echo '<option value="3">'.__('serious')."</option>";
echo '<option value="4">'.__('very_serious')."</option>";
echo '<option value="10">'.__('maintenance')."</option>";
echo "</select></td>
<td valign='middle>
<noscript>
<input type='submit' class='sub' value='".$lang_label["show"]."' border='0'>
<input type='submit' class='sub' value='".__('show')."' border='0'>
</noscript>";
echo "</td>";
echo '<tr><td><select name="grupo" onChange="javascript:this.form.submit();" class="w155">';
@ -288,13 +284,13 @@ if ((isset($_GET["grupo"])) OR (isset($_GET["grupo"]))){
$grupo = $_POST["grupo"];
echo "<option value=".$grupo.">";
if ($grupo == -1) {
echo $lang_label["all"]." ".$lang_label["groups"]; // all groups (default)
echo __('all')." ".__('groups'); // all groups (default)
} else {
echo dame_nombre_grupo($grupo);
}
echo "</option>";
}
echo "<option value='-1'>".$lang_label["all"]." ".$lang_label["groups"]."</option>"; // all groups (default)
echo "<option value='-1'>".__('all')." ".__('groups')."</option>"; // all groups (default)
$sql2="SELECT * FROM tgrupo";
$result2=mysql_query($sql2);
while ($row2=mysql_fetch_array($result2)){
@ -303,7 +299,7 @@ while ($row2=mysql_fetch_array($result2)){
echo "</select></td>
<td valign='middle'>
<noscript><input type='submit' class='sub' value='".$lang_label["show"]."' border='0'></noscript>
<noscript><input type='submit' class='sub' value='".__('show')."' border='0'></noscript>
</td>";
// Pass search parameters for possible future filter searching by user
@ -326,11 +322,11 @@ $result2_count=mysql_query($sql1_count);
$row2_count = mysql_fetch_array($result2_count);
if ($row2_count[0] <= 0 ) {
echo '<div class="nf">'.$lang_label["no_incidents"].'</div><br></table>';
echo '<div class="nf">'.__('no_incidents').'</div><br></table>';
echo "<table>";
echo "<tr><td>";
echo "<form method='post' action='index.php?sec=incidencias&sec2=operation/incidents/incident_detail&insert_form'>";
echo "<input type='submit' class='sub next' name='crt' value='".$lang_label["create_incident"]."'></form>";
echo "<input type='submit' class='sub next' name='crt' value='".__('create_incident')."'></form>";
echo "</td></tr></table>";
} else {
// TOTAL incidents
@ -359,19 +355,19 @@ if ($row2_count[0] <= 0 ) {
echo "<table cellpadding='4' cellspacing='4' width='750' class='databox'>";
echo "<tr>";
echo "<th width='43'>ID</th>";
echo "<th>".$lang_label["status"]."</th>";
echo "<th >".$lang_label["incident"]."</th>";
echo "<th >".$lang_label["priority"]."</th>";
echo "<th>".$lang_label["group"]."</th>";
echo "<th>".$lang_label["updated_at"]."</th>";
echo "<th>".$lang_label["source"]."</th>";
echo "<th width='50'>".$lang_label["in_openedby"]."</th>";
echo "<th>".$lang_label["delete"]."</th>";
echo "<th>".__('status')."</th>";
echo "<th >".__('incident')."</th>";
echo "<th >".__('priority')."</th>";
echo "<th>".__('group')."</th>";
echo "<th>".__('updated_at')."</th>";
echo "<th>".__('source')."</th>";
echo "<th width='50'>".__('in_openedby')."</th>";
echo "<th>".__('delete')."</th>";
$color = 1;
while ($row2=mysql_fetch_array($result2)){
$id_group = $row2["id_grupo"];
if (give_acl($id_usuario, $id_group, "IR") ==1){
if (give_acl ($config['id_user'], $id_group, "IR")) {
if ($color == 1){
$tdcolor = "datos";
$color = 0;
@ -426,12 +422,12 @@ if ($row2_count[0] <= 0 ) {
case 10: echo "<img src='images/dot_green.png'>"."<img src='images/dot_green.png'>"."<img src='images/dot_green.png'>"; break;
}
/*
case 0: echo $lang_label["informative"]; break;
case 1: echo $lang_label["low"]; break;
case 2: echo $lang_label["medium"]; break;
case 3: echo $lang_label["serious"]; break;
case 4: echo $lang_label["very_serious"]; break;
case 10: echo $lang_label["maintenance"]; break;
case 0: echo __('informative'); break;
case 1: echo __('low'); break;
case 2: echo __('medium'); break;
case 3: echo __('serious'); break;
case 4: echo __('very_serious'); break;
case 10: echo __('maintenance'); break;
*/
echo "<td class='$tdcolor' align='center'>";
$id_grupo = $row2["id_grupo"];
@ -442,22 +438,22 @@ if ($row2_count[0] <= 0 ) {
echo "<td class='$tdcolor'>".$row2["origen"];
echo "<td class='$tdcolor'><a href='index.php?sec=usuario&sec2=operation/users/user_edit&ver=".$row2["id_usuario"]."'>".$row2["id_usuario"]."</td>";
$id_author_inc = $row2["id_usuario"];
if ((give_acl($id_usuario, $id_group, "IM") ==1) OR ($_SESSION["id_usuario"] == $id_author_inc) ){
if (give_acl ($config['id_user'], $id_group, "IM") || $config["id_user"] == $id_author_inc) {
// Only incident owners or incident manager
// from this group can delete incidents
echo "<td class='$tdcolor' align='center'><a href='index.php?sec=incidencias&sec2=operation/incidents/incident&quick_delete=".$row2["id_incidencia"]."' onClick='if (!confirm(\' ".$lang_label["are_you_sure"]."\')) return false;'><img src='images/cross.png' border='0'></a></td>";
echo "<td class='$tdcolor' align='center'><a href='index.php?sec=incidencias&sec2=operation/incidents/incident&quick_delete=".$row2["id_incidencia"]."' onClick='if (!confirm(\' ".__('are_you_sure')."\')) return false;'><img src='images/cross.png' border='0'></a></td>";
}
}
}
echo "</tr></table>";
if (give_acl($_SESSION["id_usuario"], 0, "IW")==1) {
if (give_acl ($config["id_user"], 0, "IW")) {
echo "<table width='750px'>";
echo "<tr><td align='right'>";
echo "<form method='post' action='index.php?sec=incidencias&sec2=operation/incidents/incident_detail&insert_form'>";
echo "<input type='submit' class='sub next' name='crt' value='".$lang_label["create_incident"]."'></form>";
echo "<input type='submit' class='sub next' name='crt' value='".__('create_incident')."'></form>";
}
echo "</td></tr></table>";
}
?>
?>

View File

@ -30,25 +30,18 @@
}
}
</script>
<?PHP
<?php
require("include/config.php");
if (comprueba_login() != 0) {
audit_db("Noauth",$REMOTE_ADDR, "No authenticated acces","Trying to access event viewer");
require ("general/noaccess.php");
exit;
}
check_login ();
if (isset($_GET["id_grupo"]))
$id_grupo = $_GET["id_grupo"];
else
$id_grupo = 0;
$id_grupo = get_parameter ('id_grupo');
$id_user=$_SESSION['id_usuario'];
if (give_acl($id_user, $id_grupo, "IR") != 1){
if (! give_acl ($config['id_user'], $id_grupo, "IR")) {
// Doesn't have access to this page
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access to incident ".$id_inc." '".$titulo."'");
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access to incident ".$id_inc." '".$titulo."'");
include ("general/noaccess.php");
exit;
}
@ -57,7 +50,7 @@ $id_grupo = "";
$creacion_incidente = "";
// EDITION MODE
if (isset($_GET["id"])){
if (isset ($_GET["id"])) {
$creacion_incidente = 0;
$id_inc = $_GET["id"];
$iduser_temp=$_SESSION['id_usuario'];
@ -84,14 +77,13 @@ if (isset($_GET["id"])){
$id_inc = entrada_limpia($_POST["id_inc"]);
$timestamp = entrada_limpia($_POST["timestamp"]);
$nota = entrada_limpia($_POST["nota"]);
$id_usuario=$_SESSION["id_usuario"];
$sql1 = "INSERT INTO tnota (id_usuario,timestamp,nota)
VALUES ('".$id_usuario."','".$timestamp."','".$nota."')";
VALUES ('".$config['id_user']."','".$timestamp."','".$nota."')";
$res1=mysql_query($sql1);
if ($res1) { echo "<h3 class='suc'>".$lang_label["create_note_ok"]."</h3>"; }
if ($res1) { echo "<h3 class='suc'>".__('create_note_ok')."</h3>"; }
$sql2 = "SELECT * FROM tnota WHERE id_usuario = '".$id_usuario."' AND timestamp = '".$timestamp."'";
$sql2 = "SELECT * FROM tnota WHERE id_usuario = '".$config['id_user']."' AND timestamp = '".$timestamp."'";
$res2=mysql_query($sql2);
$row2=mysql_fetch_array($res2);
$id_nota = $row2["id_nota"];
@ -116,7 +108,7 @@ if (isset($_GET["id"])){
mysql_query($query);
mysql_query($query2);
if (mysql_query($query)) {
echo "<h3 class='suc'>".$lang_label["del_note_ok"];
echo "<h3 class='suc'>".__('del_note_ok');
}
}
}
@ -154,7 +146,7 @@ if (isset($_GET["id"])){
$nombre_archivo = $config["attachment_store"]."attachment/pand".$id_attachment."_".$filename;
if (!(copy($_FILES['userfile']['tmp_name'], $nombre_archivo ))){
echo "<h3 class=error>".$lang_label["attach_error"]."</h3>";
echo "<h3 class=error>".__('attach_error')."</h3>";
$sql = " DELETE FROM tattachment WHERE id_attachment =".$id_attachment;
mysql_query($sql);
} else {
@ -189,7 +181,7 @@ elseif (isset($_GET["insert_form"])){
$id_creator = $iduser_temp;
$creacion_incidente = 1;
} else {
audit_db($id_user,$REMOTE_ADDR, "HACK","Trying to create incident in a unusual way");
audit_db($config['id_user'],$REMOTE_ADDR, "HACK","Trying to create incident in a unusual way");
no_permission();
}
@ -209,26 +201,26 @@ else
if (isset($id_inc)) {
echo "<input type='hidden' name='id_inc' value='".$id_inc."'>";
}
echo "<h2>".$lang_label["incident_manag"]." &gt; ";
echo "<h2>".__('incident_manag')." &gt; ";
if (isset($id_inc)) {
echo $lang_label["rev_incident"]." # ".$id_inc;
echo __('rev_incident')." # ".$id_inc;
} else {
echo $lang_label["create_incident"];
echo __('create_incident');
}
echo "</h2>";
echo '<table cellpadding="4" cellspacing="4" class="databox" width="600">';
if ((give_acl($iduser_temp, $id_grupo, "IM")==1) OR ($usuario == $iduser_temp)) {
echo '<tr><td class="datos"><b>'.$lang_label["incident"].'</b></td>
echo '<tr><td class="datos"><b>'.__('incident').'</b></td>
<td colspan=3 class="datos"><input type="text" name="titulo" size=70 value="'.$titulo.'">';
} else {
echo '<tr><td class="datos"><b>'.$lang_label["incident"].'</b><td colspan=3 class="datos"><input type="text" name="titulo" size=70 value="'.$titulo.'" readonly>';
echo '<tr><td class="datos"><b>'.__('incident').'</b><td colspan=3 class="datos"><input type="text" name="titulo" size=70 value="'.$titulo.'" readonly>';
}
echo '<tr><td class="datos2"><b>'.$lang_label["in_openedwhen"].'</b>';
echo '<tr><td class="datos2"><b>'.__('in_openedwhen').'</b>';
echo "<td class='datos2' <i>".$inicio."</i>";
echo '<td class="datos2"><b>'.$lang_label["updated_at"].'</b>';
echo '<td class="datos2"><b>'.__('updated_at').'</b>';
echo "<td class='datos2'><i>".$actualizacion."</i>";
echo '<tr><td class="datos"><b>'.$lang_label["in_openedby"].'</b><td class="datos">';
if ((give_acl($id_user, $id_grupo, "IM")==1) OR ($usuario == $id_user)) {
echo '<tr><td class="datos"><b>'.__('in_openedby').'</b><td class="datos">';
if ((give_acl($config['id_user'], $id_grupo, "IM")==1) OR ($usuario == $config['id_user'])) {
echo "<select name='usuario_form' width='200px'>";
echo "<option value='".$usuario."'>".$usuario." - ".dame_nombre_real($usuario)."</option>";
$sql1='SELECT * FROM tusuario ORDER BY id_usuario';
@ -250,37 +242,37 @@ else {
// 13 - Cerrada / Closed
if ((give_acl($iduser_temp, $id_grupo, "IM")==1) OR ($usuario == $iduser_temp)) {
echo '<td class="datos"><b>'.$lang_label["status"].'</b>
echo '<td class="datos"><b>'.__('status').'</b>
<td class="datos">
<select name="estado_form" class="w135">';
} else {
echo '<td class="datos"><b>'.$lang_label["status"].'</b>
echo '<td class="datos"><b>'.__('status').'</b>
<td class="datos">
<select disabled name="estado_form" class="w135">';
}
switch ( $estado ){
case 0: echo '<option value="0">'.$lang_label["in_state_0"]; break;
//case 1: echo '<option value="2">'.$lang_label["in_state_1"]; break;
case 2: echo '<option value="2">'.$lang_label["in_state_2"]; break;
case 3: echo '<option value="3">'.$lang_label["in_state_3"]; break;
case 13: echo '<option value="13">'.$lang_label["in_state_13"]; break;
case 0: echo '<option value="0">'.__('in_state_0'); break;
//case 1: echo '<option value="2">'.__('in_state_1'); break;
case 2: echo '<option value="2">'.__('in_state_2'); break;
case 3: echo '<option value="3">'.__('in_state_3'); break;
case 13: echo '<option value="13">'.__('in_state_13'); break;
}
echo '<option value="0">'.$lang_label["in_state_0"];
//echo '<option value="1">'.$lang_label["in_state_1"];
echo '<option value="2">'.$lang_label["in_state_2"];
echo '<option value="3">'.$lang_label["in_state_3"];
echo '<option value="13">'.$lang_label["in_state_13"];
echo '<option value="0">'.__('in_state_0');
//echo '<option value="1">'.__('in_state_1');
echo '<option value="2">'.__('in_state_2');
echo '<option value="3">'.__('in_state_3');
echo '<option value="13">'.__('in_state_13');
echo '</select></td>';
// Only owner could change source or user with Incident management privileges
if ((give_acl($iduser_temp, $id_grupo, "IM")==1) OR ($usuario == $iduser_temp)) {
echo '<tr><td class="datos2"><b>'.$lang_label["source"].'</b></td>
echo '<tr><td class="datos2"><b>'.__('source').'</b></td>
<td class="datos2">
<select name="origen_form" class="w135">';
} else {
echo '<tr><td class="datos2"><b>'.$lang_label["source"].'</b></td>
echo '<tr><td class="datos2"><b>'.__('source').'</b></td>
<td class="datos2">
<select disabled name="origen_form" class="w135">';
}
@ -296,11 +288,11 @@ echo "</select></td>";
// Group combo
if ((give_acl($iduser_temp, $id_grupo, "IM")==1) OR ($usuario == $iduser_temp)) {
echo '<td class="datos2"><b>'.$lang_label["group"].'</b></td>
echo '<td class="datos2"><b>'.__('group').'</b></td>
<td class="datos2">
<select name="grupo_form" class="w135">';
} else {
echo '<td class="datos2"><b>'.$lang_label["group"].'</b></td>
echo '<td class="datos2"><b>'.__('group').'</b></td>
<td class="datos2">
<select disabled name="grupo_form" class="w135">';
}
@ -315,28 +307,28 @@ while ($row=mysql_fetch_array($result)){
echo '</select></td></tr><tr>';
if ((give_acl($iduser_temp, $id_grupo, "IM")==1) OR ($usuario == $iduser_temp)) {
echo '<td class="datos"><b>'.$lang_label["priority"].'</b></td>
echo '<td class="datos"><b>'.__('priority').'</b></td>
<td class="datos"><select name="prioridad_form" class="w135">';
} else {
echo '<td class="datos"><b>'.$lang_label["priority"].'</b></td>
echo '<td class="datos"><b>'.__('priority').'</b></td>
<td class="datos"><select disabled name="prioridad_form" class="w135">';
}
switch ( $prioridad ){
case 0: echo '<option value="0">'.$lang_label["informative"].'</option>'; break;
case 1: echo '<option value="1">'.$lang_label["low"].'</option>'; break;
case 2: echo '<option value="2">'.$lang_label["medium"].'</option>'; break;
case 3: echo '<option value="3">'.$lang_label["serious"].'</option>'; break;
case 4: echo '<option value="4">'.$lang_label["very_serious"].'</option>'; break;
case 10: echo '<option value="10">'.$lang_label["maintenance"].'</option>'; break;
case 0: echo '<option value="0">'.__('informative').'</option>'; break;
case 1: echo '<option value="1">'.__('low').'</option>'; break;
case 2: echo '<option value="2">'.__('medium').'</option>'; break;
case 3: echo '<option value="3">'.__('serious').'</option>'; break;
case 4: echo '<option value="4">'.__('very_serious').'</option>'; break;
case 10: echo '<option value="10">'.__('maintenance').'</option>'; break;
}
echo '<option value="0">'.$lang_label["informative"].'</option>';
echo '<option value="1">'.$lang_label["low"].'</option>';
echo '<option value="2">'.$lang_label["medium"].'</option>';
echo '<option value="3">'.$lang_label["serious"].'</option>';
echo '<option value="4">'.$lang_label["very_serious"].'</option>';
echo '<option value="10">'.$lang_label["maintenance"].'</option>';
echo '<option value="0">'.__('informative').'</option>';
echo '<option value="1">'.__('low').'</option>';
echo '<option value="2">'.__('medium').'</option>';
echo '<option value="3">'.__('serious').'</option>';
echo '<option value="4">'.__('very_serious').'</option>';
echo '<option value="10">'.__('maintenance').'</option>';
echo "<td class='datos'><b>Creator</b>
<td class='datos'>".$id_creator." ( <i>".dame_nombre_real($id_creator)." </i>)";
@ -363,11 +355,11 @@ $iduser_temp=$_SESSION['id_usuario'];
if ($creacion_incidente == 0){
if ((give_acl($iduser_temp, $id_grupo, "IM")==1) OR ($usuario == $iduser_temp)){
echo '<input type="submit" class="sub upd" name="accion" value="'.$lang_label["in_modinc"].'" border="0">';
echo '<input type="submit" class="sub upd" name="accion" value="'.__('in_modinc').'" border="0">';
}
} else {
if (give_acl($iduser_temp, $id_grupo, "IW")) {
echo '<input type="submit" class="sub wand" name="accion" value="'.$lang_label["create"].'" border="0">';
echo '<input type="submit" class="sub wand" name="accion" value="'.__('create').'" border="0">';
}
}
echo "</form>";
@ -377,7 +369,7 @@ if ($creacion_incidente == 0){
echo '
<form method="post" action="index.php?sec=incidencias&sec2=operation/incidents/incident_note&id_inc='.$id_inc.'">
<input type="hidden" name="nota" value="add">
<input align=right name="addnote" type="submit" class="sub next" value="'.$lang_label["add_note"].'">
<input align=right name="addnote" type="submit" class="sub next" value="'.__('add_note').'">
</form>';
}
echo "</tr></table><br>";
@ -392,7 +384,7 @@ if ($creacion_incidente == 0){
$res4=mysql_query($sql4);
while ($row2=mysql_fetch_array($res4)){
if ($cabecera == 0) { // Show head only one time
echo "<h3>".$lang_label["in_notas_t1"]."</h3>";
echo "<h3>".__('in_notas_t1')."</h3>";
echo "<table cellpadding='4' cellspacing='4' class='databox' width='650'>";
echo "<tr><td>";
$cabecera = 1;
@ -405,9 +397,9 @@ if ($creacion_incidente == 0){
$nota = $row3["nota"];
$id_usuario_nota = $row3["id_usuario"];
// Show data
echo '<tr><td rowspan="3" class="top"><img src="images/page_white_text.png"></td><td class="datos" width=40><b>'.$lang_label["author"].': </b><td class="datos">';
echo '<tr><td rowspan="3" class="top"><img src="images/page_white_text.png"></td><td class="datos" width=40><b>'.__('author').': </b><td class="datos">';
$usuario = $id_usuario_nota;
$nombre_real = dame_nombre_real($usuario);
$nombre_real = dame_nombre_real ($usuario);
echo $usuario." - (<i><a href='index.php?sec=usuario&sec2=operation/users/user_edit&ver=".$usuario."'>".$nombre_real."</a></i>)";
// Delete comment, only for admins
@ -415,7 +407,7 @@ if ($creacion_incidente == 0){
$myurl="index.php?sec=incidencias&sec2=operation/incidents/incident_detail&id=".$id_inc."&id_nota=".$row2["id_nota"]."&id_nota_inc=".$row2["id_nota_inc"];
echo '<td rowspan="3" class="top" width="60" align="center"><a href="'.$myurl.'"><img src="images/cross.png" align="middle" border="0"></a>';
}
echo '<tr><td class="datos"><b>'.$lang_label["date"].': </b><td class="datos"><i>'.$timestamp.'</i></td></tr>';
echo '<tr><td class="datos"><b>'.__('date').': </b><td class="datos"><i>'.$timestamp.'</i></td></tr>';
echo '<tr><td colspan="2" class="datos"> ';
echo '<table border="0" cellpadding="4" cellspacing="4" style="width: 580px">';
echo '<tr><td class="datos2" align="justify">';
@ -437,13 +429,13 @@ if ($creacion_incidente == 0){
$att_fil=mysql_query("SELECT * FROM tattachment WHERE id_incidencia = ".$id_inc);
if (mysql_num_rows($att_fil)){
echo "<h3>".$lang_label["attached_files"]."</h3>";
echo "<h3>".__('attached_files')."</h3>";
echo "<table cellpadding='4' cellspacing='4' class='databox' width='650'>";
echo "<tr>
<th class=datos>".$lang_label["filename"]."</th>
<th class=datos>".$lang_label["description"]."</th>
<th class=datos>".$lang_label["size"]."</th>
<th class=datos>".$lang_label["delete"]."</th></tr>";
<th class=datos>".__('filename')."</th>
<th class=datos>".__('description')."</th>
<th class=datos>".__('size')."</th>
<th class=datos>".__('delete')."</th></tr>";
while ($row=mysql_fetch_array($att_fil)){
echo "<tr><td class=datos><img src='images/disk.png' border=0 align='top'> &nbsp;&nbsp;<a target='_new' href='attachment/pand".$row["id_attachment"]."_".$row["filename"]."'><b>".$row["filename"]."</b></a>";
@ -463,7 +455,7 @@ if ($creacion_incidente == 0){
// Upload control
if (give_acl($iduser_temp, $id_grupo, "IW")==1){
echo "<h3>".$lang_label["attachfile"];
echo "<h3>".__('attachfile');
?>
<A HREF="javascript:;" onmousedown="toggleDiv('file_control');">
<?PHP
@ -473,18 +465,18 @@ if ($creacion_incidente == 0){
echo '<table cellpadding="4" cellspacing="3" class="databox" width="400">
<tr>
<td class="datos">'.$lang_label["filename"].'</td>
<td class="datos">'.__('filename').'</td>
<td class="datos"><form method="post" action="index.php?sec=incidencias&sec2=operation/incidents/incident_detail&id='.$id_inc.'&upload_file=1" enctype="multipart/form-data">
<input type="file" name="userfile" value="userfile" class="sub" size="40">
</td></tr>
<tr><td class="datos2">'.$lang_label["description"].'</td>
<tr><td class="datos2">'.__('description').'</td>
<td class="datos2" colspan="3">
<input type="text" name="file_description" size="47">
</td></tr>
</table>
<table width="400px">
<tr><td style="text-align: right;">
<input type="submit" name="upload" value="'.$lang_label["upload"].'" class="sub wand">
<input type="submit" name="upload" value="'.__('upload').'" class="sub wand">
</td></tr></table><br>';
echo "</div>";
}

View File

@ -27,11 +27,11 @@ if (comprueba_login() == 0) {
$now=date("Y/m/d H:i:s");
// Create Note
echo "<h2>".$lang_label["incident_manag"]." &gt; ";
echo $lang_label["note_title"]." #".$id_inc."</h2>";
echo "<h2>".__('incident_manag')." &gt; ";
echo __('note_title')." #".$id_inc."</h2>";
echo "<table cellpadding='4' cellspacing='4' class='databox' width='550px'>
<form name='nota' method='post' action='index.php?sec=incidencias&sec2=operation/incidents/incident_detail&insertar_nota=1&id=".$id_inc."'>";
echo "<tr><td class='datos'><b>".$lang_label["date"]."</b>";
echo "<tr><td class='datos'><b>".__('date')."</b>";
echo "<td class='datos'>".$now."</td>";
echo "<input type='hidden' name='timestamp' value='".$now."'>";
echo "<input type='hidden' name='id_inc' value='".$id_inc."'>";
@ -40,7 +40,7 @@ if (comprueba_login() == 0) {
echo '</td></tr>';
echo '</table><table width="550">';
echo '<tr><td align="right">
<input name="addnote" type="submit" class="sub wand" value="'.$lang_label["add"].'">';
<input name="addnote" type="submit" class="sub wand" value="'.__('add').'">';
echo '</table>';
} // end page
} // end page

View File

@ -23,8 +23,8 @@ require("include/config.php");
if (comprueba_login() == 0) {
echo "<h2>".$lang_label["incident_manag"]." &gt; ";
echo $lang_label["find_crit"]."</h2>";
echo "<h2>".__('incident_manag')." &gt; ";
echo __('find_crit')."</h2>";
echo "<div style='width:645'>";
echo "<div style='float:right;'><img src='images/pulpo_lupa.png' class='bot' align='left'></div>";
?>
@ -32,10 +32,10 @@ echo "<div style='float:right;'><img src='images/pulpo_lupa.png' class='bot' ali
<table width="500" cellpadding="4" cellspacing="4" class='databox'>
<form name="busqueda" method="post" action="index.php?sec=incidencias&sec2=operation/incidents/incident">
<tr>
<td class="datos"><?php echo $lang_label["user"] ?>
<td class="datos"><?php echo __('user') ?>
<td class="datos">
<select name="usuario" class="w120">
<option value=""><?php echo $lang_label["all"] ?></option>
<option value=""><?php echo __('all') ?></option>
<?php
$sql1='SELECT * FROM tusuario ORDER BY id_usuario';
$result=mysql_query($sql1);
@ -44,13 +44,13 @@ echo "<div style='float:right;'><img src='images/pulpo_lupa.png' class='bot' ali
}
?>
</select>
<tr><td class="datos2"><?php echo $lang_label["free_text_search"] ?>
<tr><td class="datos2"><?php echo __('free_text_search') ?>
<td class="datos2"><input type="text" size="45" name="texto"></tr>
<tr><td class="datos" colspan="2"><i><?php echo $lang_label["free_text_search_msg"] ?></i></td></tr>
<tr><td class="datos" colspan="2"><i><?php echo __('free_text_search_msg') ?></i></td></tr>
</table>
<table width="500">
<tr><td align="right" colspan="3">
<?php echo "<input name='uptbutton' type='submit' class='sub search' value='".$lang_label["search"]."'>"; ?>
<?php echo "<input name='uptbutton' type='submit' class='sub search' value='".__('search')."'>"; ?>
</form>
</table>
@ -59,4 +59,4 @@ echo "<div style='float:right;'><img src='images/pulpo_lupa.png' class='bot' ali
<?php
} // end page
?>
?>

View File

@ -18,36 +18,36 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Load global vars
require("include/config.php");
if (comprueba_login() == 0) {
$iduser=$_SESSION['id_usuario'];
if (give_acl($id_user, 0, "IR")==1) {
echo "<h2>".$lang_label["incident_manag"]." &gt; ";
echo $lang_label["statistics"]."</h2>";
check_login ();
echo "<table width = 90%>";
echo "<tr><td valign='top'>";
echo '<h3>'.$lang_label["inc_stat_status"].'</h3>';
echo '<img src="reporting/fgraph.php?tipo=estado_incidente" border=0>';
echo "<td valign='top'>";
echo '<h3>'.$lang_label["inc_stat_priority"].'</h3>';
echo '<img src="reporting/fgraph.php?tipo=prioridad_incidente" border=0>';
echo "<tr><td>";
echo '<h3>'.$lang_label["inc_stat_group"].'</h3>';
echo '<img src="reporting/fgraph.php?tipo=group_incident" border=0>';
echo "<td>";
echo '<h3>'.$lang_label["inc_stat_user"].'</h3>';
echo '<img src="reporting/fgraph.php?tipo=user_incident" border=0>';
echo "<tr><td>";
echo '<h3>'.$lang_label["inc_stat_source"].'</h3>';
echo '<img src="reporting/fgraph.php?tipo=source_incident" border=0>';
echo "<td>";
echo "</table>";
} else {
require ("general/noaccess.php");
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Incident section");
}
if (! give_acl ($config['id_user'], 0, "IR")==1) {
require ("general/noaccess.php");
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access Incident section");
return;
}
?>
echo "<h2>".__('incident_manag')." &gt; ";
echo __('statistics')."</h2>";
echo "<table width = 90%>";
echo "<tr><td valign='top'>";
echo '<h3>'.__('inc_stat_status').'</h3>';
echo '<img src="reporting/fgraph.php?tipo=estado_incidente" border=0>';
echo "<td valign='top'>";
echo '<h3>'.__('inc_stat_priority').'</h3>';
echo '<img src="reporting/fgraph.php?tipo=prioridad_incidente" border=0>';
echo "<tr><td>";
echo '<h3>'.__('inc_stat_group').'</h3>';
echo '<img src="reporting/fgraph.php?tipo=group_incident" border=0>';
echo "<td>";
echo '<h3>'.__('inc_stat_user').'</h3>';
echo '<img src="reporting/fgraph.php?tipo=user_incident" border=0>';
echo "<tr><td>";
echo '<h3>'.__('inc_stat_source').'</h3>';
echo '<img src="reporting/fgraph.php?tipo=source_incident" border=0>';
echo "<td>";
echo "</table>";
?>

View File

@ -26,7 +26,7 @@ if (! isset ($config['id_user'])) {
}
?>
<div class="tit bg">:: <?= lang_string ('operation_header'); ?> ::</div>
<div class="tit bg">:: <?= __('operation_header'); ?> ::</div>
<div class="menu-operation" id="menu-operation">
<?php
$sec = get_parameter ('sec');
@ -40,7 +40,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
$selected = '';
}
echo '<div id="op1" class="operation-menu'.$selected.'">';
echo '<ul class="mn"><li><a href="index.php?sec=estado&amp;sec2=operation/agentes/tactical&amp;refr=60" class="mn">'.lang_string ("view_agents").'</a></li></ul></div>';
echo '<ul class="mn"><li><a href="index.php?sec=estado&amp;sec2=operation/agentes/tactical&amp;refr=60" class="mn">'.__('view_agents').'</a></li></ul></div>';
if ($sec == "estado") {
if ($sec2 == "operation/agentes/tactical") {
@ -48,49 +48,49 @@ if (give_acl ($config['id_user'], 0, "AR")) {
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=estado&amp;sec2=operation/agentes/tactical&refr=60' class='mn'>".lang_string ("tactical_view")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=estado&amp;sec2=operation/agentes/tactical&refr=60' class='mn'>".__('tactical_view')."</a></li></ul></div>";
if ($sec2 == "operation/agentes/estado_grupo") {
echo "<div class='operation-submenu submenu-selected'>";
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=estado&amp;sec2=operation/agentes/estado_grupo&refr=60' class='mn'>".lang_string ("group_view_menu")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=estado&amp;sec2=operation/agentes/estado_grupo&refr=60' class='mn'>".__('group_view_menu')."</a></li></ul></div>";
if ($sec2 == "operation/agentes/networkmap") {
echo "<div class='operation-submenu submenu-selected'>";
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=estado&amp;sec2=operation/agentes/networkmap' class='mn'>".lang_string("Network Map")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=estado&amp;sec2=operation/agentes/networkmap' class='mn'>".__('Network Map')."</a></li></ul></div>";
if (($sec2 == "operation/agentes/estado_agente" || $sec2 == "operation/agentes/ver_agente" || $sec2 == "operation/agentes/datos_agente")) {
echo "<div class='operation-submenu submenu-selected'>";
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=60' class='mn'>".lang_string ("agent_detail")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=60' class='mn'>".__('agent_detail')."</a></li></ul></div>";
if ($sec2 == "operation/agentes/estado_alertas"){
echo "<div class='operation-submenu submenu-selected'>";
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=estado&amp;sec2=operation/agentes/estado_alertas&amp;refr=60' class='mn'>".lang_string ("alert_detail")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=estado&amp;sec2=operation/agentes/estado_alertas&amp;refr=60' class='mn'>".__('alert_detail')."</a></li></ul></div>";
if ($sec2 == "operation/agentes/status_monitor") {
echo "<div class='operation-submenu submenu-selected'>";
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=estado&amp;sec2=operation/agentes/status_monitor&amp;refr=60' class='mn'>".lang_string ("detailed_monitoragent_state")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=estado&amp;sec2=operation/agentes/status_monitor&amp;refr=60' class='mn'>".__('detailed_monitoragent_state')."</a></li></ul></div>";
if ($sec2 == "operation/agentes/exportdata") {
echo "<div class='operation-submenu submenu-selected'>";
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=estado&amp;sec2=operation/agentes/exportdata' class='mn'>".lang_string ("export_data")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=estado&amp;sec2=operation/agentes/exportdata' class='mn'>".__('export_data')."</a></li></ul></div>";
}
@ -102,7 +102,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
}
echo '<div id="op9" class="operation-menu'.$selected.'">';
echo '<ul class="mn"><li>';
echo '<a href="index.php?sec=visualc&sec2=operation/visual_console/index" class="mn">'.lang_string ("visual_console").'</a></li></ul></div>';
echo '<a href="index.php?sec=visualc&sec2=operation/visual_console/index" class="mn">'.__('visual_console').'</a></li></ul></div>';
if ($sec == "visualc") {
$sql="SELECT * FROM tlayout ORDER BY name";
@ -127,7 +127,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
}
echo '<div id="op2" class="operation-menu'.$selected.'">';
echo '<ul class="mn"><li>';
echo '<a href="index.php?sec=estado_server&amp;sec2=operation/servers/view_server&amp;refr=60" class="mn">'.lang_string ("view_servers").'</a></li></ul></div>';
echo '<a href="index.php?sec=estado_server&amp;sec2=operation/servers/view_server&amp;refr=60" class="mn">'.__('view_servers').'</a></li></ul></div>';
}
@ -139,7 +139,7 @@ if (give_acl ($config['id_user'], 0, "IR") == 1) {
$selected = '';
}
echo '<div id="op3" class="operation-menu'.$selected.'">';
echo '<ul class="mn"><li><a href="index.php?sec=incidencias&amp;sec2=operation/incidents/incident" class="mn">'.lang_string ("manage_incidents").'</a></li></ul></div>';
echo '<ul class="mn"><li><a href="index.php?sec=incidencias&amp;sec2=operation/incidents/incident" class="mn">'.__('manage_incidents').'</a></li></ul></div>';
if ($sec == "incidencias"){
if($sec2 == "operation/incidents/incident_search") {
@ -147,14 +147,14 @@ if (give_acl ($config['id_user'], 0, "IR") == 1) {
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=incidencias&amp;sec2=operation/incidents/incident_search' class='mn'>".lang_string ("search_incident")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=incidencias&amp;sec2=operation/incidents/incident_search' class='mn'>".__('search_incident')."</a></li></ul></div>";
if ($sec2 == "operation/incidents/incident_statistics") {
echo "<div class='operation-submenu submenu-selected'>";
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=incidencias&amp;sec2=operation/incidents/incident_statistics' class='mn'>".lang_string ("statistics")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=incidencias&amp;sec2=operation/incidents/incident_statistics' class='mn'>".__('statistics')."</a></li></ul></div>";
}
}
@ -168,7 +168,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
$selected = '';
}
echo '<div id="op4" class="operation-menu'.$selected.'">';
echo '<ul class="mn"><li><a href="index.php?sec=eventos&amp;sec2=operation/events/events" class="mn">'.lang_string ("view_events").'</a></li></ul></div>';
echo '<ul class="mn"><li><a href="index.php?sec=eventos&amp;sec2=operation/events/events" class="mn">'.__('view_events').'</a></li></ul></div>';
// Event statistics submenu
if ($sec == "eventos"){
if($sec2 == "operation/events/event_statistics") {
@ -176,28 +176,28 @@ if (give_acl ($config['id_user'], 0, "AR")) {
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=eventos&amp;sec2=operation/events/event_statistics' class='mn'>".lang_string ("statistics")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=eventos&amp;sec2=operation/events/event_statistics' class='mn'>".__('statistics')."</a></li></ul></div>";
}
// Event RSS
if (isset($_GET["sec"]) && $_GET["sec"] == "eventos"){
echo "<div class='arrow'>";
echo "<ul class='mn'><li>";
echo "<a target='_top' href='operation/events/events_rss.php' class='mn'>".lang_string ("RSS")."</a></li></ul></div>";
echo "<a target='_top' href='operation/events/events_rss.php' class='mn'>".__('RSS')."</a></li></ul></div>";
}
// Event CSV
if (isset($_GET["sec"]) && $_GET["sec"] == "eventos"){
echo "<div class='arrow'>";
echo "<ul class='mn'><li>";
echo "<a target='_top' href='operation/events/events_csv.php' class='mn'>".lang_string ("CSV File")."</a></li></ul></div>";
echo "<a target='_top' href='operation/events/events_csv.php' class='mn'>".__('CSV File')."</a></li></ul></div>";
}
// Event Marquee
if (isset($_GET["sec"]) && $_GET["sec"] == "eventos"){
echo "<div class='arrow'>";
echo "<ul class='mn'><li>";
echo "<a target='_top' href='operation/events/events_marquee.php' class='mn'>".lang_string ("Marquee")."</a></li></ul></div>";
echo "<a target='_top' href='operation/events/events_marquee.php' class='mn'>".__('Marquee')."</a></li></ul></div>";
}
// Users
@ -207,7 +207,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
$selected = '';
}
echo '<div id="op5" class="operation-menu'.$selected.'">';
echo '<ul class="mn"><li><a href="index.php?sec=usuarios&amp;sec2=operation/users/user" class="mn">'.lang_string ("view_users").'</a></li></ul></div>';
echo '<ul class="mn"><li><a href="index.php?sec=usuarios&amp;sec2=operation/users/user" class="mn">'.__('view_users').'</a></li></ul></div>';
// User edit (submenu)
if ($sec == "usuarios") {
@ -216,7 +216,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=usuarios&amp;sec2=operation/users/user_edit&amp;ver=".$config['id_user']."' class='mn'>".lang_string ("index_myuser")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=usuarios&amp;sec2=operation/users/user_edit&amp;ver=".$config['id_user']."' class='mn'>".__('index_myuser')."</a></li></ul></div>";
// User statistics require UM
if (give_acl($config['id_user'], 0, "UM")==1) {
@ -225,7 +225,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=usuarios&amp;sec2=operation/users/user_statistics' class='mn'>".lang_string ("statistics")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=usuarios&amp;sec2=operation/users/user_statistics' class='mn'>".__('statistics')."</a></li></ul></div>";
}
}
@ -236,7 +236,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
$selected = '';
}
echo '<div id="op6" class="operation-menu'.$selected.'">';
echo '<ul class="mn"><li><a href="index.php?sec=snmpconsole&amp;sec2=operation/snmpconsole/snmp_view&amp;refr=30" class="mn">'.lang_string ("SNMP_console").'</a></li></ul></div>';
echo '<ul class="mn"><li><a href="index.php?sec=snmpconsole&amp;sec2=operation/snmpconsole/snmp_view&amp;refr=30" class="mn">'.__('SNMP_console').'</a></li></ul></div>';
if (give_acl($config['id_user'], 0, "AW")) {
// SNMP Console alert (submenu)
@ -246,7 +246,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=snmpconsole&amp;sec2=operation/snmpconsole/snmp_alert' class='mn'>".lang_string ("snmp_console_alert")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=snmpconsole&amp;sec2=operation/snmpconsole/snmp_alert' class='mn'>".__('snmp_console_alert')."</a></li></ul></div>";
}
}
@ -257,7 +257,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
$selected = '';
}
echo '<div id="op7" class="operation-menu'.$selected.'">';
echo '<ul class="mn"><li><a href="index.php?sec=messages&amp;sec2=operation/messages/message" class="mn">'. lang_string ("messages").'</a></li></ul></div>';
echo '<ul class="mn"><li><a href="index.php?sec=messages&amp;sec2=operation/messages/message" class="mn">'. __('messages').'</a></li></ul></div>';
// New message (submenu)
if ($sec == "messages") {
@ -266,7 +266,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=messages&amp;sec2=operation/messages/message&amp;nuevo_g' class='mn'>".lang_string ("messages_g")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=messages&amp;sec2=operation/messages/message&amp;nuevo_g' class='mn'>".__('messages_g')."</a></li></ul></div>";
}
// Reporting
@ -285,7 +285,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
echo '<li class="bb0">';
}
echo '<a href="index.php?sec=reporting&sec2=operation/reporting/custom_reporting" class="mn">'.
lang_string ("reporting").'</a></li></ul></div>';
__('reporting').'</a></li></ul></div>';
// Custom reporting
if ($sec == "reporting") {
@ -295,7 +295,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=reporting&sec2=operation/reporting/custom_reporting' class='mn'>".lang_string ("custom_reporting")."</a></li></ul></div>";
echo "<ul class='mn'><li><a href='index.php?sec=reporting&sec2=operation/reporting/custom_reporting' class='mn'>".__('custom_reporting')."</a></li></ul></div>";
}
// Custom graph viewer
@ -305,7 +305,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
} else {
echo "<div class='operation-submenu'>";
}
echo "<ul class='mn'><li class='bb0'><a href='index.php?sec=reporting&sec2=operation/reporting/graph_viewer' class='mn'>".lang_string ("custom_graphs")."</a></li></ul></div>";
echo "<ul class='mn'><li class='bb0'><a href='index.php?sec=reporting&sec2=operation/reporting/graph_viewer' class='mn'>".__('custom_graphs')."</a></li></ul></div>";
}
// Extensions menu additions
@ -317,7 +317,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
}
echo '<div id="op-extensions" class="operation-menu'.$selected.'">';
echo '<ul class="mn"><li><a href="index.php?sec=extensions&sec2=operation/extensions" class="mn">';
echo lang_string ('Extensions');
echo __('Extensions');
echo '</a></li></ul>';
echo "</div>";
if ($selected != '') {

View File

@ -20,15 +20,14 @@
// Load global vars
require_once ("include/config.php");
function create_message ($usuario_origen, $usuario_destino, $subject, $mensaje){
global $lang_label;
function create_message ($usuario_origen, $usuario_destino, $subject, $mensaje) {
$sql = sprintf ("INSERT INTO tmensajes (id_usuario_origen, id_usuario_destino, subject, mensaje, timestamp)
VALUES ('%s', '%s', '%s', '%s',NOW())",$usuario_origen,$usuario_destino,$subject,$mensaje);
(int) $result = process_sql ($sql);
if ($result == 1) {
echo '<h3 class="suc">'.$lang_label["message_ok"].'</h3>';
echo '<h3 class="suc">'.__('message_ok').'</h3>';
} else {
echo '<h3 class="error">'.$lang_label["message_no"].' - Dest: '.$usuario_destino.'</h3>';
echo '<h3 class="error">'.__('message_no').' - Dest: '.$usuario_destino.'</h3>';
}
}
@ -51,23 +50,23 @@ if (isset ($_GET["nuevo_mensaje_g"])){
$sql = sprintf ("SELECT id_usuario FROM tusuario_perfil WHERE id_grupo ='%d'",$dest_group);
$result = get_db_all_rows_sql ($sql);
if ($result === false) {
echo "<h3 class='error'>".$lang_label["message_no"]."</h3>";
echo "<h3 class='error'>".__('message_no')."</h3>";
} else {
foreach ($result as $row) {
create_message ($iduser, $row["id_usuario"], $subject, $message);
}
}
}
echo "<h2>".$lang_label["messages"]." &gt; ";
echo "<h2>".__('messages')." &gt; ";
if (isset ($_GET["nuevo"])) { //create message
echo $lang_label["new_message"].'</h2>';
echo __('new_message').'</h2>';
echo '<form name="new_mes" method="POST" action="index.php?sec=messages&sec2=operation/messages/message&nuevo_mensaje=1">
<table width="600" class="databox_color" cellpadding="4" cellspacing="4"><tr>
<td class="datos">'.$lang_label["m_from"].':</td>
<td class="datos">'.__('m_from').':</td>
<td class="datos"><b>'.$iduser.'</b></td>
</tr><tr>
<td class="datos2">'.$lang_label["m_to"].':</td>
<td class="datos2">'.__('m_to').':</td>
<td class="datos2">';
if (isset ($_POST["u_destino"])) {
echo '<b>'.$_POST["u_destino"].'</b><input type="hidden" name="u_destino" value='.$_POST["u_destino"].'>';
@ -88,26 +87,26 @@ if (isset ($_GET["nuevo"])) { //create message
}
echo '</select>';
}
echo '</td></tr><tr><td class="datos">'.$lang_label["subject"].':</td><td class="datos">';
echo '</td></tr><tr><td class="datos">'.__('subject').':</td><td class="datos">';
if (isset ($_POST["subject"])) {
echo '<input name="subject" value="'.get_parameter_post ("subject").'" size=70>';
} else {
echo '<input name="subject" size=60>';
}
echo '</td></tr><tr><td class="datos2">'.$lang_label["message"].':</td>
echo '</td></tr><tr><td class="datos2">'.__('message').':</td>
<td class="datos"><textarea name="mensaje" rows="15" cols="70">';
if (isset ($_POST["mensaje"])) {
echo get_parameter_post ("mensaje");
}
echo '</textarea></td></tr><tr><td></td><td colspan="3">
<input type="submit" class="sub wand" name="send_mes" value="'.$lang_label["send_mes"].'"></form></td></tr></table>';
<input type="submit" class="sub wand" name="send_mes" value="'.__('send_mes').'"></form></td></tr></table>';
} elseif (isset ($_GET["nuevo_g"])) {
echo $lang_label["new_message_g"].'</h2>';
echo __('new_message_g').'</h2>';
echo '<form name="new_mes" method="post" action="index.php?sec=messages&sec2=operation/messages/message&nuevo_mensaje_g=1">
<table width=600 class="databox_color" cellpadding=4 cellspacing=4>
<tr><td class="datos">'.$lang_label["m_from"].':</td>
<tr><td class="datos">'.__('m_from').':</td>
<td class="datos"><b>'.$iduser.'</b></td></tr>
<tr><td class="datos2">'.$lang_label["m_to"].':</td><td class="datos2">';
<tr><td class="datos2">'.__('m_to').':</td><td class="datos2">';
echo '<select name="g_destino" class="w130">';
$groups = get_user_groups ($iduser);
foreach ($groups as $id => $group) {
@ -125,11 +124,11 @@ if (isset ($_GET["nuevo"])) { //create message
echo '<option value="'.$row["id_grupo"].'">'.dame_nombre_grupo($row["id_grupo"]).'</option>';
}
echo '</select></td></tr>
<tr><td class="datos">'.$lang_label["subject"].':</td><td class="datos"><input name="subject" size="60"></td></tr><tr>
<td class="datos2">'.$lang_label["message"].':</td>
<tr><td class="datos">'.__('subject').':</td><td class="datos"><input name="subject" size="60"></td></tr><tr>
<td class="datos2">'.__('message').':</td>
<td class="datos"><textarea name="mensaje" rows="12" cols="60"></textarea></td>
</tr><tr><td></td><td colspan="3">
<input type="submit" class="sub wand" name="send_mes" value="'.$lang_label["send_mes"].'"></form></td></tr></table>';
<input type="submit" class="sub wand" name="send_mes" value="'.__('send_mes').'"></form></td></tr></table>';
} elseif (isset($_GET["leer"])) {
$id_mensaje = get_parameter_get("id_mensaje");
$sql = sprintf("SELECT id_usuario_origen, subject, mensaje FROM tmensajes WHERE id_usuario_destino='%s' AND id_mensaje=%d",$iduser,$id_mensaje);
@ -137,28 +136,28 @@ if (isset ($_GET["nuevo"])) { //create message
process_sql ("UPDATE tmensajes SET estado=1 WHERE id_mensaje".$result["id_mensaje"]);
echo '<table class="databox_color" width=650 cellpadding=4 cellspacing=4>
<form method="post" name="reply_mes" action="index.php?sec=messages&sec2=operation/messages/message&nuevo">
<tr><td class="datos">'.$lang_label["from"].':</td>
<tr><td class="datos">'.__('from').':</td>
<td class="datos"><b>'.$row["id_usuario_origen"].'</b></td></tr>';
// Subject
echo '<tr><td class="datos2">'.$lang_label["subject"].':</td>
echo '<tr><td class="datos2">'.__('subject').':</td>
<td class="datos2" valign="top"><b>'.$row["subject"].'</b></td></tr>';
// text
echo '<tr><td class="datos" valign="top">'.$lang_label["message"].':</td>
echo '<tr><td class="datos" valign="top">'.__('message').':</td>
<td class="datos"><textarea name="mensaje" rows="15" cols=70 readonly>'.$row["mensaje"].'</textarea></td></tr>
</table>
<input type="hidden" name="u_destino" value="'.$row["id_usuario_origen"].'">
<input type="hidden" name="subject" value="Re: '.$row["subject"].'">
<input type="hidden" name="mensaje" value="'.$row["id_usuario_origen"].$lang_label["wrote"].': '.$row["mensaje"].'">';
<input type="hidden" name="mensaje" value="'.$row["id_usuario_origen"].__('wrote').': '.$row["mensaje"].'">';
echo '<table width=650 cellpadding=4 cellspacing=4>';
echo "<tr><td align=right>";
echo '<input type="submit" class="sub next" name="send_mes" value="'.$lang_label["reply"].'">';
echo '<input type="submit" class="sub next" name="send_mes" value="'.__('reply').'">';
echo '</form>';
echo "</td></tr></table>";
}
if (isset ($_GET["leer"]) || (!isset ($_GET["nuevo"]) && !isset ($_GET["nuevo_g"]))) {
echo $lang_label["read_mes"]."</h2>";
echo __('read_mes')."</h2>";
//Delete messages if borrar is set
if (isset ($_GET["borrar"])){
@ -166,31 +165,31 @@ if (isset ($_GET["leer"]) || (!isset ($_GET["nuevo"]) && !isset ($_GET["nuevo_g"
$sql = sprintf ("DELETE FROM tmensajes WHERE id_usuario_destino='%s' AND id_mensaje=%d",$iduser,$id_message);
(int) $result = process_sql ($sql);
if ($result > 0) {
echo '<h3 class="suc">'.$lang_label["del_message_ok"].'</h3>';
echo '<h3 class="suc">'.__('del_message_ok').'</h3>';
} else {
echo '<h3 class="error">'.$lang_label["del_message_no"].'</h3>';
echo '<h3 class="error">'.__('del_message_no').'</h3>';
}
}
//Get number of messages
//Get number of messages
$sql = sprintf("SELECT COUNT(id_mensaje) FROM tmensajes WHERE id_usuario_destino='%s' AND estado=0",$iduser);
$num_messages = get_db_sql ($sql);
if ($num_messages > 0){
echo '<p>'.$lang_label["new_message_bra"].' <b>'.$num_messages.'</b> <img src="images/email.png">'.$lang_label["new_message_ket"].'</p>';
echo '<p>'.__('new_message_bra').' <b>'.$num_messages.'</b> <img src="images/email.png">'.__('new_message_ket').'</p>';
}
$sql = sprintf ("SELECT id_mensaje, id_usuario_origen, subject, timestamp, estado FROM tmensajes WHERE id_usuario_destino='%s' ORDER BY `timestamp` DESC",$iduser);
$result = get_db_all_rows_sql ($sql);
if ($result === false) {
echo "<div class='nf'>".$lang_label["no_messages"]."</div>";
echo "<div class='nf'>".__('no_messages')."</div>";
} else {
$color = 1;
echo '<table width="650" class="databox" cellpadding="4" cellspacing="4"><tr>
<th>'.$lang_label["read"].'</th>
<th>'.$lang_label["sender"].'</th>
<th>'.$lang_label["subject"].'</th>
<th>'.$lang_label["timestamp"].'</th>
<th>'.$lang_label["delete"].'</th></tr>';
<th>'.__('read').'</th>
<th>'.__('sender').'</th>
<th>'.__('subject').'</th>
<th>'.__('timestamp').'</th>
<th>'.__('delete').'</th></tr>';
foreach ($result as $row) {
if ($color == 1){
@ -212,7 +211,7 @@ if (isset ($_GET["leer"]) || (!isset ($_GET["nuevo"]) && !isset ($_GET["nuevo_g"
if ($row["subject"]) {
echo $row["subject"];
} else {
echo $lang_label["no_subject"];
echo __('no_subject');
}
echo '</b></a></td><td class="'.$tdcolor.'">'.$row["timestamp"].'</td>
<td class="'.$tdcolor.'" align="center"><a href="index.php?sec=messages&sec2=operation/messages/message&borrar=1&id_mensaje='.$row["id_mensaje"].'">
@ -223,6 +222,6 @@ if (isset ($_GET["leer"]) || (!isset ($_GET["nuevo"]) && !isset ($_GET["nuevo_g"
echo '<table width=650 cellpadding=4 cellspacing=4><tr>';
echo '<td>';
echo '<form method="post" name="new_mes" action="index.php?sec=messages&sec2=operation/messages/message&nuevo">
<input type="submit" class="sub next" name="send_mes" value="'.$lang_label["new_message"].'"></form></td></tr></table>';
}
<input type="submit" class="sub next" name="send_mes" value="'.__('new_message').'"></form></td></tr></table>';
}
?>

View File

@ -18,31 +18,26 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Login check
$id_usuario=$_SESSION["id_usuario"];
global $REMOTE_ADDR;
require ("include/config.php");
if (comprueba_login() != 0) {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access graph builder");
include ("general/noaccess.php");
exit;
}
check_login ();
echo "<h2>".lang_string ('reporting')." &gt; ";
echo lang_string ('custom_reporting')."</h2>";
echo "<h2>".__('reporting')." &gt; ";
echo __('custom_reporting')."</h2>";
$reports = get_reports ($config['id_user']);
if (sizeof ($reports) == 0) {
echo "<div class='nf'>".$lang_label["no_reporting_def"]."</div>";
echo "<div class='nf'>".__('no_reporting_def')."</div>";
return;
}
$table->width = '580px';
$table->head = array ();
$table->head[0] = lang_string ('report_name');
$table->head[1] = lang_string ('description');
$table->head[2] = lang_string ('HTML');
$table->head[3] = lang_string ('PDF');
$table->head[0] = __('report_name');
$table->head[1] = __('description');
$table->head[2] = __('HTML');
$table->head[3] = __('PDF');
$table->align = array ();
$table->align[2] = 'center';
$table->align[3] = 'center';

View File

@ -18,38 +18,31 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Login check
$id_usuario=$_SESSION["id_usuario"];
global $REMOTE_ADDR;
if (comprueba_login() != 0) {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access graph builder");
include ("general/noaccess.php");
exit;
}
check_login ();
// Delete module SQL code
if (isset($_GET["delete"])){
if ((give_acl($id_usuario,0,"AW") == 1 ) OR (dame_admin($id_user)==1)) {
if (isset($_GET["delete"])) {
if (! give_acl($config['id_user'], 0, "AW")) {
$id = $_GET["delete"];
$sql = "DELETE FROM tgraph_source WHERE id_graph = $id";
if ($res=mysql_query($sql))
$result = "<h3 class=suc>".$lang_label["delete_ok"]."</h3>";
$result = "<h3 class=suc>".__('delete_ok')."</h3>";
else
$result = "<h3 class=error>".$lang_label["delete_no"]."</h3>";
$result = "<h3 class=error>".__('delete_no')."</h3>";
$sql = "DELETE FROM tgraph WHERE id_graph = $id";
if ($res=mysql_query($sql))
$result = "<h3 class=suc>".$lang_label["delete_ok"]."</h3>";
$result = "<h3 class=suc>".__('delete_ok')."</h3>";
else
$result = "<h3 class=error>".$lang_label["delete_no"]."</h3>";
$result = "<h3 class=error>".__('delete_no')."</h3>";
echo $result;
} else {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to delete a graph from access graph builder");
audit_db ($config['id_user'],$REMOTE_ADDR, "ACL Violation","Trying to delete a graph from access graph builder");
include ("general/noaccess.php");
exit;
}
}
if (isset($_GET["view_graph"])){
$id_graph = $_GET["view_graph"];
$sql="SELECT * FROM tgraph WHERE id_graph = $id_graph";
@ -58,7 +51,7 @@ if (isset($_GET["view_graph"])){
$id_user = $row["id_user"];
$private = $row["private"];
$width = $row["width"];
$height = $row["height"];
$height = $row["height"];
$zoom = (int) get_parameter ('zoom', 0);
if ($zoom > 0){
switch ($zoom){
@ -67,13 +60,13 @@ if (isset($_GET["view_graph"])){
$height = 210;
break;
case 2:
$width = 650;
$height = 310;
break;
case 3:
$width = 770;
$height = 400;
break;
$width = 650;
$height = 310;
break;
case 3:
$width = 770;
$height = 400;
break;
}
}
$period = (int) get_parameter ('period');
@ -90,7 +83,7 @@ if (isset($_GET["view_graph"])){
$name = $row["name"];
if (($row["private"]==1) && ($row["id_user"] != $id_user)){
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access to a custom graph not allowed");
audit_db($config['id_user'],$REMOTE_ADDR, "ACL Violation","Trying to access to a custom graph not allowed");
include ("general/noaccess.php");
exit;
}
@ -111,8 +104,8 @@ if (isset($_GET["view_graph"])){
}
}
}
echo "<h2>".$lang_label["reporting"]." &gt; ";
echo $lang_label["combined_image"]."</h2>";
echo "<h2>".__('reporting')." &gt; ";
echo __('combined_image')."</h2>";
echo "<table class='databox_frame' cellpadding=0 cellspacing=0>";
echo "<tr><td>";
echo "<img
@ -123,45 +116,45 @@ border=1 alt=''>";
echo "<form method='POST' action='index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=$id_graph'>";
echo "<table class='databox_frame' cellpadding=4 cellspacing=4>";
echo "<tr><td class='datos'>";
echo "<b>".lang_string ('period')."</b>";
echo "<b>".__('period')."</b>";
echo "<td class='datos'>";
$periods = array ();
$periods[1] = lang_string ('hour');
$periods[2] = '2 '.lang_string ('hours');
$periods[3] = '3 '.lang_string ('hours');
$periods[6] = '6 '.lang_string ('hours');
$periods[12] = '12 '.lang_string ('hours');
$periods[24] = lang_string ('last_day');
$periods[48] = lang_string ('two_days');
$periods[360] = lang_string ('last_week');
$periods[720] = lang_string ('last_month');
$periods[4320] = lang_string ('six_months');
$periods[1] = __('hour');
$periods[2] = '2 '.__('hours');
$periods[3] = '3 '.__('hours');
$periods[6] = '6 '.__('hours');
$periods[12] = '12 '.__('hours');
$periods[24] = __('last_day');
$periods[48] = __('two_days');
$periods[360] = __('last_week');
$periods[720] = __('last_month');
$periods[4320] = __('six_months');
print_select ($periods, 'period', intval ($period / 3600), '', '', 0);
echo "<td class='datos'>";
$stackeds = array ();
$stackeds[0] = lang_string ('Graph defined');
$stackeds[0] = lang_string ('Area');
$stackeds[1] = lang_string ('Stacked area');
$stackeds[2] = lang_string ('Line');
$stackeds[0] = __('Graph defined');
$stackeds[0] = __('Area');
$stackeds[1] = __('Stacked area');
$stackeds[2] = __('Line');
print_select ($stackeds, 'stacked', $stacked , '', '', -1, false, false);
echo "<td class='datos'>";
$zooms = array();
$zooms[0] = lang_string ('Graph defined');
$zooms[1] = lang_string ('Zoom x1');
$zooms[2] = lang_string ('Zoom x2');
$zooms[3] = lang_string ('Zoom x3');
$zooms[0] = __('Graph defined');
$zooms[1] = __('Zoom x1');
$zooms[2] = __('Zoom x2');
$zooms[3] = __('Zoom x3');
print_select ($zooms, 'zoom', $zoom , '', '', 0);
echo "<td class='datos'>";
echo "<input type=submit value='".$lang_label["update"]."' class='sub upd'>";
echo "<input type=submit value='".__('update')."' class='sub upd'>";
echo "</table>";
echo "</form>";
}
}
echo "<h2>" . lang_string ("reporting") . " &gt; ";
echo lang_string ("custom_graph_viewer") . "</h2>";
echo "<h2>" . __('reporting') . " &gt; ";
echo __('custom_graph_viewer') . "</h2>";
$color=1;
$sql="SELECT * FROM tgraph ORDER by name";
@ -169,11 +162,11 @@ $res=mysql_query($sql);
if (mysql_num_rows($res)) {
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox_frame'>";
echo "<tr>
<th>".$lang_label["graph_name"]."</th>
<th>".$lang_label["description"]."</th>
<th>".$lang_label["view"]."</th>";
if ((give_acl($id_usuario,0,"AW") == 1 ) OR (dame_admin($id_usuario)==1))
echo "<th>".$lang_label["delete"]."</th>";
<th>".__('graph_name')."</th>
<th>".__('description')."</th>
<th>".__('view')."</th>";
if (give_acl ($config['id_user'], 0, "AW"))
echo "<th>".__('delete')."</th>";
echo "</tr>";
while ($row = mysql_fetch_array($res)){
@ -193,15 +186,15 @@ if (mysql_num_rows($res)) {
$id_graph = $row["id_graph"];
echo "<td valign='middle' class='$tdcolor' align='center'><a href='index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=$id_graph'><img src='images/images.png'></a>";
if ((give_acl($id_usuario,0,"AW") == 1 ) OR (dame_admin($id_usuario)==1)) {
echo "<td class='$tdcolor' align='center'><a href='index.php?sec=reporting&sec2=operation/reporting/graph_viewer&delete=$id_graph' ".'onClick="if (!confirm(\' '.$lang_label["are_you_sure"].'\')) return false;">';
if (give_acl ($config['id_user'], 0, "AW")) {
echo "<td class='$tdcolor' align='center'><a href='index.php?sec=reporting&sec2=operation/reporting/graph_viewer&delete=$id_graph' ".'onClick="if (!confirm(\' '.__('are_you_sure').'\')) return false;">';
echo "<img src='images/cross.png'></a></td>";
}
}
}
echo "</table>";
} else {
echo "<div class='nf'>".$lang_label["no_reporting_def"]."</div>";
echo "<div class='nf'>".__('no_reporting_def')."</div>";
}
?>

Some files were not shown because too many files have changed in this diff Show More