mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-25 10:59:15 +02:00
2006-12-15 Esteban Sanchez <estebans@artica.es>
* operation/agentes/estado_grupo.php: Huge style correction. There is too much work left. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@322 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
99b25df07d
commit
80bccca21d
@ -1,3 +1,8 @@
|
|||||||
|
2006-12-15 Esteban Sanchez <estebans@artica.es>
|
||||||
|
|
||||||
|
* operation/agentes/estado_grupo.php: Huge style correction. There is
|
||||||
|
too much work left.
|
||||||
|
|
||||||
2006-12-14 Raul Mateos <raulofpandora@gmail.com>
|
2006-12-14 Raul Mateos <raulofpandora@gmail.com>
|
||||||
|
|
||||||
* operation/messages/message.php: Updated style for not found items.
|
* operation/messages/message.php: Updated style for not found items.
|
||||||
|
@ -21,12 +21,12 @@ echo "<div class='jus'>";
|
|||||||
$nick = $_SESSION['id_usuario'];
|
$nick = $_SESSION['id_usuario'];
|
||||||
echo "<h1>" . $lang_label["welcome_title"] . "</h1>";
|
echo "<h1>" . $lang_label["welcome_title"] . "</h1>";
|
||||||
echo $lang_label["main_text"];
|
echo $lang_label["main_text"];
|
||||||
echo "<br><br>";
|
echo "<br /><br />";
|
||||||
echo $lang_label["has_connected"] . " <b>" . $nick . "</b> - ";
|
echo $lang_label["has_connected"] . " <b>" . $nick . "</b> - ";
|
||||||
|
|
||||||
if (dame_admin ($nick) == 1) {
|
if (dame_admin ($nick) == 1) {
|
||||||
echo $lang_label["administrator"] . '. ';
|
echo $lang_label["administrator"] . '. ';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
echo $lang_label["normal_user"] . '. ';
|
echo $lang_label["normal_user"] . '. ';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,18 +47,19 @@ $query1="SELECT * FROM tsesion WHERE (TO_DAYS(fecha) > TO_DAYS(NOW()) -7) AND ID
|
|||||||
$result = mysql_query ($query1);
|
$result = mysql_query ($query1);
|
||||||
$contador = 5; // Max items
|
$contador = 5; // Max items
|
||||||
$color = 1;
|
$color = 1;
|
||||||
while (($row=mysql_fetch_array($result)) and ($contador > 0))
|
while (($row = mysql_fetch_array ($result)) and ($contador > 0)) {
|
||||||
{
|
|
||||||
if ($color == 1){
|
if ($color == 1){
|
||||||
$tdcolor = "datos";
|
$tdcolor = "datos";
|
||||||
$color = 0;
|
$color = 0;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$tdcolor = "datos2";
|
$tdcolor = "datos2";
|
||||||
$color = 1;
|
$color = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$usuario = $row["ID_usuario"];
|
$usuario = $row["ID_usuario"];
|
||||||
echo '<tr><td class="'.$tdcolor.'"><b class="'.$tdcolor.'f9">'.$usuario."</b>";
|
echo '<tr><td class="' . $tdcolor . '">';
|
||||||
|
echo '"<b class="' . $tdcolor . 'f9">' . $usuario . '</b>';
|
||||||
echo '<td class="' . $tdcolor . 'f9">';
|
echo '<td class="' . $tdcolor . 'f9">';
|
||||||
echo $row["accion"];
|
echo $row["accion"];
|
||||||
echo '<td class="' . $tdcolor . 'f9">';
|
echo '<td class="' . $tdcolor . 'f9">';
|
||||||
@ -68,6 +69,7 @@ $query1="SELECT * FROM tsesion WHERE (TO_DAYS(fecha) > TO_DAYS(NOW()) -7) AND ID
|
|||||||
echo '<td class="' . $tdcolor . 'f9">';
|
echo '<td class="' . $tdcolor . 'f9">';
|
||||||
echo $row["descripcion"];
|
echo $row["descripcion"];
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
|
|
||||||
$contador--;
|
$contador--;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,44 +79,48 @@ $query1="SELECT * FROM tsesion WHERE (TO_DAYS(fecha) > TO_DAYS(NOW()) -7) AND ID
|
|||||||
$resultado = mysql_query ($sql);
|
$resultado = mysql_query ($sql);
|
||||||
$row = mysql_fetch_array ($resultado);
|
$row = mysql_fetch_array ($resultado);
|
||||||
if ($row["COUNT(*)"] != 0){
|
if ($row["COUNT(*)"] != 0){
|
||||||
echo "<div style='margin-left: 8px'>".$lang_label["new_message_bra"]."<b><a href='index.php?sec=messages&sec2=operation/messages/message'>". $row["COUNT(*)"] . "</b> <img src='images/mail.gif' border='0'></a>".$lang_label["new_message_ket"]."</div>";
|
|
||||||
|
echo '<div style="margin-left: 8px">' . $lang_label["new_message_bra"];
|
||||||
|
echo '<b><a href="index.php?sec=messages&sec2=operation/messages/message">';
|
||||||
|
echo $row["COUNT(*)"] . '</b> <img src="images/mail.gif" border="0"></a>';
|
||||||
|
echo $lang_label["new_message_ket"] . '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<h2>".$lang_label["stat_title"]."</h2>";
|
echo '<h2>' . $lang_label["stat_title"] . '</h2>';
|
||||||
|
|
||||||
$query1 = "SELECT COUNT(*) FROM tusuario";
|
$query1 = "SELECT COUNT(*) FROM tusuario";
|
||||||
$result = mysql_query ($query1);
|
$result = mysql_query ($query1);
|
||||||
$row = mysql_fetch_array ($result);
|
$row = mysql_fetch_array ($result);
|
||||||
echo "<img src='images/usuarios.gif' align='middle' alt=''> ";
|
echo '<img src="images/usuarios.gif" align="middle" alt=""> ';
|
||||||
echo $lang_label["there_are"].$row[0]." ".$lang_label["user_defined"];
|
echo $lang_label["there_are"] . $row[0] . ' ' . $lang_label["user_defined"];
|
||||||
echo "<br><br>";
|
echo '<br /><br />';
|
||||||
|
|
||||||
$query1 = "SELECT COUNT(*) FROM tagente";
|
$query1 = "SELECT COUNT(*) FROM tagente";
|
||||||
$result = mysql_query ($query1);
|
$result = mysql_query ($query1);
|
||||||
$row = mysql_fetch_array ($result);
|
$row = mysql_fetch_array ($result);
|
||||||
echo "<img src='images/agentes.gif' align='middle' alt=''> ";
|
echo '<img src="images/agentes.gif" align="middle" alt=""> ';
|
||||||
echo $lang_label["there_are"].$row[0]." ".$lang_label["agent_defined"];
|
echo $lang_label["there_are"] . $row[0] .' ' . $lang_label["agent_defined"];
|
||||||
echo "<br><br>";
|
echo '<br /><br />';
|
||||||
|
|
||||||
$query1 = "SELECT COUNT(id_agente_datos) FROM tagente_datos";
|
$query1 = "SELECT COUNT(id_agente_datos) FROM tagente_datos";
|
||||||
$result = mysql_query ($query1);
|
$result = mysql_query ($query1);
|
||||||
$row = mysql_fetch_array ($result);
|
$row = mysql_fetch_array ($result);
|
||||||
echo "<img src='images/datos.gif' align='middle' alt=''> ";
|
echo '<img src="images/datos.gif" align="middle" alt=""> ';
|
||||||
echo $lang_label["there_are"].$row[0]." ".$lang_label["data_harvested"];
|
echo $lang_label["there_are"] . $row[0] . ' ' . $lang_label["data_harvested"];
|
||||||
echo "<br><br>";
|
echo '<br /><br />';
|
||||||
|
|
||||||
$query1 = "SELECT COUNT(*) FROM talerta_agente_modulo";
|
$query1 = "SELECT COUNT(*) FROM talerta_agente_modulo";
|
||||||
$result = mysql_query ($query1);
|
$result = mysql_query ($query1);
|
||||||
$row = mysql_fetch_array ($result);
|
$row = mysql_fetch_array ($result);
|
||||||
echo "<img src='images/alertas.gif' align='middle' alt=''> ";
|
echo '<img src="images/alertas.gif" align="middle" alt=""> ';
|
||||||
echo $lang_label["there_are"].$row[0]." ".$lang_label["alert_defined"];
|
echo $lang_label["there_are"] . $row[0] .' ' . $lang_label["alert_defined"];
|
||||||
echo "<br><br>";
|
echo '<br /><br />';
|
||||||
|
|
||||||
$query1 = "SELECT * FROM tagente_estado ORDER BY timestamp DESC";
|
$query1 = "SELECT * FROM tagente_estado ORDER BY timestamp DESC";
|
||||||
$result = mysql_query($query1);
|
$result = mysql_query($query1);
|
||||||
$row = mysql_fetch_array($result);
|
$row = mysql_fetch_array($result);
|
||||||
// Take the first element only
|
// Take the first element only
|
||||||
echo "<img src='images/time.gif' align='middle' alt=''> ";
|
echo '<img src="images/time.gif" align="middle" alt=""> ';
|
||||||
echo $lang_label["data_timestamp"] . $row["timestamp"];
|
echo $lang_label["data_timestamp"] . $row["timestamp"];
|
||||||
echo "</div>";
|
echo '</div>';
|
||||||
?>
|
?>
|
@ -13,19 +13,23 @@
|
|||||||
require ("operation/menu.php");
|
require ("operation/menu.php");
|
||||||
if (! isset ($_SESSION["id_usuario"])) {
|
if (! isset ($_SESSION["id_usuario"])) {
|
||||||
echo '<div class="f10">' . $lang_label["not_connected"];
|
echo '<div class="f10">' . $lang_label["not_connected"];
|
||||||
echo '<br><br>';
|
echo '<br /><br />';
|
||||||
echo '<form method="post" action="index.php?login=1">
|
echo '<form method="post" action="index.php?login=1">';
|
||||||
<div class="f9b">Login</div><input class="login" type="text" name="nick">
|
echo '<div class="f9b">Login</div><input class="login" type="text" name="nick">';
|
||||||
<div class="f9b">Password</div><input class="login" type="password" name="pass">
|
echo '<div class="f9b">Password</div><input class="login" type="password" name="pass">';
|
||||||
<div><input name="login" type="submit" class="sub" value="'.$lang_label["login"].'"></div>
|
echo '<div><input name="login" type="submit" class="sub" value="' . $lang_label["login"] .'"></div>';
|
||||||
<br>IP: <b class="f10">'.$REMOTE_ADDR.'</b><br></div>';
|
echo '<br />IP: <b class="f10">' . $REMOTE_ADDR . '</b><br /></div>';
|
||||||
}
|
|
||||||
else {
|
} else {
|
||||||
|
|
||||||
$iduser = $_SESSION['id_usuario'];
|
$iduser = $_SESSION['id_usuario'];
|
||||||
require ("godmode/menu.php");
|
require ("godmode/menu.php");
|
||||||
echo '<div class="w155f10"><form method="post" action="index.php?logoff=1"><input type="hidden" name="bye" value="bye"><input name="logoff" type="submit" class="sub" value="'.$lang_label["logout"].'"></form>'
|
echo '<div class="w155f10"><form method="post" action="index.php?logoff=1">';
|
||||||
.$lang_label["has_connected"].' <br>[<b class="f10">'.$iduser.'</b>]<br>';
|
echo '<input type="hidden" name="bye" value="bye">';
|
||||||
echo "<br>IP: <b class='f10'>".$REMOTE_ADDR."</b><br></div><div> </div>";
|
echo '<input name="logoff" type="submit" class="sub" value="' . $lang_label["logout"] . '">';
|
||||||
|
echo '</form>' . $lang_label["has_connected"] . '<br />';
|
||||||
|
echo '[<b class="f10">' . $iduser . '</b>]<br />';
|
||||||
|
echo "<br />IP: <b class='f10'>" . $REMOTE_ADDR . "</b><br /></div><div> </div>";
|
||||||
require ("links_menu.php");
|
require ("links_menu.php");
|
||||||
}
|
}
|
||||||
?>
|
?>
|
@ -36,8 +36,7 @@ if (isset ($_GET["refr"])){
|
|||||||
$ag_group = $_POST["ag_group"];
|
$ag_group = $_POST["ag_group"];
|
||||||
$query = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] . '&ag_group_refresh=' . $ag_group;
|
$query = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] . '&ag_group_refresh=' . $ag_group;
|
||||||
echo '<meta http-equiv="refresh" content="' . $intervalo . '; URL=' . $query . '">';
|
echo '<meta http-equiv="refresh" content="' . $intervalo . '; URL=' . $query . '">';
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
echo '<meta http-equiv="refresh" content="' . $intervalo . '">';
|
echo '<meta http-equiv="refresh" content="' . $intervalo . '">';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -56,22 +55,28 @@ if (isset ($_GET["refr"])){
|
|||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
// Show custom background
|
// Show custom background
|
||||||
echo "<body background='images/backgrounds/$config_bgimage'>";
|
echo '<body background="images/backgrounds/' . $config_bgimage . '">';
|
||||||
$REMOTE_ADDR = getenv ("REMOTE_ADDR");
|
$REMOTE_ADDR = getenv ("REMOTE_ADDR");
|
||||||
global $REMOTE_ADDR;
|
global $REMOTE_ADDR;
|
||||||
|
|
||||||
if ( (! isset($_SESSION['id_usuario'])) AND (isset($_GET["login"]))){ // Login process
|
// Login process
|
||||||
|
if ( (! isset ($_SESSION['id_usuario'])) AND (isset ($_GET["login"]))) {
|
||||||
|
|
||||||
$nick = entrada_limpia ($_POST["nick"]);
|
$nick = entrada_limpia ($_POST["nick"]);
|
||||||
$pass = entrada_limpia ($_POST["pass"]);
|
$pass = entrada_limpia ($_POST["pass"]);
|
||||||
|
|
||||||
// Connect to Database
|
// Connect to Database
|
||||||
$sql1 = 'SELECT * FROM tusuario WHERE id_usuario = "'.$nick.'"';
|
$sql1 = 'SELECT * FROM tusuario WHERE id_usuario = "'.$nick.'"';
|
||||||
$result = mysql_query ($sql1);
|
$result = mysql_query ($sql1);
|
||||||
// Every registry
|
|
||||||
|
// For every registry
|
||||||
if ($row = mysql_fetch_array ($result)){
|
if ($row = mysql_fetch_array ($result)){
|
||||||
if ($row["password"] == md5 ($pass)){
|
if ($row["password"] == md5 ($pass)){
|
||||||
// Login OK
|
// Login OK
|
||||||
// Nick could be uppercase or lowercase (select in mysql is not case sensitive)
|
// Nick could be uppercase or lowercase (select in MySQL
|
||||||
// We get DB nick to put in PHP Session variable, to avoid problems with case-sensitive usernames :)
|
// is not case sensitive)
|
||||||
|
// We get DB nick to put in PHP Session variable,
|
||||||
|
// to avoid problems with case-sensitive usernames.
|
||||||
// Thanks to David Muñiz for Bug discovery :)
|
// Thanks to David Muñiz for Bug discovery :)
|
||||||
$nick = $row["id_usuario"];
|
$nick = $row["id_usuario"];
|
||||||
unset ($_GET["sec2"]);
|
unset ($_GET["sec2"]);
|
||||||
@ -80,37 +85,40 @@ if (isset ($_GET["refr"])){
|
|||||||
logon_db ($nick, $REMOTE_ADDR);
|
logon_db ($nick, $REMOTE_ADDR);
|
||||||
$_SESSION['id_usuario'] = $nick;
|
$_SESSION['id_usuario'] = $nick;
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else { // Login failed (bad password)
|
// Login failed (bad password)
|
||||||
unset ($_GET["sec2"]);
|
unset ($_GET["sec2"]);
|
||||||
include "general/logon_failed.php";
|
include "general/logon_failed.php";
|
||||||
// change password to do not show all string
|
// change password to do not show all string
|
||||||
$primera = substr ($pass,0,1);
|
$primera = substr ($pass,0,1);
|
||||||
$ultima = substr ($pass, strlen ($pass) - 1, 1);
|
$ultima = substr ($pass, strlen ($pass) - 1, 1);
|
||||||
$pass = $primera . "****" . $ultima;
|
$pass = $primera . "****" . $ultima;
|
||||||
audit_db($nick,$REMOTE_ADDR,"Logon Failed","Incorrect password: ".$nick." / ".$pass);
|
audit_db ($nick, $REMOTE_ADDR, "Logon Failed",
|
||||||
|
"Incorrect password: " . $nick . " / " . $pass);
|
||||||
include "general/footer.php";
|
include "general/footer.php";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { // User not known
|
else {
|
||||||
|
// User not known
|
||||||
unset ($_GET["sec2"]);
|
unset ($_GET["sec2"]);
|
||||||
include "general/logon_failed.php";
|
include "general/logon_failed.php";
|
||||||
$primera = substr ($pass, 0, 1);
|
$primera = substr ($pass, 0, 1);
|
||||||
$ultima = substr ($pass, strlen ($pass) - 1, 1);
|
$ultima = substr ($pass, strlen ($pass) - 1, 1);
|
||||||
$pass = $primera . "****" . $ultima;
|
$pass = $primera . "****" . $ultima;
|
||||||
audit_db($nick,$REMOTE_ADDR,"Logon Failed","Invalid username: ".$nick." / ".$pass);
|
audit_db ($nick, $REMOTE_ADDR, "Logon Failed",
|
||||||
|
"Invalid username: " . $nick . " / " . $pass);
|
||||||
include "general/footer.php";
|
include "general/footer.php";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
} elseif (! isset ($_SESSION['id_usuario'])) {
|
||||||
// If there is no user connected
|
// There is no user connected
|
||||||
elseif (! isset($_SESSION['id_usuario'])) {
|
|
||||||
include "general/login_page.php";
|
include "general/login_page.php";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_GET["logoff"])){ // LOG OFF
|
if (isset ($_GET["logoff"])) {
|
||||||
|
// Log off
|
||||||
unset ($_GET["sec2"]);
|
unset ($_GET["sec2"]);
|
||||||
$_GET["sec"] = "general/logoff";
|
$_GET["sec"] = "general/logoff";
|
||||||
$iduser = $_SESSION["id_usuario"];
|
$iduser = $_SESSION["id_usuario"];
|
||||||
@ -125,22 +133,25 @@ if (isset ($_GET["refr"])){
|
|||||||
<?php
|
<?php
|
||||||
if (isset ($_GET["sec2"])) {
|
if (isset ($_GET["sec2"])) {
|
||||||
$pagina = parametro_limpio ($_GET["sec2"]);
|
$pagina = parametro_limpio ($_GET["sec2"]);
|
||||||
|
|
||||||
if ($pagina <> "") {
|
if ($pagina <> "") {
|
||||||
if (file_exists ($pagina . ".php")) {
|
if (file_exists ($pagina . ".php")) {
|
||||||
require ($pagina . ".php");
|
require ($pagina . ".php");
|
||||||
}
|
} else {
|
||||||
else print "<br><b class='error'>Sorry! I can't find the page!</b>";
|
echo "<br><b class='error'>Sorry! I can't find the page!</b>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (isset($_GET["sec"] )){
|
} elseif (isset ($_GET["sec"])) {
|
||||||
$pagina = parametro_limpio ($_GET["sec"]);
|
$pagina = parametro_limpio ($_GET["sec"]);
|
||||||
|
|
||||||
if (file_exists ($pagina . ".php")) {
|
if (file_exists ($pagina . ".php")) {
|
||||||
require ($pagina . ".php");
|
require ($pagina . ".php");
|
||||||
|
} else {
|
||||||
|
echo "<br><b class='error'>Sorry! I can't find the page!</b>";
|
||||||
}
|
}
|
||||||
else print "<br><b class='error'>Sorry! I can't find the page!</b>";
|
} else {
|
||||||
}
|
|
||||||
else
|
|
||||||
require ("general/logon_ok.php"); //default
|
require ("general/logon_ok.php"); //default
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
// Load global vars
|
// Load global vars
|
||||||
require("include/config.php");
|
require("include/config.php");
|
||||||
|
|
||||||
if (comprueba_login() == 0)
|
if (comprueba_login () == 0) {
|
||||||
if (give_acl ($id_user, 0, "AR") == 1) {
|
if (give_acl ($id_user, 0, "AR") == 1) {
|
||||||
echo "<h2>".$lang_label["ag_title"]."</h2>";
|
echo "<h2>".$lang_label["ag_title"]."</h2>";
|
||||||
echo "<h3>".$lang_label["group_view"]."<a href='help/".$help_code."/chap3.php#324' target='_help' class='help'> <span>".$lang_label["help"]."</span></a></h3>";
|
echo "<h3>".$lang_label["group_view"]."<a href='help/".$help_code."/chap3.php#324' target='_help' class='help'> <span>".$lang_label["help"]."</span></a></h3>";
|
||||||
@ -30,10 +30,12 @@ if (comprueba_login() == 0)
|
|||||||
$result2 = mysql_query ($sql1);
|
$result2 = mysql_query ($sql1);
|
||||||
if (mysql_num_rows ($result2)) {
|
if (mysql_num_rows ($result2)) {
|
||||||
while ($row = mysql_fetch_array ($result2)) {
|
while ($row = mysql_fetch_array ($result2)) {
|
||||||
if ($row["id_grupo"]!=1)
|
if ($row["id_grupo"] != 1 &&
|
||||||
if (give_acl($iduser_temp,$row["id_grupo"], "AR") == 1)
|
give_acl($iduser_temp,$row["id_grupo"], "AR") == 1) {
|
||||||
$mis_grupos[]=$row["id_grupo"]; //All my groups in an array
|
$mis_grupos[]=$row["id_grupo"]; //All my groups in an array
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update network modules for this group
|
// Update network modules for this group
|
||||||
// Check for Network FLAG change request
|
// Check for Network FLAG change request
|
||||||
if (isset ($_GET["update_netgroup"])) {
|
if (isset ($_GET["update_netgroup"])) {
|
||||||
@ -47,11 +49,13 @@ if (comprueba_login() == 0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$contador_grupo = 0;
|
$contador_grupo = 0;
|
||||||
$contador_agente = 0;
|
$contador_agente = 0;
|
||||||
$array_index = 0;
|
$array_index = 0;
|
||||||
|
|
||||||
// Recorro cada grupo para ver el estado de todos los modulos
|
// Recorro cada grupo para ver el estado de todos los modulos
|
||||||
foreach ($mis_grupos as $migrupo)
|
foreach ($mis_grupos as $migrupo) {
|
||||||
if ($migrupo != "") {
|
if ($migrupo != "") {
|
||||||
$grupo[$array_index]["agent"] = 0;
|
$grupo[$array_index]["agent"] = 0;
|
||||||
$grupo[$array_index]["ok"] = 0;
|
$grupo[$array_index]["ok"] = 0;
|
||||||
@ -62,19 +66,23 @@ if (comprueba_login() == 0)
|
|||||||
$grupo[$array_index]["icon"] = dame_grupo_icono ($migrupo);
|
$grupo[$array_index]["icon"] = dame_grupo_icono ($migrupo);
|
||||||
$grupo[$array_index]["id_grupo"] = $migrupo;
|
$grupo[$array_index]["id_grupo"] = $migrupo;
|
||||||
$existen_agentes =0;
|
$existen_agentes =0;
|
||||||
|
|
||||||
$sql1 = "SELECT * FROM tagente WHERE disabled=0 AND id_grupo =".$migrupo;
|
$sql1 = "SELECT * FROM tagente WHERE disabled=0 AND id_grupo =".$migrupo;
|
||||||
if ($result1 = mysql_query ($sql1)) {
|
if ($result1 = mysql_query ($sql1)) {
|
||||||
while ($row1 = mysql_fetch_array ($result1)) {
|
while ($row1 = mysql_fetch_array ($result1)) {
|
||||||
$existen_agentes = 1;
|
$existen_agentes = 1;
|
||||||
$intervalo = $row1["intervalo"];
|
$intervalo = $row1["intervalo"];
|
||||||
$id_agente=$row1["id_agente"]; // Bugsolved 0607113 <slerena@gmail.com>
|
$id_agente = $row1["id_agente"];
|
||||||
|
|
||||||
// Check for recent alerts
|
// Check for recent alerts
|
||||||
if (check_alert_fired($id_agente) == 1) {
|
if (check_alert_fired($id_agente) == 1) {
|
||||||
$grupo[$array_index]["alerts"]++;
|
$grupo[$array_index]["alerts"]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$grupo[$array_index]["agent"]++;
|
$grupo[$array_index]["agent"]++;
|
||||||
$grupo[$array_index]["group"] = dame_nombre_grupo ($migrupo);
|
$grupo[$array_index]["group"] = dame_nombre_grupo ($migrupo);
|
||||||
$contador_agente++; // Estado grupo, agent
|
// Estado grupo, agent
|
||||||
|
$contador_agente++;
|
||||||
$sql3 = "SELECT * FROM tagente_estado WHERE id_agente = ".$row1["id_agente"];
|
$sql3 = "SELECT * FROM tagente_estado WHERE id_agente = ".$row1["id_agente"];
|
||||||
$result3 = mysql_query ($sql3);
|
$result3 = mysql_query ($sql3);
|
||||||
while ($row3 = mysql_fetch_array ($result3)) {
|
while ($row3 = mysql_fetch_array ($result3)) {
|
||||||
@ -85,35 +93,39 @@ if (comprueba_login() == 0)
|
|||||||
$result4 = mysql_query ($sql4);
|
$result4 = mysql_query ($sql4);
|
||||||
if ($row4 = mysql_fetch_array ($result4)) {
|
if ($row4 = mysql_fetch_array ($result4)) {
|
||||||
$module_interval = $row4["module_interval"];
|
$module_interval = $row4["module_interval"];
|
||||||
if ($module_interval > 0)
|
if ($module_interval > 0) {
|
||||||
$intervalo_comp = $module_interval;
|
$intervalo_comp = $module_interval;
|
||||||
else {
|
} else {
|
||||||
$intervalo_comp = $intervalo;
|
$intervalo_comp = $intervalo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$ultimo_contacto_modulo = $row3["timestamp"];
|
$ultimo_contacto_modulo = $row3["timestamp"];
|
||||||
# Defines if module is down (interval x 2 > time last contact)
|
|
||||||
|
// Defines if module is down (interval x 2 > time last contact)
|
||||||
if ($ultimo_contacto_modulo != "2000-00-00 00:00:00") {
|
if ($ultimo_contacto_modulo != "2000-00-00 00:00:00") {
|
||||||
$seconds = strtotime ($ahora) - strtotime ($ultimo_contacto_modulo);
|
$seconds = strtotime ($ahora) - strtotime ($ultimo_contacto_modulo);
|
||||||
if ($seconds >= ($intervalo_comp * 2)) {
|
if ($seconds >= ($intervalo_comp * 2)) {
|
||||||
$grupo[$array_index]["down"]++;
|
$grupo[$array_index]["down"]++;
|
||||||
}
|
} elseif ($estado != 100) {
|
||||||
elseif ($estado != 100) {
|
if ($row3["datos"] != 0) {
|
||||||
if ($row3["datos"] !=0)
|
|
||||||
$grupo[$array_index]["ok"]++;
|
$grupo[$array_index]["ok"]++;
|
||||||
else
|
} else {
|
||||||
$grupo[$array_index]["bad"]++;
|
$grupo[$array_index]["bad"]++;
|
||||||
|
}
|
||||||
} elseif ($estado == 100) // For data module, not monitors
|
} elseif ($estado == 100) // For data module, not monitors
|
||||||
$grupo[$array_index]["data"]++; // Data module
|
$grupo[$array_index]["data"]++; // Data module
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($existen_agentes == 1){
|
if ($existen_agentes == 1){
|
||||||
$array_index++;
|
$array_index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($contador_agente != 0) {
|
if ($contador_agente != 0) {
|
||||||
$ancho = ceil(sqrt($array_index+1));
|
$ancho = ceil(sqrt($array_index+1));
|
||||||
$real_count =0;
|
$real_count =0;
|
||||||
@ -122,9 +134,11 @@ if (comprueba_login() == 0)
|
|||||||
echo "<tr class='bot'>";
|
echo "<tr class='bot'>";
|
||||||
for ($table_row=0; $table_row < $ancho; $table_row++) {
|
for ($table_row=0; $table_row < $ancho; $table_row++) {
|
||||||
if ($real_count < $array_index) {
|
if ($real_count < $array_index) {
|
||||||
|
|
||||||
$group_name = $grupo[$real_count]["group"];
|
$group_name = $grupo[$real_count]["group"];
|
||||||
$icono_grupo = $grupo[$real_count]["icon"];
|
$icono_grupo = $grupo[$real_count]["icon"];
|
||||||
$icono_type = "";
|
$icono_type = "";
|
||||||
|
|
||||||
if ($grupo[$real_count]["down"] > 0) {
|
if ($grupo[$real_count]["down"] > 0) {
|
||||||
$icono_type = "<img src='images/dot_down.gif' alt=''>";
|
$icono_type = "<img src='images/dot_down.gif' alt=''>";
|
||||||
}
|
}
|
||||||
@ -141,6 +155,8 @@ if (comprueba_login() == 0)
|
|||||||
if ($grupo[$real_count]["alerts"] > 0 ){
|
if ($grupo[$real_count]["alerts"] > 0 ){
|
||||||
$icono_type=$icono_type."<img src='images/dot_yellow.gif' alt=''>";
|
$icono_type=$icono_type."<img src='images/dot_yellow.gif' alt=''>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME: This line is ugly */
|
||||||
// TOOLTIP.
|
// TOOLTIP.
|
||||||
$celda = "<td class='bot' width=100><a href='index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id=".$grupo[$real_count]["id_grupo"]."' class='info'><img class='top' src='images/groups/".$icono_grupo."_1.gif' border='0' alt=''>
|
$celda = "<td class='bot' width=100><a href='index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id=".$grupo[$real_count]["id_grupo"]."' class='info'><img class='top' src='images/groups/".$icono_grupo."_1.gif' border='0' alt=''>
|
||||||
<span>
|
<span>
|
||||||
@ -156,26 +172,26 @@ if (comprueba_login() == 0)
|
|||||||
</table></span></a>";
|
</table></span></a>";
|
||||||
// Render network exec module button, only when this group is writtable by user
|
// Render network exec module button, only when this group is writtable by user
|
||||||
if (give_acl ($id_user, $grupo[$real_count]["id_grupo"], "AW") == 1) {
|
if (give_acl ($id_user, $grupo[$real_count]["id_grupo"], "AW") == 1) {
|
||||||
$celda = $celda . "<a href='index.php?sec=estado&sec2=operation/agentes/estado_grupo&update_netgroup=".$grupo[$real_count]["id_grupo"]."'><img src='images/target.gif' border=0></a>";
|
$celda .= "<a href='index.php?sec=estado&sec2=operation/agentes/estado_grupo&update_netgroup=".$grupo[$real_count]["id_grupo"]."'><img src='images/target.gif' border=0></a>";
|
||||||
}
|
}
|
||||||
$celda = $celda . "<br><br>".$icono_type."<br><br><font class='gr'>".$group_name."</font>";
|
$celda .= "<br><br>".$icono_type."<br><br><font class='gr'>".$group_name."</font>";
|
||||||
echo $celda;
|
echo $celda;
|
||||||
}
|
}
|
||||||
$real_count++;
|
$real_count++;
|
||||||
}
|
}
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "</table>";
|
echo "</table>";
|
||||||
} else {
|
} else {
|
||||||
echo "<div class='nf'>".$lang_label["no_agent_def"]."</div>";
|
echo "<div class='nf'>".$lang_label["no_agent_def"]."</div>";
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
echo "<div class='nf'>".$lang_label["no_agent"]."</div>";
|
echo "<div class='nf'>".$lang_label["no_agent"]."</div>";
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
audit_db ($id_user, $REMOTE_ADDR, "ACL Violation", "Trying to access Agent view (Grouped)");
|
audit_db ($id_user, $REMOTE_ADDR, "ACL Violation", "Trying to access Agent view (Grouped)");
|
||||||
require ("general/noaccess.php");
|
require ("general/noaccess.php");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user