// Additions to Pandora FMS 1.2 graph code and new XML reporting template management
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es
//
// 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; version 2
// 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
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["delete"])) {
$id_server=entrada_limpia($_GET["server_del"]);
$sql = "DELETE FROM tserver WHERE id_server='".$id_server."'";
$result=mysql_query($sql);
if ($result) echo "
".$lang_label["del_server_ok"]."
";
else echo "".$lang_label["del_server_no"]."
";
}
if (isset($_GET["update"])) {
$name=entrada_limpia($_POST["name"]);
$address=entrada_limpia($_POST["address"]);
$description=entrada_limpia($_POST["description"]);
$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 "".$lang_label["upd_server_ok"]."
";
else echo "".$lang_label["upd_server_no"]."
";
}
if (isset($_GET["server"])) {
$id_server=entrada_limpia($_GET["server"]);
echo "".$lang_label["view_servers"]." > ";
echo $lang_label["update_server"]."
";
$query="SELECT * FROM tserver WHERE id_server=".$id_server;
$result=mysql_query($query);
if (mysql_num_rows($result)){
$row=mysql_fetch_array($result);
$name = $row["name"];
$address = $row["ip_address"];
$status = $row["status"];
$laststart = $row["laststart"];
$keepalive = $row["keepalive"];
$network_server = $row["network_server"];
$data_server = $row["data_server"];
$snmp_server = $row["snmp_server"];
$master = $row["master"];
$checksum = $row["checksum"];
$description = $row["description"];
echo '