diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index b0bfbbb3ed..ad73713fe3 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,15 @@ +2006-12-25 Raul Mateos + + * include/styles/pandora.css: New style mr40. + + * help/en,es/chapter3.php: Explanation of monitor added. Solved error with + english file (maximun-> manimum; minimun -> minimum) + + * include/functions: Add function to show groups of an user. + + * operation/agentes/*, operation/eventos/eventos.php: Use new function. + Style correction. + 2006-12-24 Raul Mateos * include/styles/pandora.css, tip.css: Stylesheet correction. diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 1680d97d54..2bb3def1b8 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -541,10 +541,25 @@ if (give_acl($id_user, 0, "AW")==1) { $result=mysql_query($sql_insert); $id_agente_modulo = mysql_insert_id(); // Create with different estado if proc type or data type - 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_agente_modulo,datos,timestamp,cambio,estado,id_agente) VALUES ($id_agente_modulo, 0,'2000-00-00 00:00:00',0,0,'".$id_agente."')"; } + 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_agente_modulo,datos,timestamp,cambio,estado,id_agente) + VALUES ( + $id_agente_modulo, 0,'0000-00-00 00:00:00',0,0,'".$id_agente."' + )"; + } else { - $sql_insert = "INSERT INTO tagente_estado (id_agente_modulo,datos,timestamp,cambio,estado,id_agente) VALUES ($id_agente_modulo, 0,'2000-00-00 00:00:00',0,100,'".$id_agente."')"; + $sql_insert = "INSERT INTO tagente_estado + (id_agente_modulo,datos,timestamp,cambio,estado,id_agente) + VALUES ( + $id_agente_modulo, 0,'0000-00-00 00:00:00',0,100,'".$id_agente."' + )"; } $result2=mysql_query($sql_insert); if ((! $result) || (! $result2)) @@ -558,39 +573,41 @@ if (give_acl($id_user, 0, "AW")==1) { $id_borrar_modulo = $_GET["delete_module"]; $id_grupo = dame_id_grupo($id_agente); if (give_acl($id_user, $id_grupo, "AW")==0){ - audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to delete a module without admin rights"); + audit_db($id_user,$REMOTE_ADDR, "ACL Violation", + "Trying to delete a module without admin rights"); require ("general/noaccess.php"); echo ""; require ("general/footer.php"); exit; } // Get information of the module to be deleted - $sql1='SELECT * FROM tagente_modulo WHERE id_agente_modulo = '.$id_borrar_modulo; + $sql1='SELECT * FROM tagente_modulo + WHERE id_agente_modulo = '.$id_borrar_modulo; $result=mysql_query($sql1); $row=mysql_fetch_array($result); $id_agente = $row["id_agente"]; $nombre_modulo = $row["nombre"]; $id_tipo_modulo = $row["id_tipo_modulo"]; // First detele from tagente_modulo - $sql_delete= "DELETE FROM tagente_modulo WHERE id_agente_modulo = ".$id_borrar_modulo; + $sql_delete= "DELETE FROM tagente_modulo + WHERE id_agente_modulo = ".$id_borrar_modulo; $result=mysql_query($sql_delete); if (! $result) echo "

".$lang_label["delete_module_no"]."

"; else echo "

".$lang_label["delete_module_ok"]."

"; // Then delete all staus - $sql_delete = "DELETE FROM tagente_estado WHERE id_agente_modulo = ".$id_borrar_modulo; - //echo "DEBUG SQL_DELETE $sql_delete
"; + $sql_delete = "DELETE FROM tagente_estado + WHERE id_agente_modulo = ".$id_borrar_modulo; $result=mysql_query($sql_delete); - // And finally, delete all data of this module - $sql_delete = "DELETE FROM tagente_datos WHERE id_agente_modulo = ".$id_borrar_modulo; - //echo "DEBUG SQL_DELETE $sql_delete
"; + $sql_delete = "DELETE FROM tagente_datos + WHERE id_agente_modulo = ".$id_borrar_modulo; $result=mysql_query($sql_delete); - $sql_delete = "DELETE FROM tagente_datos_string WHERE id_agente_modulo = ".$id_borrar_modulo; - //echo "DEBUG SQL_DELETE $sql_delete
"; + $sql_delete = "DELETE FROM tagente_datos_string + WHERE id_agente_modulo = ".$id_borrar_modulo; $result=mysql_query($sql_delete); - $sql_delete = "DELETE FROM tagente_datos_inc WHERE id_agente_modulo = ".$id_borrar_modulo; - //echo "DEBUG SQL_DELETE $sql_delete
"; + $sql_delete = "DELETE FROM tagente_datos_inc + WHERE id_agente_modulo = ".$id_borrar_modulo; $result=mysql_query($sql_delete); } @@ -601,9 +618,17 @@ if (give_acl($id_user, 0, "AW")==1) { // ======================== echo "

".$lang_label["agent_conf"]."

"; -if (isset($_GET["creacion"])){echo "

".$lang_label["create_agent"]." ".$lang_label["help"]."

";} -else {echo "

".$lang_label["update_agent"]." ".$lang_label["help"]."

";} -echo '
'; +if (isset($_GET["creacion"])){ + echo "

".$lang_label["create_agent"]." + +  ".$lang_label["help"]."

"; + } else { + echo "

".$lang_label["update_agent"]." + +  ".$lang_label["help"]."

"; + } +echo ''; if ($creacion_agente == 1) echo ""; else { @@ -612,21 +637,32 @@ else { } echo ''; echo " + - - + + + + + +"; +} else { + echo " + "; +} +?> +
"; -echo ''.$lang_label["agent_name"].''; +echo ''.$lang_label["agent_name"].' +'; if (isset($_GET["creacion"])){ echo " "; } else { - echo "  "; + echo "  +   + "; } ?> -
+
+ +
+ -
+
+
-
+
-
+ +
'; - echo $lang_label["normal_mode"].' '; + echo $lang_label["learning_mode"].' + '; + echo $lang_label["normal_mode"].' + '; } else { - echo $lang_label["learning_mode"].''; - echo $lang_label["normal_mode"].''; + echo $lang_label["learning_mode"].' + '; + echo $lang_label["normal_mode"].' + '; } ?>
'; - echo $lang_label["active"].' '; + echo $lang_label["disabled"].' + '; + echo $lang_label["active"].' + '; } else { - echo $lang_label["disabled"].''; - echo $lang_label["active"].''; + echo $lang_label["disabled"].' + '; + echo $lang_label["active"].' + '; } ?>
-";} -else {echo "";} ?>
diff --git a/pandora_console/help/en/chap3.php b/pandora_console/help/en/chap3.php index f8afa5ae87..afd9f9528a 100644 --- a/pandora_console/help/en/chap3.php +++ b/pandora_console/help/en/chap3.php @@ -228,7 +228,7 @@ Operating System.

  • Field #2 (Single Line): Define the used value for the "_field2_" variable.
  • Field #3 (Full Text): Define the used value for the "_field3_" variable.
  • Time threshold: Minimum duration between the firing of two consecutive alerts, in seconds.
  • -
  • Max Alerts Fired: Maximun number of alerts that can be sent consecutively.
  • +
  • Max Alerts Fired: Maximum number of alerts that can be sent consecutively.
  • Assigned module: Module to be motitorized by the alert.
  • @@ -422,7 +422,7 @@ The groups are displayed ordered by the following columns:

    3.3.4. Monitors view

    -

    The description of all the monitors defined in the server can be viewed from the "View Agents">"Monitor detail" option in the Operation menu.

    +

    The description of all the monitors (a monitor is a module of "proc" type) defined in the server can be viewed from the "View Agents">"Monitor detail" option in the Operation menu.

    @@ -541,10 +541,10 @@ values from the modules the agent sends after each time interval. Field #3 (Full Text): Define the used value for the "_field3_" variable.

    - Min number of alerts: Minimun + Min number of alerts: Minimum number of alerts that can be sent consecutively.

    - Max number of alerts: Maximun + Max number of alerts: Maximum number of alerts that can be sent consecutively.

    Time threshold: Minimum duration between the firing of two consecutive diff --git a/pandora_console/help/es/chap3.php b/pandora_console/help/es/chap3.php index 5a8bed3c92..b612f792ab 100644 --- a/pandora_console/help/es/chap3.php +++ b/pandora_console/help/es/chap3.php @@ -452,7 +452,7 @@ simplemente con una rápida mirada, gracias a un sistema de bombillas de d

    3.3.4. Ver monitores

    -

    Desde «Ver agentes» > «Detalle monitores» en el menú de operación, se puede ver la descripción de todos los monitores definidos en el servidor.

    +

    Desde «Ver agentes» > «Detalle monitores» en el menú de operación, se puede ver la descripción de todos los monitores definidos en el servidor (un monitor es un módulo de tipo proc).

    diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index e84612da93..afc1d356f9 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -462,25 +462,23 @@ function pagination ($count, $url, $offset ) { // get offset for index calculation } - // End of subrouting to navigate throught blocks - - /* Now you have a header with blocks rendered, and only need to jump offset records. - Tasks you need to do now: - - Skip offset records - - $query1="SELECT * FROM $table $filter $order"; - $result=mysql_query($query1); - mysql_data_seek($result, $offset); - $offset_counter = 0; - - Start viewing data - - while ($row=mysql_fetch_array($result) and ($offset_counter < $block_size) ){ - $data=$row["ID_xxx"]; - . - . - . - */ } + +function list_group ($id_user){ + $mis_grupos[]=""; // Define array mis_grupos to put here all groups with Agent Read permission + $iconindex_g[]=""; + $sql='SELECT id_grupo, icon FROM tgrupo'; + $result=mysql_query($sql); + while ($row=mysql_fetch_array($result)){ + $iconindex_g[$row["id_grupo"]] = $row["icon"]; + if ($row["id_grupo"] != 1){ + if (give_acl($id_user,$row["id_grupo"], "AR") == 1){ + echo ""; + $mis_grupos[]=$row["id_grupo"]; //Put in an array all the groups the user belongs + } + } + } +} + ?> diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index eecc30333a..5bde0ff846 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -384,6 +384,9 @@ td.datosf9i, td.datos2f9i { margin-top: 15px; text-align: justify; } +.mr40 { + margin-right: 40px; +} ul.mn { list-style: none; padding: 0px 0px 0px 0px; diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 34acd60fc1..614e179744 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -21,7 +21,8 @@ require("include/config.php"); if (comprueba_login() == 0) { - if ((give_acl($id_user, 0, "AR")==1) or (give_acl($id_user,0,"AW")) or (dame_admin($id_user)==1)) { + if ((give_acl($id_user, 0, "AR")==1) or (give_acl($id_user,0,"AW")) + or (dame_admin($id_user)==1)) { if (isset($_POST["ag_group"])) $ag_group = $_POST["ag_group"]; @@ -34,50 +35,65 @@ if (comprueba_login() == 0) { $ag_group = $_GET["ag_group_refresh"]; } echo "

    ".$lang_label["ag_title"]."

    "; - echo "

    ".$lang_label["summary"]." ".$lang_label["help"]."

    "; - - $iduser_temp=$_SESSION['id_usuario']; + echo "

    ".$lang_label["summary"]." + +  ".$lang_label["help"]."

    "; // Show group selector if (isset($_POST["ag_group"])){ $ag_group = $_POST["ag_group"]; - echo "
    "; + echo ""; } else { - echo ""; + echo ""; } echo ""; echo ""; echo ""; + echo " + "; // Show only selected groups if ($ag_group > 1) - $sql='SELECT * FROM tagente WHERE id_grupo='.$ag_group.' AND disabled = 0 ORDER BY nombre'; + $sql='SELECT * FROM tagente WHERE id_grupo='.$ag_group.' + AND disabled = 0 ORDER BY nombre'; else - $sql='SELECT * FROM tagente WHERE disabled = 0 ORDER BY id_grupo, nombre'; + $sql='SELECT * FROM tagente WHERE disabled = 0 + ORDER BY id_grupo, nombre'; $result=mysql_query($sql); if (mysql_num_rows($result)){ @@ -126,9 +142,18 @@ if (comprueba_login() == 0) { } if ($pertenece == 1) { // Si el agente pertenece a uno de los grupos que el usuario puede visualizar // Obtenemos la lista de todos los modulos de cada agente - $sql_t="SELECT * FROM tagente_estado, tagente_modulo WHERE tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente=".$id_agente; + $sql_t="SELECT * FROM tagente_estado, tagente_modulo + WHERE tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo + AND tagente_modulo.id_agente=".$id_agente; $result_t=mysql_query($sql_t); - $estado_general = 0; $numero_modulos = 0; $numero_monitor = 0; $est_timestamp = ""; $monitor_bad=0; $monitor_ok = 0; $monitor_down=0; $numero_datamodules=0; + $estado_general = 0; + $numero_modulos = 0; + $numero_monitor = 0; + $est_timestamp = ""; + $monitor_bad=0; + $monitor_ok = 0; + $monitor_down=0; + $numero_datamodules=0; $estado_cambio=0; // Oops, I forgot initialize this fucking var... many problems due it $ahora=date("Y/m/d H:i:s"); // Calculate module/monitor totals for this agent diff --git a/pandora_console/operation/agentes/estado_alertas.php b/pandora_console/operation/agentes/estado_alertas.php index c7353e3e27..f63b92b4ee 100644 --- a/pandora_console/operation/agentes/estado_alertas.php +++ b/pandora_console/operation/agentes/estado_alertas.php @@ -20,7 +20,6 @@ require("include/config.php"); if (comprueba_login() == 0) { if ((give_acl($id_user, 0, "AR")==1) or (give_acl($id_user,0,"AW")) or (dame_admin($id_user)==1)) { - if (isset($_GET["id_agente"])){ echo "

    ".$lang_label["alert_listing"]."".$lang_label["help"]."

    "; $id_agente = $_GET["id_agente"]; @@ -88,22 +87,10 @@ if (comprueba_login() == 0) { echo ""; echo ""; // Show only selected groups @@ -120,7 +107,15 @@ if (comprueba_login() == 0) { if ($row["disabled"] == 0) { $id_agente = $row['id_agente']; $nombre_agente = $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_agente_modulo, tagente_modulo.id_agente_modulo FROM tagente_modulo, talerta_agente_modulo WHERE tagente_modulo.id_agente = '.$id_agente.' AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo'; + $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_agente_modulo, + tagente_modulo.id_agente_modulo + FROM tagente_modulo, talerta_agente_modulo + WHERE tagente_modulo.id_agente = '.$id_agente.' + AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo'; $result_gen=mysql_query($query_gen); if (mysql_num_rows ($result_gen)) { while ($data=mysql_fetch_array($result_gen)){ @@ -135,19 +130,33 @@ if (comprueba_login() == 0) { if (!isset($string)) { $string=''; } - $string=$string.""; + $string=$string.""; if ($data["last_fired"] == "0000-00-00 00:00:00") { - $string=$string.""; } else { - $string=$string.""; + } + $string=$string.""; if ($data["times_fired"] <> 0) - $string=$string.""; else - $string=$string.""; } } else if($ag_group>1) { @@ -165,14 +174,23 @@ if (comprueba_login() == 0) { echo "
    ".$lang_label["group"].""; - echo ""; if ( $ag_group > 1 ){ - echo ""; } - echo ""; // Group all is always active // Group 1 (ALL) gives A LOT of problems, be careful with this code: // Run query on all groups and show data only if ACL check its ok: $iduser_temp is user, and acl is AR (agent read) $mis_grupos[]=""; // Define array mis_grupos to put here all groups with Agent Read permission - $sql='SELECT * FROM tgrupo'; + $sql='SELECT id_grupo FROM tgrupo'; $result=mysql_query($sql); while ($row=mysql_fetch_array($result)){ if ($row["id_grupo"] != 1){ - if (give_acl($iduser_temp,$row["id_grupo"], "AR") == 1){ - echo ""; $mis_grupos[]=$row["id_grupo"]; //Put in an array all the groups the user belongs } } } echo ""; - echo " + +
    ".$nombre_agente.""; - $string=$string."".dame_nombre_alerta($data["id_alerta"]); - $string=$string."".$data["descripcion"]; + $string=$string."
    + + ".$nombre_agente.""; + $string=$string."" + .dame_nombre_alerta($data["id_alerta"])."". + $data["descripcion"]."".$lang_label["never"]; + $string=$string."". + $lang_label["never"]."".$data["last_fired"];} - $string=$string."".$data["times_fired"]; + $string=$string."". + $data["last_fired"]."". + $data["times_fired"].""; + $string=$string." + "; + $string=$string." +
    "; echo "
    "; echo ""; - echo ""; + echo " + + + + + + "; echo $string; //built table of alerts - echo "
    ".$lang_label["agent"]."".$lang_label["type"]."".$lang_label["description"]."".$lang_label["last_fired"]."".$lang_label["times_fired"]."".$lang_label["status"]."
    ".$lang_label["agent"]."".$lang_label["type"]."".$lang_label["description"]."".$lang_label["last_fired"]."".$lang_label["times_fired"]."".$lang_label["status"]."
    "; + echo "
    + "; } else { - echo "
    ".$lang_label["no_alert"]."
    "; + echo "
    ". + $lang_label["no_alert"]."
    "; } - } else echo "
    ". $lang_label["no_agent"].$lang_label["no_agent_alert"]."
    "; + } else echo "
    ". + $lang_label["no_agent"].$lang_label["no_agent_alert"]."
    "; } } //end acl } //end login diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index d9f2165397..6a351f4790 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -30,8 +30,8 @@ if (comprueba_login() == 0) { } echo "

    ".$lang_label["ag_title"]."

    "; - echo "

    ".$lang_label["monitor_listing"]." ".$lang_label["help"]."

    "; - $iduser_temp=$_SESSION['id_usuario']; + echo "

    ".$lang_label["monitor_listing"]." +  ".$lang_label["help"]."

    "; if (isset($_POST["ag_group"])) @@ -56,57 +56,62 @@ if (comprueba_login() == 0) { echo ""; // Module name selector // This code thanks for an idea from Nikum, nikun_h@hotmail.com if (isset($_POST["ag_modulename"])){ $ag_modulename = $_POST["ag_modulename"]; - echo "
    "; + echo ""; } else { - echo ""; + echo ""; } echo " "; echo ""; - echo " - ".$lang_label["green_light"]." "; + echo " - ".$lang_label["green_light"]." +  "; echo ""; echo " - ".$lang_label["red_light"].""; echo ""; echo ""; echo ""; echo "".$lang_label["module_name"].""; - echo ""; if ( isset($ag_modulename)){ echo ""; } echo ""; - $sql='SELECT DISTINCT nombre FROM tagente_modulo WHERE (id_tipo_modulo = 2) OR (id_tipo_modulo = 9) OR (id_tipo_modulo = 12) OR (id_tipo_modulo = 18) OR (id_tipo_modulo = 6) '; + $sql='SELECT DISTINCT nombre + FROM tagente_modulo + WHERE (id_tipo_modulo = 2) + OR (id_tipo_modulo = 9) + OR (id_tipo_modulo = 12) + OR (id_tipo_modulo = 18) + OR (id_tipo_modulo = 6) '; $result=mysql_query($sql); while ($row=mysql_fetch_array($result)){ echo ""; } echo ""; - echo "
    "; + echo " + + "; // Show only selected names & groups if ($ag_group > 1) - $sql='SELECT * FROM tagente WHERE id_grupo='.$ag_group.' ORDER BY nombre'; + $sql='SELECT * FROM tagente WHERE id_grupo='.$ag_group.' + ORDER BY nombre'; else $sql='SELECT * FROM tagente ORDER BY id_grupo, nombre'; @@ -118,9 +123,26 @@ if (comprueba_login() == 0) { while ($row=mysql_fetch_array($result)){ //while there are agents if ($row["disabled"] == 0) { if ((isset($ag_modulename)) && ($ag_modulename != "ALL")) - $query_gen='SELECT * FROM tagente_modulo WHERE id_agente = '.$row["id_agente"].' AND nombre = "'.entrada_limpia($_POST["ag_modulename"]).'" AND ( (id_tipo_modulo = 2) OR (id_tipo_modulo = 9) OR (id_tipo_modulo = 12) OR (id_tipo_modulo = 18) OR (id_tipo_modulo = 6))'; + $query_gen='SELECT * FROM tagente_modulo + WHERE id_agente = '.$row["id_agente"].' + AND nombre = "'.entrada_limpia($_POST["ag_modulename"]).'" + AND ( + (id_tipo_modulo = 2) + OR (id_tipo_modulo = 9) + OR (id_tipo_modulo = 12) + OR (id_tipo_modulo = 18) + OR (id_tipo_modulo = 6) + )'; else - $query_gen='SELECT * FROM tagente_modulo WHERE id_agente = '.$row["id_agente"].' AND ( (id_tipo_modulo = 2) OR (id_tipo_modulo = 9) OR (id_tipo_modulo = 12) OR (id_tipo_modulo = 18) OR (id_tipo_modulo = 6))'; + $query_gen='SELECT * FROM tagente_modulo + WHERE id_agente = '.$row["id_agente"].' + AND ( + (id_tipo_modulo = 2) + OR (id_tipo_modulo = 9) + OR (id_tipo_modulo = 12) + OR (id_tipo_modulo = 18) + OR (id_tipo_modulo = 6) + )'; $result_gen=mysql_query($query_gen); if (mysql_num_rows ($result_gen)) { while ($data=mysql_fetch_array($result_gen)){ @@ -133,19 +155,27 @@ if (comprueba_login() == 0) { } if (!isset($string)) {$string='';} $string=$string.""; - $string=$string."".dame_nombre_agente($data["id_agente"]).""; + $string=$string."". + dame_nombre_agente($data["id_agente"]).""; $string=$string.""; - $string=$string.""; - $string=$string."".$data["nombre"]; - $string=$string."".substr($data["descripcion"],0,30); - $string=$string."".$data["max"]."/".$data["min"]; + $string=$string." + "; + $string=$string."". + $data["nombre"].""; + $string=$string."". + substr($data["descripcion"],0,30).""; + $string=$string."". + $data["max"]."/".$data["min"].""; $string=$string.""; if ($data["module_interval"] == 0){ $string=$string.give_agentinterval($data["id_agente"]); } else { $string=$string.$data["module_interval"]; } - $query_gen2='SELECT * FROM tagente_estado WHERE id_agente_modulo = '.$data["id_agente_modulo"]; + $query_gen2='SELECT * FROM tagente_estado + WHERE id_agente_modulo = '.$data["id_agente_modulo"]; $result_gen2=mysql_query($query_gen2); $data2=mysql_fetch_array($result_gen2); $string=$string.""; @@ -154,14 +184,26 @@ if (comprueba_login() == 0) { } else { $string=$string.""; } - $string=$string."".$data2["timestamp"].""; + $string=$string. + "". + $data2["timestamp"]." + "; } } else if($ag_group>1) {unset($string);} } } if (isset($string)) { - echo ""; + echo "
    ".$lang_label["agent"]."".$lang_label["type"]."".$lang_label["name"]."".$lang_label["description"]."".$lang_label["max_min"]."".$lang_label["interval"]."".$lang_label["status"]."".$lang_label["timestamp"]."
    + + + + + + + + + "; echo $string; //the built table of monitors echo "
    ".$lang_label["agent"]."".$lang_label["type"]."".$lang_label["name"]."".$lang_label["description"]."".$lang_label["max_min"]."".$lang_label["interval"]."".$lang_label["status"]."".$lang_label["timestamp"]."
    "; } diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 27afdd16b4..36f6b85208 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -54,20 +54,19 @@ require("include/config.php"); if (comprueba_login() == 0) { $accion = ""; - $id_usuario =$_SESSION["id_usuario"]; - if (give_acl($id_usuario, 0, "AR")==1) { + if (give_acl($id_user, 0, "AR")==1) { // OPERATIONS // Delete Event (only incident management access). 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_usuario, $id_group, "IM") ==1){ + if (give_acl($id_user, $id_group, "IM") ==1){ $sql2="DELETE FROM tevento WHERE id_evento =".$id_evento; $result2=mysql_query($sql2); if ($result) {echo "

    ".$lang_label["delete_event_ok"]."

    ";} } else { - audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to delete event ID".$id_evento); + audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to delete event ID".$id_evento); } } @@ -76,13 +75,13 @@ if (comprueba_login() == 0) { $id_evento = $_GET["check"]; // Look for event_id following parameters: id_group. $id_group = gime_idgroup_from_idevent($id_evento); - if (give_acl($id_usuario, $id_group, "IW") ==1){ - $sql2="UPDATE tevento SET estado=1, id_usuario = '".$id_usuario."' WHERE id_evento = ".$id_evento; + if (give_acl($id_user, $id_group, "IW") ==1){ + $sql2="UPDATE tevento SET estado=1, id_user = '".$id_user."' WHERE id_evento = ".$id_evento; $result2=mysql_query($sql2); if ($result2) { echo "

    ".$lang_label["validate_event_ok"]."

    ";} } else { - audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to checkout event ID".$id_evento); + audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to checkout event ID".$id_evento); } } @@ -94,10 +93,10 @@ if (comprueba_login() == 0) { $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_usuario, $id_group, "IM") ==1){ + if (give_acl($id_user, $id_group, "IM") ==1){ mysql_query("DELETE FROM tevento WHERE id_evento =".$event_id); } else { - audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to delete event ID".$id_evento); + audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to delete event ID".$id_evento); } } $count++; @@ -111,11 +110,11 @@ if (comprueba_login() == 0) { if (isset($_POST["eventid".$count])){ $id_evento = $_POST["eventid".$count]; $id_group = gime_idgroup_from_idevent($id_evento); - if (give_acl($id_usuario, $id_group, "IW") ==1){ - $sql2="UPDATE tevento SET estado=1, id_usuario = '".$id_usuario."' WHERE estado = 0 AND id_evento = ".$id_evento; + if (give_acl($id_user, $id_group, "IW") ==1){ + $sql2="UPDATE tevento SET estado=1, id_user = '".$id_user."' WHERE estado = 0 AND id_evento = ".$id_evento; $result2=mysql_query($sql2); } else { - audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to checkout event ID".$id_evento); + audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to checkout event ID".$id_evento); } } $count++; @@ -142,19 +141,7 @@ if (comprueba_login() == 0) { echo ""; - $mis_grupos[]=""; // Define array mis_grupos to put here all groups with Agent Read permission - $iconindex_g[]=""; - $sql='SELECT id_grupo, icon FROM tgrupo'; - $result=mysql_query($sql); - while ($row=mysql_fetch_array($result)){ - $iconindex_g[$row["id_grupo"]] = $row["icon"]; - if ($row["id_grupo"] != 1){ - if (give_acl($id_usuario,$row["id_grupo"], "AR") == 1){ - echo "