".__('There was a problem updating alert')."";
} else {
echo "
".__('Alert successfully updated')."
";
}
}
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 "".__('There was a problem creating alert')."
";
else
echo "".__('Alert successfully created')."
";
}
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 "".__('There was a problem deleting alert')."
";
else
echo "".__('Alert successfully deleted')."
";
$sql_delete2 ="DELETE FROM talerta_agente_modulo WHERE id_alerta = ".$id_alerta;
$result=mysql_query($sql_delete2);
}
echo "".__('Alert configuration')." > ";
echo __('Alerts defined in Pandora')."
";
echo "";
echo "".__('Alert name')." | ";
echo "".__('Description')." | ";
echo "".__('Delete')." | ";
$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 "".$row["nombre"]." | ";
echo "".$row["descripcion"]." | ";
echo "![](images/cross.png) | ";
} else {
echo "
".$row["nombre"]." | ";
echo "".$row["descripcion"]." | ";
}
}
echo "
";
echo "";
echo "";
echo "";
echo " |
";
?>