From 07e5274d0d79a632de6f763c36b28dfd3eb63704 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 22 Mar 2017 15:26:54 +0100 Subject: [PATCH] fixed error in login page errors and change icon pdf report --- pandora_console/general/error_screen.php | 32 ++-- pandora_console/general/login_page.php | 145 +++++++++++++++--- pandora_console/images/pandora_logo_white.jpg | Bin 1451 -> 3808 bytes .../images/pandora_report_logo.png | Bin 28235 -> 95754 bytes pandora_console/include/config_process.php | 32 ++++ pandora_console/include/functions_html.php | 11 +- pandora_console/include/styles/pandora.css | 11 +- pandora_console/index.php | 15 ++ 8 files changed, 192 insertions(+), 54 deletions(-) diff --git a/pandora_console/general/error_screen.php b/pandora_console/general/error_screen.php index ca2e4476d5..9135170263 100644 --- a/pandora_console/general/error_screen.php +++ b/pandora_console/general/error_screen.php @@ -13,28 +13,18 @@ // 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. +include_once("include/functions.php"); +include_once("include/functions_html.php"); +include_once("include/functions_ui.php"); +include_once("include/functions_io.php"); +include_once("include/functions_extensions.php"); +echo ''; +ob_start ('ui_process_page_head'); +echo ''; +echo '' . "\n"; -?> - - - - -Pandora FMS - The Flexible Monitoring System - Console error - - - - - - - - - - - - - - -'; } +switch ($login_screen) { + case 'error_authconfig': + case 'error_dbconfig': + $title = __('Problem with Pandora FMS database'); + $message = __('Cannot connect to the database, please check your database setup in the include/config.php file.

+ Probably your database, hostname, user or password values are incorrect or + the database server is not running.').'

'; + $message .= ''; + $message .= '' . __('DB ERROR') . ':
'; + $message .= db_get_last_error(); + $message .= '
'; + + if ($error_code == 'error_authconfig') { + $message .= '

'; + $message .= __('If you have modified auth system, this problem could be because Pandora cannot override authorization variables from the config database. Remove them from your database by executing:
DELETE FROM tconfig WHERE token = "auth";
'); + } + break; + case 'error_emptyconfig': + $title = __('Empty configuration table'); + $message = __('Cannot load configuration variables from database. Please check your database setup in the + include/config.php file.

+ Most likely your database schema has been created but there are is no data in it, you have a problem with the database access credentials or your schema is out of date. +

Pandora FMS Console cannot find include/config.php or this file has invalid + permissions and HTTP server cannot read it. Please read documentation to fix this problem.
').'

'; + break; + case 'error_noconfig': + $title = __('No configuration file found'); + $message = __('Pandora FMS Console cannot find include/config.php or this file has invalid + permissions and HTTP server cannot read it. Please read documentation to fix this problem.').'

'; + if (file_exists('install.php')) { + $link_start = ''; + $link_end = ''; + } + else { + $link_start = ''; + $link_end = ''; + } + + $message .= sprintf(__('You may try to run the %sinstallation wizard%s to create one.'), $link_start, $link_end); + break; + case 'error_install': + $title = __('Installer active'); + $message = __('For security reasons, normal operation is not possible until you delete installer file. + Please delete the ./install.php file before running Pandora FMS Console.'); + break; + case 'error_perms': + $title = __('Bad permission for include/config.php'); + $message = __('For security reasons, config.php must have restrictive permissions, and "other" users + should not read it or write to it. It should be written only for owner + (usually www-data or http daemon user), normal operation is not possible until you change + permissions for include/config.php file. Please do it, it is for your security.'); + break; + case 'homedir_bad_defined': + $title = __('Bad defined homedir'); + $message = __('In the config.php file in the variable $config["homedir"] = add the correct path'); + break; + case 'homeurl_bad_defined': + $title = __('Bad defined homeurl or homeurl_static'); + $message = __('In the config.php file in the variable $config["homeurl"] or $config["homeurl_static"] = add the correct path'); + break; +} + +if($login_screen == 'error_authconfig' || $login_screen == 'error_emptyconfig' || $login_screen == 'error_install' || + $login_screen == 'error_dbconfig' || $login_screen == 'error_noconfig' || $login_screen == 'error_perms' || + $login_screen == 'homedir_bad_defined' || $login_screen == 'homeurl_bad_defined'){ + echo ''; +} + ui_require_css_file ('dialog'); ui_require_css_file ('jquery-ui-1.10.0.custom'); ui_require_jquery_file('jquery-ui-1.10.0.custom'); @@ -299,50 +389,55 @@ ui_require_jquery_file('jquery-ui-1.10.0.custom'); // Hidden div to forced title html_print_div(array('id' => 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true)); -html_print_div(array('id' => 'modal_alert', 'hidden' => true)); +//html_print_div(array('id' => 'modal_alert', 'hidden' => true)); ?> -