Added um messages pop-up and fixed popup order
This commit is contained in:
parent
e14e4090d2
commit
72fbd5e67a
|
@ -0,0 +1,60 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Pandora FMS - http://pandorafms.com
|
||||||
|
// ==================================================
|
||||||
|
// Copyright (c) 2005-2016 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;
|
||||||
|
|
||||||
|
include_once("include/functions_update_manager.php");
|
||||||
|
$last_message = update_manger_get_last_message ();
|
||||||
|
|
||||||
|
if ($last_message === false) return false;
|
||||||
|
|
||||||
|
update_manger_set_read_message($last_message["svn_version"], 1);
|
||||||
|
update_manager_remote_read_messages ($last_message["svn_version"]);
|
||||||
|
|
||||||
|
// Prints first step pandora registration
|
||||||
|
echo '<div id="message_id_dialog" title="' .
|
||||||
|
'[' . $last_message["svn_version"] . '] ' . $last_message['db_field_value'] . '">';
|
||||||
|
|
||||||
|
echo '<div>';
|
||||||
|
echo $last_message["data"];
|
||||||
|
echo '</div>';
|
||||||
|
echo '</div>';
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<script type="text/javascript" language="javascript">
|
||||||
|
/* <![CDATA[ */
|
||||||
|
|
||||||
|
$(document).ready (function () {
|
||||||
|
|
||||||
|
$("#message_id_dialog").dialog({
|
||||||
|
resizable: true,
|
||||||
|
draggable: true,
|
||||||
|
modal: true,
|
||||||
|
width: 850
|
||||||
|
});
|
||||||
|
|
||||||
|
$(".ui-widget-overlay").css("background", "#000");
|
||||||
|
$(".ui-widget-overlay").css("opacity", 0.6);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
/* ]]> */
|
||||||
|
</script>
|
|
@ -124,7 +124,7 @@ $display_register = display_register ($wizard_data);
|
||||||
$display_forced = ($wizard_data['force_newsletter'] != -1) || ($wizard_data['force_register'] != -1);
|
$display_forced = ($wizard_data['force_newsletter'] != -1) || ($wizard_data['force_register'] != -1);
|
||||||
|
|
||||||
// Return if it is fully completed
|
// Return if it is fully completed
|
||||||
if ((!$display_register) && (!$display_newsletter)) return;
|
if ((!$display_register) && (!$display_newsletter)) return false;
|
||||||
|
|
||||||
$return_button = get_parameter ('return_button', 0) == 1;
|
$return_button = get_parameter ('return_button', 0) == 1;
|
||||||
|
|
||||||
|
|
|
@ -1463,18 +1463,19 @@ function config_check () {
|
||||||
|
|
||||||
if (license_free() && users_is_admin($config['id_user'])) {
|
if (license_free() && users_is_admin($config['id_user'])) {
|
||||||
|
|
||||||
|
$login = get_parameter ('login', false);
|
||||||
//Registration advice
|
//Registration advice
|
||||||
if (!isset ($config['instance_registered']) || ($config['instance_registered'] != 1)) {
|
if ((!isset ($config['instance_registered']) || ($config['instance_registered'] != 1)) && ($login === false)) {
|
||||||
set_pandora_error_for_header(
|
set_pandora_error_for_header(
|
||||||
__('Click <a style="font-weight:bold; text-decoration:underline" href="javascript: force_run_register();"> here </a> to init the registration process'),
|
__('Click <a style="font-weight:bold; text-decoration:underline" href="javascript: force_run_register();"> here</a> to start the registration process'),
|
||||||
__("This PandoraFMS instance is not registered"));
|
__("This instance is not registered in the Update manager"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Newsletter advice
|
//Newsletter advice
|
||||||
$newsletter = db_get_value ('middlename', 'tusuario', 'id_user', $config['id_user']);
|
$newsletter = db_get_value ('middlename', 'tusuario', 'id_user', $config['id_user']);
|
||||||
if ($newsletter != 1) {
|
if ($newsletter != 1 && $login === false) {
|
||||||
set_pandora_error_for_header(
|
set_pandora_error_for_header(
|
||||||
__('Click <a style="font-weight:bold; text-decoration:underline" href="javascript: force_run_newsletter();"> here </a> to init the newsletter subscription process'),
|
__('Click <a style="font-weight:bold; text-decoration:underline" href="javascript: force_run_newsletter();"> here</a> to start the newsletter subscription process'),
|
||||||
__("Missing user in newsletter"));
|
__("Missing user in newsletter"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -530,7 +530,7 @@ $config['logged'] = false;
|
||||||
extensions_load_extensions ($process_login);
|
extensions_load_extensions ($process_login);
|
||||||
|
|
||||||
// Check for update manager messages
|
// Check for update manager messages
|
||||||
if ($config['last_um_check'] > (time() + 2 * SECONDS_1HOUR)) {
|
if (license_free() && is_user_admin ($config['id_user']) && $config['last_um_check'] > (time() + 2 * SECONDS_1HOUR)) {
|
||||||
require_once("include/functions_update_manager.php");
|
require_once("include/functions_update_manager.php");
|
||||||
|
|
||||||
update_manager_download_messages ();
|
update_manager_download_messages ();
|
||||||
|
@ -605,7 +605,12 @@ if ($old_global_counter_chat != $now_global_counter_chat) {
|
||||||
$_SESSION['new_chat'] = true;
|
$_SESSION['new_chat'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config['initial_wizard'] != 1) {
|
// Pop-ups display order:
|
||||||
|
// 1) login_required (timezone and email)
|
||||||
|
// 2) identification (newsletter and register)
|
||||||
|
// 3) last_message (update manager message popup
|
||||||
|
// 4) login_help (online help, enterpirse version, forums, documentation)
|
||||||
|
if (!isset($config['initial_wizard']) || $config['initial_wizard'] != 1) {
|
||||||
include_once ("general/login_required.php");
|
include_once ("general/login_required.php");
|
||||||
}
|
}
|
||||||
if (get_parameter ('login', 0) !== 0) {
|
if (get_parameter ('login', 0) !== 0) {
|
||||||
|
@ -614,13 +619,17 @@ if (get_parameter ('login', 0) !== 0) {
|
||||||
|
|
||||||
// Display login help info dialog
|
// Display login help info dialog
|
||||||
// If it's configured to not skip this
|
// If it's configured to not skip this
|
||||||
|
$display_previous_popup = false;
|
||||||
if ($config['initial_wizard'] == 1) {
|
if (license_free() && is_user_admin ($config['id_user']) && $config['initial_wizard'] == 1) {
|
||||||
include_once("general/login_identification_wizard.php");
|
$display_previous_popup = include_once("general/login_identification_wizard.php");
|
||||||
|
if ($display_previous_popup === false) {
|
||||||
|
$display_previous_popup = include_once("general/last_message.php");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!isset($config['skip_login_help_dialog']) ||
|
if ((!isset($config['skip_login_help_dialog']) || $config['skip_login_help_dialog'] == 0) &&
|
||||||
$config['skip_login_help_dialog'] == 0) {
|
$display_previous_popup === false &&
|
||||||
|
$config['initial_wizard'] == 1) {
|
||||||
|
|
||||||
include_once("general/login_help_dialog.php");
|
include_once("general/login_help_dialog.php");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -881,7 +890,7 @@ require('include/php_to_js_values.php');
|
||||||
$("#login_accept_register").dialog('open');
|
$("#login_accept_register").dialog('open');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log ("ajax open wizard");
|
|
||||||
$(".ui-dialog-titlebar-close").show();
|
$(".ui-dialog-titlebar-close").show();
|
||||||
$("#container").append('<div class="id_wizard"></div>');
|
$("#container").append('<div class="id_wizard"></div>');
|
||||||
jQuery.get ("ajax.php",
|
jQuery.get ("ajax.php",
|
||||||
|
|
Loading…
Reference in New Issue