Merge branch '3079-Alertas_php7' into 'develop'

create alert php7

See merge request artica/pandorafms!1975
This commit is contained in:
vgilc 2018-11-15 09:46:27 +01:00
commit 614efef0c4
4 changed files with 102 additions and 1 deletions

View File

@ -0,0 +1,67 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 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 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 General
*/
global $config;
if ($config['language'] == 'es') {
$url_help = 'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Instalaci%C3%B3n_y_actualizaci%C3%B3n_PHP_7';
}
else{
$url_help = 'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:_PHP_7';
}
// Prints help dialog information
echo '<div id="login_help_dialog" title="REQUIRED PHP UPDATE" style="display: none;">';
echo '<div style="width:70%; font-size: 10pt; margin: 20px; float:left">';
echo "<p ><b style='font-size: 10pt;'>" . __('For a correct operation of PandoraFMS you will have to update php to version 7.0 or later.') . "</b></p>";
echo "<p style='font-size: 10pt;'><b>" . __(' If you don\'t update, you will lose functionalities:') . "</b></p>";
echo "<ul>";
echo "<li style='padding:5px;'>" . __('Report download in PDF format') . "</li>";
echo "<li style='padding:5px;'>" . __('Sending emails') . "</li>";
echo "<li style='padding:5px;'>" . __('Metaconsole Collections') . "</li>";
echo "<li style='padding:5px;'>" . '...' . "</li>";
echo "</ul>";
echo '<p><a target="blank" href="' . $url_help . '"><b>'.__('Acess Help').'</b></a></p>';
echo '</div>';
echo "<div style='margin-top: 80px;'>";
echo html_print_image('images/icono_warning_mr.png', true, array("alt" => __('Warning php version'), "border" => 0));
echo "</div>";
echo '</div>';
?>
<script type="text/javascript" language="javascript">
/* <![CDATA[ */
$(document).ready (function () {
$("#login_help_dialog").dialog({
resizable: true,
draggable: true,
modal: true,
height: 320,
width: 550,
overlay: {
opacity: 0.5,
background: "black"
}
});
});
/* ]]> */
</script>

View File

@ -26,6 +26,12 @@ if (! check_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_us
return;
}
$php_version = phpversion();
$php_version_array = explode('.', $php_version);
if($php_version_array[0] < 7){
include_once("general/php7_message.php");
}
$tab = get_parameter('tab', 'online');
$buttons = array(

View File

@ -2231,6 +2231,29 @@ function config_check () {
__("phantomjs is not installed"));
}
}
$php_version = phpversion();
$php_version_array = explode('.', $php_version);
if($php_version_array[0] < 7){
if ($config['language'] == 'es') {
$url_help = 'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Instalaci%C3%B3n_y_actualizaci%C3%B3n_PHP_7';
}
else{
$url_help = 'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:_PHP_7';
}
set_pandora_error_for_header(
__('For a correct operation of PandoraFMS you will have to update php to version 7.0 or later.') . "<br>" .
__(' If you don\'t update, you will lose functionalities:') . "<br>" .
"<ol><li style='color: #676767'>" . __('Report download in PDF format') . "</li>" .
"<li style='color: #676767'>" . __('Sending emails') . "</li>" .
"<li style='color: #676767'>" . __('Metaconsole Collections') . "</li>" .
"<li style='color: #676767'>" . '...' . "</li>" .
"</ol>" .
'<a target="blank" href="' . $url_help . '">'.__('Acess Help').'</a>',
__("REQUIRED PHP UPDATE"));
}
}
function config_return_in_bytes($val) {

View File

@ -940,7 +940,12 @@ if (get_parameter ('login', 0) !== 0) {
include_once("general/login_help_dialog.php");
}
$php_version = phpversion();
$php_version_array = explode('.', $php_version);
if($php_version_array[0] < 7){
include_once("general/php7_message.php");
}
}
// Header