pandorafms/pandora_console/include/config.inc.php

100 lines
3.7 KiB
PHP
Raw Normal View History

<?php
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// 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.
// This is the base config file
//Pandora Version
2007-02-27 Sancho Lerena <slerena@openideas.info> * include/styles/god.css: Moved style block. * include/styles/link.css: Moved style block. * include/styles/op.css: Moved style block. * include/styles/pandora.css: Added some clases for new appearance. Needs to be improved, not finished yet !. * include/config.inc.php: Changed version number. * index.php: Some changes for new block disposition using data_box class and other changes. * operation/agentes/ver_agente.php: Now shows data in three tabs. Needs to be improved, but functional. * operation/agentes/estado_generalagente.php: Change in title order. This should be the way to show title and subtitle since now. * operation/messages/message.php: Changed icon, and fix problem in CSS. Deleted class: Classes with only fix weight should be avoided from now and added in code just with a style attribute, it generates too many classes in main CSS. * images/bottom-*-corner.gif: Added. * general/footer.php: Needs to be updated. * general/links_menu.php: New style in use (different color for top). * godmode/agentes/module_manager.php: New file to manage in tabs agent configuration. Almost functional, needs fix. * godmode/agentes/alert_manager.php: Content of alert management for agent manager, now in a individual file to be shown in a tab. * godmode/agentes/configurar_agente.php; * godmode/agentes/agent_manager.php: New file to manage in tabs agent configuration. Almost functional, needs fix. * godmode/menu.php: New style in use (different color for top). This is a partial commit not fully functional, need to be done due to many changes in a temporal development computer. Sorry for problems to people that are testing SVN version. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@387 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-02-27 20:03:56 +01:00
$build_version="PC070224"; //PCyymmdd
$pandora_version="v1.3 devel";
// Database configuration (default ones)
//$dbname="pandora"; // MySQL DataBase
//$dbuser="pandora"; // DB User
//$dbpassword="pandora"; // Password
//$dbhost="localhost"; // MySQL Host
// This is used for reporting, please add "/" character at the end
2007-05-03 Sancho Lerena <slerena@artica.es> * include/FreeSans.ttf: Added to repos, should be here to use in graphs. * include/functions_db.php: Deleted noaccess include from comprueba_login(). This should return value, not render pages or exit. * include/config.inc.php: Modified some typos. * include/calendar.js: Added generic calendar javascript, to be used on exportdata and incident management code. * include/languages/language_en.php: More strings. * install.php: In my render, box height is too low. PLEASE recheck before changing this kind of properties because in other browsers could have a bad render (Sophus!). * index.php: Added script call (need to be done on header). * operation/agentes/export_csv.php: Added new file to create a standalone CSV on download icon / link. * operation/agentes/exportdata.php: New export data code, used some code from Leando Doctors, and mixed with old code. Now have three options to render export data. * operation/agentes/datos_agente_calendar.php: Deleted old code from Leandro. * operation/active_console/lib/extra_functions.php: Solved a lot of warnings, but there are TONS of more warnings that need to be corrected. * operation/active_console/lib/db_functions.php:Solved a lot of warnings, but there are TONS of more warnings that need to be corrected. * operation/active_console/index.php: Solved a lot of warnings, but there are TONS of more warnings that need to be corrected. This code DONT work if you are showing warning/notice erros. This code is not ready for production usage, too buggy yet :( * pandora_graphical_console_data.sql: Cleanup. * godmode/agentes/module_manager.php: Added wizard button. * pandora_graphical_console.sql: Cleanup. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@448 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-05-03 04:08:00 +02:00
//$config_homedir = "/var/www/pandora_console/";
// Do not display any ERROR
2007-05-03 Sancho Lerena <slerena@artica.es> * include/FreeSans.ttf: Added to repos, should be here to use in graphs. * include/functions_db.php: Deleted noaccess include from comprueba_login(). This should return value, not render pages or exit. * include/config.inc.php: Modified some typos. * include/calendar.js: Added generic calendar javascript, to be used on exportdata and incident management code. * include/languages/language_en.php: More strings. * install.php: In my render, box height is too low. PLEASE recheck before changing this kind of properties because in other browsers could have a bad render (Sophus!). * index.php: Added script call (need to be done on header). * operation/agentes/export_csv.php: Added new file to create a standalone CSV on download icon / link. * operation/agentes/exportdata.php: New export data code, used some code from Leando Doctors, and mixed with old code. Now have three options to render export data. * operation/agentes/datos_agente_calendar.php: Deleted old code from Leandro. * operation/active_console/lib/extra_functions.php: Solved a lot of warnings, but there are TONS of more warnings that need to be corrected. * operation/active_console/lib/db_functions.php:Solved a lot of warnings, but there are TONS of more warnings that need to be corrected. * operation/active_console/index.php: Solved a lot of warnings, but there are TONS of more warnings that need to be corrected. This code DONT work if you are showing warning/notice erros. This code is not ready for production usage, too buggy yet :( * pandora_graphical_console_data.sql: Cleanup. * godmode/agentes/module_manager.php: Added wizard button. * pandora_graphical_console.sql: Cleanup. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@448 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-05-03 04:08:00 +02:00
//error_reporting(0); // Need to use active console at this moment
// Display ALL errors
error_reporting(E_ALL);
//This is directory where placed "attachment" directory, to upload files stores.
// This MUST be writtable by http server user, and should be in pandora root.
// Please append "/" to the end.
$attachment_store=$config_homedir;
// Default font used for graphics (a Free TrueType font included with Pandora FMS)
$config_fontpath = $config_homedir."reporting/FreeSans.ttf";
// Read remaining config tokens from DB
if (! mysql_connect($dbhost,$dbuser,$dbpassword)){
//Non-persistent connection. If you want persistent conn change it to mysql_pconnect()
exit ('<html><head><title>Pandora Error</title>
<link rel="stylesheet" href="./include/styles/pandora.css" type="text/css">
</head><body><div align="center">
<div id="db_f">
<div>
<a href="index.php"><img src="images/logo_menu.gif" border="0"></a>
</div>
<div id="db_ftxt">
<h1 id="db_fh1" class="error">Pandora Console Error DB-001</h1>
Cannot connect with Database, please check your database setup in the
<b>./include/config.php</b> file and read documentation.<i><br><br>
Probably any of your user/database/hostname values are incorrect or
database is not running.</i><br><br><font class="error">
<b>MySQL ERROR:</b> '. mysql_error().'</font>
<br>&nbsp;
</div>
</div></body></html>');
}
mysql_select_db($dbname);
$result2=mysql_query("SELECT * FROM tconfig");
while ($row2=mysql_fetch_array($result2)){
switch ($row2["token"]) {
case "language_code": $language_code=$row2["value"];
break;
case "block_size": $block_size=$row2["value"];
break;
case "days_purge": $days_purge=$row2["value"];
break;
case "days_compact": $days_compact=$row2["value"];
break;
case "graph_res": $config_graph_res=$row2["value"];
break;
case "step_compact": $config_step_compact=$row2["value"];
break;
case "truetype": $config_truetype=$row2["value"];
break;
case "graph_order": $config_graph_order=$row2["value"];
break;
case "bgimage": $config_bgimage=$row2["value"];
break;
}
}
if ($language_code == 'ast_es') {
$help_code='ast';
}
else $help_code = substr($language_code,0,2);
?>