mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
fixed error in login page errors and change icon pdf report
This commit is contained in:
parent
b00ddd9beb
commit
07e5274d0d
@ -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 '<html>';
|
||||
ob_start ('ui_process_page_head');
|
||||
echo '<link rel="stylesheet" href="include/styles/pandora.css" type="text/css">';
|
||||
echo '</head>' . "\n";
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Pandora FMS - The Flexible Monitoring System - Console error</title>
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf8">
|
||||
<meta name="resource-type" content="document">
|
||||
<meta name="distribution" content="global">
|
||||
<meta name="author" content="Sancho Lerena">
|
||||
<meta name="copyright" content="This is GPL software. Created by Sancho Lerena and others">
|
||||
<meta name="keywords" content="pandora, monitoring, system, GPL, software">
|
||||
<meta name="robots" content="index, follow">
|
||||
<link rel="icon" href="images/pandora.ico" type="image/ico">
|
||||
<link rel="stylesheet" href="include/styles/pandora.css" type="text/css">
|
||||
<link rel="stylesheet" href="include/styles/jquery-ui-1.10.0.custom.css" type="text/css">
|
||||
<link rel="stylesheet" href="include/styles/dialog.css" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
require_once ("include/functions_themes.php");
|
||||
ob_start ('ui_process_page_body');
|
||||
|
||||
// At this point, $login_screen is setted with the error type desired
|
||||
|
||||
|
@ -36,6 +36,13 @@ switch ($login_screen) {
|
||||
break;
|
||||
case 'logout':
|
||||
case 'double_auth':
|
||||
case 'error_install':
|
||||
case 'error_authconfig':
|
||||
case 'error_dbconfig':
|
||||
case 'error_noconfig':
|
||||
case 'error_perms':
|
||||
case 'homedir_bad_defined':
|
||||
case 'homeurl_bad_defined':
|
||||
$logo_link = 'index.php';
|
||||
$logo_title = __('Go to Login');
|
||||
break;
|
||||
@ -290,6 +297,89 @@ if ($login_screen == 'logout'){
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
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 <b>include/config.php</b> file.<i><br/><br/>
|
||||
Probably your database, hostname, user or password values are incorrect or
|
||||
the database server is not running.').'<br /><br />';
|
||||
$message .= '<span class="red">';
|
||||
$message .= '<b>' . __('DB ERROR') . ':</b><br>';
|
||||
$message .= db_get_last_error();
|
||||
$message .= '</span>';
|
||||
|
||||
if ($error_code == 'error_authconfig') {
|
||||
$message .= '<br/><br/>';
|
||||
$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:<br><pre>DELETE FROM tconfig WHERE token = "auth";</pre>');
|
||||
}
|
||||
break;
|
||||
case 'error_emptyconfig':
|
||||
$title = __('Empty configuration table');
|
||||
$message = __('Cannot load configuration variables from database. Please check your database setup in the
|
||||
<b>include/config.php</b> file.<i><br><br>
|
||||
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.
|
||||
<br><br>Pandora FMS Console cannot find <i>include/config.php</i> or this file has invalid
|
||||
permissions and HTTP server cannot read it. Please read documentation to fix this problem.</i>').'<br /><br />';
|
||||
break;
|
||||
case 'error_noconfig':
|
||||
$title = __('No configuration file found');
|
||||
$message = __('Pandora FMS Console cannot find <i>include/config.php</i> or this file has invalid
|
||||
permissions and HTTP server cannot read it. Please read documentation to fix this problem.').'<br /><br />';
|
||||
if (file_exists('install.php')) {
|
||||
$link_start = '<a href="install.php">';
|
||||
$link_end = '</a>';
|
||||
}
|
||||
else {
|
||||
$link_start = '';
|
||||
$link_end = '';
|
||||
}
|
||||
|
||||
$message .= sprintf(__('You may try to run the %s<b>installation wizard</b>%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 <i>./install.php</i> file before running Pandora FMS Console.');
|
||||
break;
|
||||
case 'error_perms':
|
||||
$title = __('Bad permission for include/config.php');
|
||||
$message = __('For security reasons, <i>config.php</i> 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 <i>include/config.php</i> 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 '<div id="modal_alert" title="' . __('Login failed') . '">';
|
||||
echo '<div class="content_alert">';
|
||||
echo '<div class="icon_message_alert">';
|
||||
echo html_print_image('images/icono_stop.png', true, array("alt" => __('Login failed'), "border" => 0));
|
||||
echo '</div>';
|
||||
echo '<div class="content_message_alert">';
|
||||
echo '<div class="text_message_alert">';
|
||||
echo '<h1>' . $title . '</h1>';
|
||||
echo '<p> ' . $message . '</h1>';
|
||||
echo '</div>';
|
||||
echo '<div class="button_message_alert">';
|
||||
html_print_submit_button("Ok", 'hide-login-error', false);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
?>
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
||||
function show_normal_menu() {
|
||||
document.getElementById('input_saml').style.display = 'none';
|
||||
document.getElementById('log_nick').style.display = 'block';
|
||||
document.getElementById('log_pass').style.display = 'block';
|
||||
document.getElementById('log_button').style.display = 'block';
|
||||
document.getElementById('remove_button').style.display = 'none';
|
||||
|
||||
document.getElementById('log_nick').className = 'login_nick';
|
||||
document.getElementById('log_pass').className = 'login_pass';
|
||||
}
|
||||
|
||||
function modal_alert_critical() {
|
||||
$("#modal_alert").hide ()
|
||||
.empty ()
|
||||
.append ($('#log_msg').html())
|
||||
.dialog ({
|
||||
<?php
|
||||
switch($login_screen) {
|
||||
case 'error_authconfig':
|
||||
case 'error_dbconfig':
|
||||
case 'error_emptyconfig':
|
||||
case 'error_noconfig':
|
||||
case 'error_install':
|
||||
case 'error_perms':
|
||||
case 'homedir_bad_defined':
|
||||
case 'homeurl_bad_defined':
|
||||
|
||||
?>
|
||||
// Auto popup
|
||||
$(document).ready (function () {
|
||||
$(function() {
|
||||
$("#modal_alert").dialog ({
|
||||
title: $('#log_title').html(),
|
||||
resizable: true,
|
||||
draggable: false,
|
||||
modal: true,
|
||||
width: 600,
|
||||
height: 250,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
width: 500,
|
||||
height: 200
|
||||
})
|
||||
.show ();
|
||||
}
|
||||
<?php
|
||||
switch($login_screen) {
|
||||
case 'error_authconfig':
|
||||
case 'error_emptyconfig':
|
||||
?>
|
||||
// Auto popup
|
||||
//modal_alert_critical();
|
||||
$("#submit-hide-login-error").click (function () {
|
||||
$("#login_failed" ).dialog('close')
|
||||
});
|
||||
});
|
||||
|
||||
$("#submit-hide-login-error").click (function () {
|
||||
$("#modal_alert" ).dialog('close');
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
<?php
|
||||
break;
|
||||
case 'logout':
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 94 KiB |
@ -35,6 +35,14 @@ else {
|
||||
ini_set("date.timezone", $script_tz);
|
||||
}
|
||||
|
||||
//home dir bad defined
|
||||
if (!is_dir($config['homedir'])) {
|
||||
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR;
|
||||
$config['homedir'] = $ownDir;
|
||||
$config["error"] = "homedir_bad_defined";
|
||||
}
|
||||
|
||||
|
||||
/* Help to debug problems. Override global PHP configuration */
|
||||
global $develop_bypass;
|
||||
if ($develop_bypass != 1) {
|
||||
@ -117,9 +125,33 @@ require_once ($ownDir. 'functions_config.php');
|
||||
// We need a timezone BEFORE calling config_process_config.
|
||||
// If not we will get ugly warnings. Set Europe/Madrid by default
|
||||
// Later will be replaced by the good one.
|
||||
if (!defined('METACONSOLE')) {
|
||||
if(!isset($config["homeurl"])){
|
||||
$url = preg_match('/(\/.+)\/.*\/*/', $_SERVER['REQUEST_URI'], $match);
|
||||
$config["homeurl"] = $match[1];
|
||||
$config["homeurl_static"] = $match[1];
|
||||
$config["error"] = "homeurl_bad_defined";
|
||||
return;
|
||||
}
|
||||
else{
|
||||
$url = preg_match('/(\/.+)\/.*\/*/', $_SERVER['REQUEST_URI'], $match);
|
||||
if($config["homeurl"] != $match[1]){
|
||||
$config["homeurl"] = $match[1];
|
||||
$config["homeurl_static"] = $match[1];
|
||||
$config["error"] = "homeurl_bad_defined";
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isset($config["homeurl_static"])) {
|
||||
$config["homeurl_static"] = $config["homeurl"];
|
||||
}
|
||||
else{
|
||||
if($config["homeurl_static"] != $config["homeurl"]){
|
||||
$config["error"] = "homeurl_bad_defined";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
date_default_timezone_set("Europe/Madrid");
|
||||
|
||||
|
@ -36,11 +36,12 @@ if (!isset($config)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require_once ($config['homedir'].'/include/functions.php');
|
||||
require_once ($config['homedir'].'/include/functions_users.php');
|
||||
require_once ($config['homedir'].'/include/functions_groups.php');
|
||||
require_once ($config['homedir'].'/include/functions_ui.php');
|
||||
else{
|
||||
require_once ($config['homedir'].'/include/functions.php');
|
||||
require_once ($config['homedir'].'/include/functions_users.php');
|
||||
require_once ($config['homedir'].'/include/functions_groups.php');
|
||||
require_once ($config['homedir'].'/include/functions_ui.php');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@ -383,7 +383,7 @@ div#foot {
|
||||
#login_body {
|
||||
/* Set rules to fill background */
|
||||
min-height: 100%;
|
||||
min-width: 1024px;
|
||||
min-width: 1200px;
|
||||
width: 100%;
|
||||
z-index: -9999;
|
||||
position: absolute;
|
||||
@ -3847,7 +3847,7 @@ div.container_login{
|
||||
margin-top: 10%;
|
||||
margin-left: 5%;
|
||||
margin-right: 5%;
|
||||
min-width: 1200px;
|
||||
|
||||
}
|
||||
|
||||
div.login_page {
|
||||
@ -4014,7 +4014,7 @@ div.img_banner_login img{
|
||||
|
||||
/*modal windows login*/
|
||||
div.content_alert{
|
||||
width: 100%;
|
||||
width: 98%;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
@ -4146,3 +4146,8 @@ div#footer_help{
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/*center ui dialog center*/
|
||||
.ui-dialog-titlebar .ui-icon-closethick {
|
||||
margin-top: -5px !important;
|
||||
}
|
@ -28,6 +28,11 @@ if ($develop_bypass != 1) {
|
||||
if (! file_exists ("include/config.php")) {
|
||||
if (! file_exists ("install.php")) {
|
||||
$login_screen = 'error_noconfig';
|
||||
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
|
||||
$config['homedir'] = $ownDir;
|
||||
$config['homeurl'] = $_SERVER['REQUEST_URI'];
|
||||
$config['homeurl_static'] = $_SERVER['REQUEST_URI'];
|
||||
|
||||
require('general/error_screen.php');
|
||||
exit;
|
||||
}
|
||||
@ -60,7 +65,12 @@ if ($develop_bypass != 1) {
|
||||
if ((substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0600") &&
|
||||
(substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0660") &&
|
||||
(substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0640")) {
|
||||
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
|
||||
$config['homedir'] = $ownDir;
|
||||
$config['homeurl'] = $_SERVER['REQUEST_URI'];
|
||||
$config['homeurl_static'] = $_SERVER['REQUEST_URI'];
|
||||
$login_screen = 'error_perms';
|
||||
|
||||
require('general/error_screen.php');
|
||||
exit;
|
||||
}
|
||||
@ -80,6 +90,11 @@ if(session_id() == '') {
|
||||
require_once ("include/config.php");
|
||||
require_once ("include/functions_config.php");
|
||||
|
||||
if (isset($config["error"])) {
|
||||
$login_screen = $config["error"];
|
||||
require('general/error_screen.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
// If metaconsole activated, redirect to it
|
||||
if ($config['metaconsole'] == 1 && $config['enterprise_installed'] == 1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user