2006-03-27 05:37:27 +02:00
|
|
|
<?php
|
|
|
|
|
2007-03-12 18:58:52 +01:00
|
|
|
// Pandora FMS - the Free monitoring system
|
|
|
|
// ========================================
|
|
|
|
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
|
|
|
|
// Main PHP/SQL code development and project architecture and management
|
|
|
|
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
|
|
|
|
// CSS and some PHP additions
|
|
|
|
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
|
|
|
|
// 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 10:49:21 +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 10:49:21 +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.
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2006-07-11 10:49:21 +02:00
|
|
|
// Load global vars
|
2006-03-27 05:37:27 +02:00
|
|
|
require("include/config.php");
|
2006-07-11 10:49:21 +02:00
|
|
|
|
2006-03-27 05:37:27 +02:00
|
|
|
if (comprueba_login() == 0)
|
|
|
|
if ((give_acl($id_user, 0, "PM")==1) or (dame_admin($id_user)==1)) {
|
|
|
|
if (isset($_GET["update"])){
|
|
|
|
$block_size=$_POST["block_size"];
|
|
|
|
$language_code=$_POST["language_code"];
|
|
|
|
$days_compact=$_POST["days_compact"];
|
|
|
|
$days_purge=$_POST["days_purge"];
|
|
|
|
$config_graph_res=$_POST["graph_res"];
|
|
|
|
$config_step_compact=$_POST["step_compact"];
|
2006-07-01 03:48:56 +02:00
|
|
|
$config_bgimage=$_POST["bgimage"];
|
2007-03-12 18:58:52 +01:00
|
|
|
$config_show_unknown=$_POST["show_unknown"];
|
|
|
|
$config_show_lastalerts=$_POST["show_lastalerts"];
|
2007-05-24 23:06:42 +02:00
|
|
|
$config_style = $_POST["style"];
|
2007-03-12 18:58:52 +01:00
|
|
|
|
2006-03-27 05:37:27 +02:00
|
|
|
$result2=mysql_query("UPDATE tconfig SET VALUE='".$block_size."' WHERE TOKEN='block_size'");
|
|
|
|
$result2=mysql_query("UPDATE tconfig SET VALUE='".$language_code."' WHERE TOKEN='language_code'");
|
|
|
|
$result2=mysql_query("UPDATE tconfig SET VALUE='".$days_purge."' WHERE TOKEN='days_purge'");
|
|
|
|
$result2=mysql_query("UPDATE tconfig SET VALUE='".$days_compact." ' WHERE TOKEN='days_compact'");
|
|
|
|
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config_graph_res."' WHERE TOKEN='graph_res'");
|
|
|
|
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config_step_compact."' WHERE TOKEN='step_compact'");
|
2006-07-01 03:48:56 +02:00
|
|
|
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config_bgimage."' WHERE token='bgimage'");
|
2007-03-12 18:58:52 +01:00
|
|
|
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config_show_unknown."' WHERE token='show_unknown'");
|
|
|
|
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config_show_lastalerts."' WHERE token='show_lastalerts'");
|
2007-05-24 23:06:42 +02:00
|
|
|
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config_style."' WHERE token='style'");
|
2006-03-27 05:37:27 +02:00
|
|
|
}
|
2007-05-27 04:55:55 +02:00
|
|
|
echo "<h2>".$lang_label["setup_screen"]." > ";
|
2007-10-12 18:27:50 +02:00
|
|
|
echo $lang_label["general_config"]."</h2>";
|
2006-07-04 12:10:21 +02:00
|
|
|
echo "<form name='setup' method='POST' action='index.php?sec=gsetup&sec2=godmode/setup/setup&update=1'>";
|
2007-06-06 18:23:24 +02:00
|
|
|
echo '<table width="500" cellpadding="4" cellspacing="4" class="databox">';
|
2007-05-27 04:55:55 +02:00
|
|
|
echo '<tr><td class="datos">'.$lang_label["language_code"].'</td>';
|
2007-04-02 Raul Mateos <raulofpandora@gmail.com>
* images/ok.gif: Deleted
* images/cross.png, go.png, ok.png, upd.png: Added new images
* include/styles/pandora.css, tip.css, op.css: Updated. Deleted some
old styles, not all.
* include/languages/language_en.php, language_es_es.php: Added text
for no recon task.
* godmode/*.php, operation/*.php, help/*.php: Changed some icons,
updated several buttons with new icons.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@410 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-04-02 19:17:27 +02:00
|
|
|
echo '<td class="datos"><select name="language_code" onChange="javascript:this.form.submit();" width="180px">';
|
2006-03-27 05:37:27 +02:00
|
|
|
|
|
|
|
$sql="SELECT * FROM tlanguage";
|
|
|
|
$result=mysql_query($sql);
|
|
|
|
|
|
|
|
// This combo is dedicated to Raul... beautiful interface for dirty minds :-D
|
|
|
|
$result2=mysql_query("SELECT * FROM tlanguage WHERE id_language = '$language_code'");
|
|
|
|
if ($row2=mysql_fetch_array($result2)){
|
2007-05-27 04:55:55 +02:00
|
|
|
echo '<option value="'.$row2["id_language"].'">'.$row2["name"]."</option>";
|
2006-03-27 05:37:27 +02:00
|
|
|
}
|
|
|
|
while ($row=mysql_fetch_array($result)){
|
2007-05-27 04:55:55 +02:00
|
|
|
echo "<option value=".$row["id_language"].">".$row["name"]."</option>";
|
2006-03-27 05:37:27 +02:00
|
|
|
}
|
2007-05-27 04:55:55 +02:00
|
|
|
echo '</select></td></tr>';
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2006-07-03 12:49:42 +02:00
|
|
|
echo '<tr><td class="datos2">'.$lang_label["block_size"];
|
2007-05-27 04:55:55 +02:00
|
|
|
echo '<td class="datos2"><input type="text" name="block_size" size=5 value="'.$block_size.'"></td></tr>';
|
2006-03-27 05:37:27 +02:00
|
|
|
|
|
|
|
echo '<tr><td class="datos">'.$lang_label["days_compact"];
|
2007-05-27 04:55:55 +02:00
|
|
|
echo '<td class="datos"><input type="text" name="days_compact" size=5 value="'.$days_compact.'"></td></tr>';
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2006-07-03 12:49:42 +02:00
|
|
|
echo '<tr><td class="datos2">'.$lang_label["days_purge"];
|
2007-05-27 04:55:55 +02:00
|
|
|
echo '<td class="datos2"><input type="text" name="days_purge" size=5 value="'.$days_purge.'"></td></tr>';
|
2006-03-27 05:37:27 +02:00
|
|
|
|
|
|
|
echo '<tr><td class="datos">'.$lang_label["graph_res"];
|
2007-05-27 04:55:55 +02:00
|
|
|
echo '<td class="datos"><input type="text" name="graph_res" size=5 value="'.$config_graph_res.'"></td></tr>';
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2007-05-27 04:55:55 +02:00
|
|
|
echo '<tr><td class="datos2">'.$lang_label["step_compact"].'</td>';
|
|
|
|
echo '<td class="datos2"><input type="text" name="step_compact" size=5 value="'.$config_step_compact.'"></td></tr>';
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2007-03-12 18:58:52 +01:00
|
|
|
|
2007-05-27 04:55:55 +02:00
|
|
|
echo '<tr><td class="datos">'.$lang_label["show_unknown"].'</td>';
|
2007-03-12 18:58:52 +01:00
|
|
|
echo '<td class="datos"><select name="show_unknown" class="w120">';
|
|
|
|
if ($config_show_unknown==1) {
|
|
|
|
echo '<option value="1">'.$lang_label["active"].'</option>';
|
|
|
|
echo '<option value="0">'.$lang_label["disabled"].'</option>';
|
2006-03-27 05:37:27 +02:00
|
|
|
}
|
|
|
|
else {
|
2007-03-12 18:58:52 +01:00
|
|
|
echo '<option value="0">'.$lang_label["disabled"].'</option>';
|
|
|
|
echo '<option value="1">'.$lang_label["active"].'</option>';
|
2006-03-27 05:37:27 +02:00
|
|
|
}
|
2007-03-12 18:58:52 +01:00
|
|
|
|
|
|
|
echo '<tr><td class="datos2">'.$lang_label["show_lastalerts"];
|
|
|
|
echo '<td class="datos2"><select name="show_lastalerts" class="w120">';
|
|
|
|
if ($config_show_lastalerts==1) {
|
2006-03-27 05:37:27 +02:00
|
|
|
echo '<option value="1">'.$lang_label["active"].'</option>';
|
|
|
|
echo '<option value="0">'.$lang_label["disabled"].'</option>';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
echo '<option value="0">'.$lang_label["disabled"].'</option>';
|
|
|
|
echo '<option value="1">'.$lang_label["active"].'</option>';
|
|
|
|
}
|
2006-07-01 03:48:56 +02:00
|
|
|
|
2007-05-27 04:55:55 +02:00
|
|
|
echo '<tr><td class="datos">'.$lang_label["background_image"].'</td>';
|
2006-07-01 03:48:56 +02:00
|
|
|
echo '<td class="datos">';
|
2006-10-09 17:22:28 +02:00
|
|
|
echo '<select name="bgimage" class="w155">';
|
2006-07-01 03:48:56 +02:00
|
|
|
if ($config_bgimage!=""){
|
2007-05-27 04:55:55 +02:00
|
|
|
echo '<option>'.$config_bgimage."</option>";
|
2006-07-01 03:48:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$ficheros = list_files('images/backgrounds/', "background",1, 0);
|
|
|
|
$a=0;
|
2006-07-14 12:08:08 +02:00
|
|
|
while (isset($ficheros[$a])){
|
2007-05-27 04:55:55 +02:00
|
|
|
echo "<option>".$ficheros[$a]."</option>";
|
2006-07-01 03:48:56 +02:00
|
|
|
$a++;
|
|
|
|
}
|
|
|
|
echo '</select>';
|
|
|
|
|
2007-05-27 04:55:55 +02:00
|
|
|
echo '<tr><td class="datos2">'.$lang_label["style_template"].'</td>';
|
|
|
|
echo '<td class="datos2">';
|
2007-05-24 23:06:42 +02:00
|
|
|
echo '<select name="style" class="w155">';
|
|
|
|
if ($config_bgimage!=""){
|
2007-05-27 04:55:55 +02:00
|
|
|
echo '<option>'.$config_style.'</option>';
|
2007-05-24 23:06:42 +02:00
|
|
|
}
|
|
|
|
$ficheros2 = list_files('include/styles/', "pandora",1, 0);
|
|
|
|
$a=0;
|
|
|
|
while (isset($ficheros2[$a])){
|
|
|
|
$fstyle = substr($ficheros2[$a],0,strlen($ficheros2[$a])-4);
|
2007-08-30 12:49:50 +02:00
|
|
|
if (($fstyle != $config_style) AND ($fstyle != "pandora_minimal"))
|
2007-05-27 04:55:55 +02:00
|
|
|
echo "<option>".$fstyle."</option>";
|
2007-05-24 23:06:42 +02:00
|
|
|
$a++;
|
|
|
|
}
|
|
|
|
echo '</select>';
|
|
|
|
echo "</table>";
|
|
|
|
echo "<table width=500>";
|
|
|
|
echo "<tr><td align='right'>";
|
2007-04-02 Raul Mateos <raulofpandora@gmail.com>
* images/ok.gif: Deleted
* images/cross.png, go.png, ok.png, upd.png: Added new images
* include/styles/pandora.css, tip.css, op.css: Updated. Deleted some
old styles, not all.
* include/languages/language_en.php, language_es_es.php: Added text
for no recon task.
* godmode/*.php, operation/*.php, help/*.php: Changed some icons,
updated several buttons with new icons.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@410 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-04-02 19:17:27 +02:00
|
|
|
echo '<input type="submit" class="sub upd" value="'.$lang_label["update"].'">';
|
2007-05-27 04:55:55 +02:00
|
|
|
echo "</td></tr>";
|
2006-03-27 05:37:27 +02:00
|
|
|
echo "</table>";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Database Management");
|
|
|
|
require ("general/noaccess.php");
|
2007-05-24 23:06:42 +02:00
|
|
|
}
|