mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-26 11:29:12 +02:00
Changes ported from 3.0 branch. * include/javascript/pandora_visual_console.js: Thiner lines in maps. * include/functions_visual_map.php: Fixed several issues in visual maps (bad hierarchy status color, limited depth for recursion, get unknown for agents and modules, and line color is now always associated to parent status) and non-status elements like labels, graphs or progress bars now doesnt propagate module status to parents. * include/functions_db.php: Added parameter to get_db_all_rows_sql() to avoid use of cache. Function process_sql() was not properly checking if cache usage was disabled and was always using cache. Added support for checking unknown status in get_agentmodule_status() function. * extensions/dbmanager/dbmanager.css, extensions/dbmanager.php: Fixed width of textarea. * operation/events/events.php: Fixed bug #2943907. * operation/agentes/exportdata.php: Fixed problem exporting CSV when data to export is TOO big, using an internal cache to read data. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2327 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
122 lines
3.7 KiB
PHP
122 lines
3.7 KiB
PHP
<?php
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
// ==================================================
|
|
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
// modify it under the terms of the GNU Lesser 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.
|
|
|
|
/**
|
|
* @package Include
|
|
* @subpackage Config
|
|
*/
|
|
|
|
/**
|
|
* Pandora build version and version
|
|
*/
|
|
$build_version = 'PC100202';
|
|
$pandora_version = 'v3.1-dev';
|
|
|
|
/* Help to debug problems. Override global PHP configuration */
|
|
if (!isset($develop_bypass)) $develop_bypass = 0;
|
|
|
|
if ($develop_bypass != 1) {
|
|
// error_reporting(E_ALL);
|
|
|
|
if (strnatcmp(phpversion(),'5.2.11') >= 0)
|
|
{
|
|
error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE);
|
|
}
|
|
else
|
|
{
|
|
error_reporting(E_ALL & ~E_NOTICE);
|
|
}
|
|
|
|
ini_set("display_errors", 0);
|
|
ini_set("error_log", $config["homedir"]."/pandora_console.log");
|
|
}
|
|
else {
|
|
error_reporting(E_ALL);
|
|
ini_set("display_errors", 1);
|
|
ini_set("error_log", $config["homedir"]."/pandora_console.log");
|
|
}
|
|
|
|
// Set a default timezone default if not configured
|
|
// to avoid warnings and bad timestamp calculation in PHP > 5.1
|
|
|
|
if (ini_get('date.timezone') == ""){
|
|
date_default_timezone_set("Europe/Berlin");
|
|
}
|
|
|
|
$config['start_time'] = microtime (true);
|
|
|
|
// Non-persistent connection: This will help to avoid mysql errors like "has gone away" or locking problems
|
|
// If you want persistent connections change it to mysql_pconnect().
|
|
$config['dbconnection'] = mysql_connect ($config["dbhost"], $config["dbuser"], $config["dbpass"]);
|
|
if (! $config['dbconnection']) {
|
|
include ($config["homedir"]."/general/error_authconfig.php");
|
|
exit;
|
|
}
|
|
|
|
mysql_select_db ($config["dbname"]);
|
|
require_once ('functions.php');
|
|
require_once ('functions_db.php');
|
|
require_once ('functions_config.php');
|
|
|
|
process_config ();
|
|
|
|
require_once ('streams.php');
|
|
require_once ('gettext.php');
|
|
|
|
// Set IP address of user connected to Pandora console and store it in session array
|
|
global $REMOTE_ADDR;
|
|
|
|
$config["remote_addr"] = $_SERVER['REMOTE_ADDR'];
|
|
$config['user_language'] = $config["language"];
|
|
|
|
// Set user language if provided, overriding System language
|
|
if (isset ($config['id_user'])){
|
|
$userinfo = get_user_info ($config['id_user']);
|
|
if ($userinfo["language"] != ""){
|
|
$config['user_language'] = $userinfo["language"];
|
|
}
|
|
}
|
|
|
|
$l10n = NULL;
|
|
|
|
if (file_exists ('./include/languages/'.$config["user_language"].'.mo')) {
|
|
$l10n = new gettext_reader (new CachedFileReader ('./include/languages/'.$config["user_language"].'.mo'));
|
|
$l10n->load_tables();
|
|
}
|
|
|
|
if (! defined ('EXTENSIONS_DIR'))
|
|
define ('EXTENSIONS_DIR', 'extensions');
|
|
|
|
if (! defined ('ENTERPRISE_DIR'))
|
|
define ('ENTERPRISE_DIR', 'enterprise');
|
|
|
|
require_once ('functions_extensions.php');
|
|
|
|
$config['extensions'] = get_extensions ();
|
|
|
|
// Connect to the history DB
|
|
if (isset($config['history_db_enabled'])) {
|
|
if ($config['history_db_enabled']) {
|
|
$config['history_db_connection'] = mysql_connect ($config['history_db_host'] . ':' . $config['history_db_port'], $config['history_db_user'], $config['history_db_pass']);
|
|
mysql_select_db ($config['history_db_name'], $config['history_db_connection']);
|
|
}
|
|
}
|
|
|
|
// Make dbconnection the default connection again (the link identifier of the already opened link will be returned)
|
|
$config['dbconnection'] = mysql_connect ($config["dbhost"], $config["dbuser"], $config["dbpass"]);
|
|
|
|
?>
|