2006-03-27 05:37:27 +02:00
|
|
|
<?php
|
2007-03-02 18:56:07 +01:00
|
|
|
// Pandora FMS - the Free monitoring system
|
|
|
|
// ========================================
|
2007-03-12 18:58:52 +01:00
|
|
|
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
|
|
|
|
// Main PHP/SQL code development and project architecture and management
|
2007-03-02 18:56:07 +01:00
|
|
|
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
|
2007-03-12 18:58:52 +01:00
|
|
|
// CSS and some PHP additions
|
2007-03-02 18:56:07 +01:00
|
|
|
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
|
2007-03-12 18:58:52 +01:00
|
|
|
// Javascript Active Console code.
|
|
|
|
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
|
|
|
|
// Additions to Pandora FMS 1.2 graph code and new XML reporting template management
|
|
|
|
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es
|
|
|
|
//
|
2006-07-11 13:02:20 +02:00
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
2007-03-12 18:58:52 +01:00
|
|
|
// as published by the Free Software Foundation; version 2
|
2006-07-11 13:02:20 +02:00
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
// 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
|
2006-03-27 05:37:27 +02:00
|
|
|
require("include/config.php");
|
2006-07-11 13:02:20 +02:00
|
|
|
|
2006-03-27 05:37:27 +02:00
|
|
|
if (comprueba_login() == 0) {
|
|
|
|
if (isset($_GET["id_agente"])){
|
|
|
|
$id_agente = $_GET["id_agente"];
|
|
|
|
// 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=$_SESSION["id_usuario"];
|
|
|
|
if (give_acl($id_usuario, $id_grupo, "AR")==1){
|
|
|
|
// Get the user who makes this request
|
|
|
|
$id_usuario = $_SESSION["id_usuario"];
|
|
|
|
// 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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (give_acl($id_usuario,$id_grupo, "AR") == 1){
|
2007-03-12 18:58:52 +01:00
|
|
|
|
|
|
|
echo "<div id='menu_tab_left'>
|
2007-05-27 04:55:55 +02:00
|
|
|
<ul class='mn'>
|
|
|
|
<li class='view'>
|
2007-08-28 15:33:54 +02:00
|
|
|
<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='images/bricks.png' class='top' border=0> ".substr(dame_nombre_agente($id_agente),0,15)." - ".$lang_label["view_mode"]."</a>";
|
2007-03-12 18:58:52 +01:00
|
|
|
echo "</li>";
|
|
|
|
echo "</ul></div>";
|
|
|
|
|
|
|
|
|
2007-02-22 20:48:12 +01:00
|
|
|
if (isset($_GET["tab"]))
|
|
|
|
$tab = $_GET["tab"];
|
|
|
|
else
|
|
|
|
$tab = "main";
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "<div id='menu_tab'><ul class='mn'>";
|
2007-03-02 18:56:07 +01:00
|
|
|
if (give_acl($id_usuario,$id_grupo, "AW") == 1){
|
|
|
|
// Manage agent
|
2007-05-27 04:55:55 +02:00
|
|
|
echo "<li class='nomn'><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>";
|
2007-03-02 18:56:07 +01:00
|
|
|
echo "</li>";
|
|
|
|
}
|
|
|
|
// Main view
|
|
|
|
echo "<li class='nomn'>";
|
2007-03-28 18:07:29 +02:00
|
|
|
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>";
|
2007-03-02 18:56:07 +01:00
|
|
|
echo "</li>";
|
|
|
|
|
|
|
|
// Data
|
|
|
|
echo "<li class='nomn'>";
|
2007-03-28 18:07:29 +02:00
|
|
|
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>";
|
2007-02-27 20:03:56 +01:00
|
|
|
echo "</li>";
|
2007-03-02 18:56:07 +01:00
|
|
|
|
|
|
|
// Alerts
|
2007-02-27 20:03:56 +01:00
|
|
|
echo "<li class='nomn'>";
|
2007-04-18 23:45:03 +02:00
|
|
|
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>";
|
2007-02-27 20:03:56 +01:00
|
|
|
echo "</li>";
|
2007-03-02 18:56:07 +01:00
|
|
|
|
|
|
|
// Go to group view
|
2007-02-27 20:03:56 +01:00
|
|
|
echo "<li class='nomn'>";
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "<a href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=$id_grupo&refr=60'><img src='images/images.png' class='top' border=0> ".$lang_label["group_view_tab"]." </a>";
|
2007-02-27 20:03:56 +01:00
|
|
|
echo "</li>";
|
2007-03-02 18:56:07 +01:00
|
|
|
|
2007-02-27 20:03:56 +01:00
|
|
|
echo "</ul>";
|
|
|
|
echo "</div>";
|
2007-03-02 18:56:07 +01:00
|
|
|
echo "<div style='height: 25px'> </div>";
|
2007-02-22 20:48:12 +01:00
|
|
|
switch ($tab) {
|
2007-03-02 18:56:07 +01:00
|
|
|
/* http://pandora.localhost/index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=600 */
|
|
|
|
case "manage": require "estado_generalagente.php";
|
2007-03-19 20:39:40 +01:00
|
|
|
break;
|
2007-03-02 18:56:07 +01:00
|
|
|
|
2007-02-27 20:03:56 +01:00
|
|
|
case "main": require "estado_generalagente.php";
|
2007-03-12 18:58:52 +01:00
|
|
|
require "estado_monitores.php";
|
2007-05-21 15:24:17 +02:00
|
|
|
require "estado_alertas.php";
|
2007-02-22 20:48:12 +01:00
|
|
|
break;
|
2007-03-19 20:39:40 +01:00
|
|
|
|
2007-02-27 20:03:56 +01:00
|
|
|
case "data": require "estado_ultimopaquete.php";
|
2007-02-22 20:48:12 +01:00
|
|
|
break;
|
2007-03-19 20:39:40 +01:00
|
|
|
|
2007-02-27 20:03:56 +01:00
|
|
|
case "alert": require "estado_alertas.php";
|
2007-02-22 20:48:12 +01:00
|
|
|
break;
|
|
|
|
}
|
2006-03-27 05:37:27 +02:00
|
|
|
} else {
|
|
|
|
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to read data from agent ".dame_nombre_agente($id_agente));
|
|
|
|
require ("general/noaccess.php");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access (read) to agent ".dame_nombre_agente($id_agente));
|
|
|
|
include ("general/noaccess.php");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-03-28 18:07:29 +02:00
|
|
|
?>
|