From de5ee31aa445531e0a4d5f271bc316d3e4760791 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 22 Dec 2009 15:46:54 +0000 Subject: [PATCH] 2009-12-22 Miguel de Dios * include/config_process.php, include/functions_db.php: fix alert message when the history DB is'nt setup. * general/header.php: fix alert message when the custom logo didn't exit. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2231 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++++ pandora_console/general/header.php | 3 ++- pandora_console/include/config_process.php | 8 +++++--- pandora_console/include/functions_db.php | 6 +++++- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 4179805556..8111b1b1ba 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2009-12-22 Miguel de Dios + + * include/config_process.php, include/functions_db.php: fix alert message + when the history DB is'nt setup. + + * general/header.php: fix alert message when the custom logo didn't exit. + 2009-12-22 Miguel de Dios * include/fgraph.php: clean source code, fix when try show boolean without diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 3efe8b87ce..8ff4a81c82 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -104,7 +104,8 @@ require_once ("include/functions_messages.php"); echo ""; echo ""; echo ""; - echo ""; + if (isset($config["custom_logo"])) + echo ""; ?> diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 1cba495a1e..d91f12f360 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -98,9 +98,11 @@ require_once ('functions_extensions.php'); $config['extensions'] = get_extensions (); // Connect to the history DB -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']); +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) diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 81f833f5f7..ca3e0dd87d 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -1820,7 +1820,11 @@ function get_db_all_rows_sql ($sql, $search_history_db = false) { // Read from the history DB if necessary if ($search_history_db) { $cache = false; - $history = process_sql ($sql, 'affected_rows', $config['history_db_connection'], false); + $history = false; + + if (isset($config['history_db_connection'])) + $history = process_sql ($sql, 'affected_rows', $config['history_db_connection'], false); + if ($history === false) { $history = array (); }