Added dummy and undesigned identification wizard
Conflicts: pandora_console/godmode/update_manager/update_manager.setup.php pandora_console/include/functions_config.php pandora_console/index.php
This commit is contained in:
parent
ee4a5f4119
commit
dbde4ffc43
|
@ -0,0 +1,290 @@
|
|||
<?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;
|
||||
|
||||
function display_register ($data) {
|
||||
if ($data['instance_registered'] == 1) return false;
|
||||
if ($data['force_register'] == 1) return true;
|
||||
if ($data['force_register'] == 0) return false;
|
||||
if ($data['identification_reminder'] == 0) return false;
|
||||
if (!isset ($data['identification_reminder_timestamp'])) return true;
|
||||
if ($data['identification_reminder_timestamp'] < time()) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function display_newsletter ($data) {
|
||||
if ($data['newsletter_subscribed'] == 1) return false;
|
||||
if ($data['force_newsletter'] == 1) return true;
|
||||
if ($data['force_newsletter'] == 0) return false;
|
||||
if ($data['newsletter_reminder'] == 0) return false;
|
||||
if (!isset ($data['newsletter_reminder_timestamp'])) return true;
|
||||
if (!is_numeric ($data['newsletter_reminder_timestamp'])) return true;
|
||||
if ($data['newsletter_reminder_timestamp'] < time()) return true;
|
||||
else {html_debug ($data['newsletter_reminder_timestamp'] . "<<-data", true);}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_ajax()) {
|
||||
|
||||
$open_wizard = get_parameter ('open_wizard', 0);
|
||||
$not_return = get_parameter ('not_return', 0);
|
||||
|
||||
if ($open_wizard) {
|
||||
|
||||
$register_pandora = get_parameter ('register_pandora', 0);
|
||||
$newsletter = get_parameter ('newsletter', 0);
|
||||
$forced = get_parameter ('forced', 0);
|
||||
$future_8_days = time() + 8 * SECONDS_1DAY;
|
||||
|
||||
if ($register_pandora) {
|
||||
//TODO: Pandora registration
|
||||
config_update_value ('instance_registered', 1);
|
||||
} elseif (!$forced) {
|
||||
config_update_value ('identification_reminder_timestamp', $future_8_days);
|
||||
}
|
||||
|
||||
if ($newsletter) {
|
||||
//TODO: Newsletter subscribe
|
||||
db_process_sql_update ('tusuario', array ('middlename' => 1), array('id_user' => $config['id_user']));
|
||||
} elseif (!$forced) {
|
||||
html_debug ('future days');
|
||||
db_process_sql_update ('tusuario', array ('lastname' => $future_8_days), array('id_user' => $config['id_user']));
|
||||
}
|
||||
}
|
||||
|
||||
if (!$not_return) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//Check if user is admin
|
||||
if (!license_free()) return;
|
||||
if (!users_is_admin ($config['id_user'])) return;
|
||||
|
||||
// Get data to display properly the wizard
|
||||
$wizard_data = array ();
|
||||
|
||||
$wizard_data['newsletter_subscribed'] = db_get_value ('middlename', 'tusuario', 'id_user', $config['id_user']);
|
||||
// force_* = 1 -> force show
|
||||
// force_* = 0 -> force hide
|
||||
// force_* = -1 -> show or hide depends reminder and timestamp
|
||||
$wizard_data['force_newsletter'] = get_parameter ('force_newsletter', -1);
|
||||
$wizard_data['newsletter_reminder'] = db_get_value ('firstname', 'tusuario', 'id_user', $config['id_user']);
|
||||
$wizard_data['newsletter_reminder_timestamp'] = db_get_value ('lastname', 'tusuario', 'id_user', $config['id_user']);
|
||||
|
||||
|
||||
$wizard_data['instance_register'] = $config['instance_registered'];
|
||||
$wizard_data['force_register'] = get_parameter ('force_register', -1);
|
||||
$wizard_data['identification_reminder'] = $config['identification_reminder'];
|
||||
$wizard_data['identification_reminder_timestamp'] = $config['identification_reminder_timestamp'];
|
||||
|
||||
$display_newsletter = display_newsletter ($wizard_data);
|
||||
$display_register = display_register ($wizard_data);
|
||||
$display_forced = ($wizard_data['force_newsletter'] != -1) || ($wizard_data['force_register'] != -1);
|
||||
|
||||
// Return if it is fully completed
|
||||
if ((!$display_register) && (!$display_newsletter)) return;
|
||||
html_debug ($wizard_data, true);
|
||||
|
||||
$return_button = get_parameter ('return_button', 0) == 1;
|
||||
|
||||
$email = db_get_value ('email', 'tusuario', 'id_user', $config['id_user']);
|
||||
//Avoid to show default email
|
||||
if ($email == 'admin@example.com') $email = '';
|
||||
|
||||
// Prints accept register license
|
||||
echo '<div id="login_accept_register" title="' .
|
||||
__('Pandora FMS instance identification wizard') . '" style="">';
|
||||
echo '<div style="font-size: 15pt; margin: 20px; float: left; padding-left: 150px;">';
|
||||
echo html_print_image ('images/support.png', true);
|
||||
echo '</div>';
|
||||
echo '<div style="font-size: 15pt; margin: 20px; float: left;">';
|
||||
echo __('KEEP UPDATED!');
|
||||
echo '</div>';
|
||||
|
||||
echo '<div style="">';
|
||||
$license_text = file('license.lic');
|
||||
$license_text = implode ($license_text);
|
||||
html_print_textarea ("text-license", 1, 65, $license_text,
|
||||
'readonly="readonly"; ', false);
|
||||
echo '</div>';
|
||||
|
||||
echo '<div style="position:absolute; margin: 0 auto; bottom: 0px; right: 10px; border: 1px solid #FFF; width: 570px">';
|
||||
echo '<div style="float: right; width: 20%;">';
|
||||
html_print_submit_button("Finish", 'finish_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
|
||||
echo '</div>';
|
||||
echo '<div style="float: left; width: 20%; display: none;">';
|
||||
html_print_submit_button("Return", 'return_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
|
||||
echo '</div>';
|
||||
echo '<div style="float: left; margin-left: 0px; width: 50%; text-align: left;">';
|
||||
html_print_checkbox('register', 1, false, false, false, 'cursor: \'pointer\'');
|
||||
echo ' <span style="font-size: 12px;" id="label-register">' .__("Accept register Pandora") . '</span><br>';
|
||||
html_print_checkbox('newsletter', 1, false, false, false, 'cursor: \'pointer\'');
|
||||
echo ' <span style="font-size: 12px;" id="label-newsletter">' .__("Subscribe to newsletter") . '</span>';
|
||||
echo "<br>";
|
||||
echo ' <span id="label-email-newsletter"style="font-size: 12px; display: none">' .__("Email") . ': </span>';
|
||||
//html_print_input_text ('email-newsletter', '', '', 30, 255, false);
|
||||
html_print_input_text_extended ('email-newsletter', $email, 'text-email-newsletter', '', 30, 255, false, '', array ("style" => "display:none; ")); echo ' <span id="label-email-newsletter"style="font-size: 12px; display: none">' .__("Email") . ': </span>';
|
||||
echo ' <span id="required-email-newsletter" style="font-size: 9px; display: none; color: red;">'.__("*Required") .' </span>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
// Print yes or not dialog
|
||||
echo '<div id="login_registration_yesno" title="' .
|
||||
__('Pandora FMS instance identification wizard') . '" style="">';
|
||||
echo '<div style="font-size: 15pt; margin: 20px;">';
|
||||
echo __("Do you want to continue without any registration") . "?";
|
||||
echo '</div>';
|
||||
echo '<div style="float: left; width: 50%;">';
|
||||
html_print_submit_button("No", 'no_registration', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
|
||||
echo '</div>';
|
||||
echo '<div style="float: left; width: 50%;">';
|
||||
html_print_submit_button("Yes", 'yes_registration', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
?>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
/* <![CDATA[ */
|
||||
|
||||
//Show newsletter and register checkboxes
|
||||
var display_register = <?php echo json_encode($display_register); ?>;
|
||||
var display_newsletter = <?php echo json_encode($display_newsletter); ?>;
|
||||
var display_forced = <?php echo json_encode($display_forced); ?>;
|
||||
var return_button = <?php echo json_encode($return_button); ?>;
|
||||
|
||||
|
||||
console.log (display_forced + ".");
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//HELPER FUNCTIONS
|
||||
|
||||
function submit_open_wizard (register, newsletter, email, forced) {
|
||||
|
||||
register = register;
|
||||
newsletter = newsletter ? 1 : 0;
|
||||
forced = forced ? 1 : 0;
|
||||
|
||||
jQuery.post ("ajax.php",
|
||||
{"page": "general/login_identification_wizard",
|
||||
"open_wizard": 1,
|
||||
"register_pandora": register,
|
||||
"newsletter": newsletter,
|
||||
"email": email,
|
||||
"forced": forced},
|
||||
function (data) {}
|
||||
);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//EVENT FUNCTIONS
|
||||
$("#submit-return_dialog_button").click (function () {
|
||||
$("#login_accept_register" ).dialog('close');
|
||||
$("#login_id_dialog" ).dialog('open');
|
||||
});
|
||||
|
||||
$("#submit-finish_dialog_button").click (function () {
|
||||
|
||||
var newsletter = $("#checkbox-newsletter").is(':checked') ? 1 : 0;
|
||||
var register = $("#checkbox-register").is(':checked');
|
||||
var email = $("#text-email-newsletter").val();
|
||||
|
||||
if (email == '' && newsletter) {
|
||||
$("#label-email-newsletter").show();
|
||||
$("#text-email-newsletter").show();
|
||||
$("#required-email-newsletter").show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!register && display_register && !display_forced) {
|
||||
$("#login_registration_yesno").dialog('open');
|
||||
} else {
|
||||
submit_open_wizard (1, newsletter, email, display_forced);
|
||||
$("#login_accept_register" ).dialog('close');
|
||||
}
|
||||
});
|
||||
|
||||
$("#submit-no_registration").click (function () {
|
||||
$("#login_registration_yesno").dialog('close');
|
||||
});
|
||||
|
||||
$("#submit-yes_registration").click (function () {
|
||||
var newsletter = $("#checkbox-newsletter").is(':checked') ? 1 : 0;
|
||||
var email = $("#text-email-newsletter").val();
|
||||
submit_open_wizard (0, newsletter, email, display_forced);
|
||||
|
||||
$("#login_registration_yesno").dialog('close');
|
||||
$("#login_accept_register" ).dialog('close');
|
||||
});
|
||||
|
||||
$("#checkbox-newsletter").click (function () {
|
||||
if (!return_button) {
|
||||
$("#label-email-newsletter").show();
|
||||
$("#text-email-newsletter").show();
|
||||
}
|
||||
});
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//DISPLAY
|
||||
$(document).ready (function () {
|
||||
|
||||
$("#login_accept_register").dialog({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 350,
|
||||
width: 630,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
});
|
||||
|
||||
$("#login_registration_yesno").dialog({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 250,
|
||||
width: 350,
|
||||
overlay: {
|
||||
opacity: 1,
|
||||
background: "black"
|
||||
},
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
//Display return button if required
|
||||
if (return_button) {
|
||||
$("#submit-return_dialog_button").show ();
|
||||
}
|
||||
// Remove the completed parts
|
||||
if (!display_register) {
|
||||
$("#checkbox-register").attr ('style', 'display: none !important');
|
||||
$("#label-register").hide ();
|
||||
}
|
||||
if (!display_newsletter) {
|
||||
$("#checkbox-newsletter").attr ('style', 'display: none !important');
|
||||
$("#label-newsletter").hide ();
|
||||
}
|
||||
});
|
||||
|
||||
/* ]]> */
|
||||
</script>
|
|
@ -0,0 +1,185 @@
|
|||
<?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 (is_ajax()) {
|
||||
|
||||
$save_identification = get_parameter ('save_required_wizard', 0);
|
||||
|
||||
// Updates the values get on the identification wizard
|
||||
if ($save_identification) {
|
||||
$email = get_parameter ('email', false);
|
||||
$timezone = get_parameter ('timezone', false);
|
||||
$language = get_parameter ('language', false);
|
||||
|
||||
if ($email !== false) config_update_value ('language', $language);
|
||||
if ($timezone !== false) config_update_value ('timezone', $timezone);
|
||||
if ($email !== false) db_process_sql_update ('tusuario',
|
||||
array ('email' => $email), array('id_user' => $config['id_user']));
|
||||
|
||||
config_update_value ('initial_wizard', 1);
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$email = db_get_value ('email', 'tusuario', 'id_user', $config['id_user']);
|
||||
//Avoid to show default email
|
||||
if ($email == 'admin@example.com') $email = '';
|
||||
|
||||
// Prints first step pandora registration
|
||||
echo '<div id="login_id_dialog" title="' .
|
||||
__('Pandora FMS instance identification wizard') . '" style="display: none;">';
|
||||
|
||||
echo '<div style="font-size: 10pt; margin: 20px;">';
|
||||
echo __('Pandora FMS requires an identification of each administrator. Please, fill next information:');
|
||||
echo '</div>';
|
||||
|
||||
echo '<div style="">';
|
||||
$table = new StdClass();
|
||||
$table->class = 'databox filters';
|
||||
$table->width = '100%';
|
||||
$table->data = array ();
|
||||
$table->size = array();
|
||||
$table->size[0] = '40%';
|
||||
$table->style[0] = 'font-weight:bold';
|
||||
$table->size[1] = '60%';
|
||||
$table->border = '5px solid';
|
||||
|
||||
$table->data[0][0] = __('Language code for Pandora');
|
||||
$table->data[0][1] = html_print_select_from_sql (
|
||||
'SELECT id_language, name FROM tlanguage',
|
||||
'language', $config['language'] , '', '', '', true);
|
||||
|
||||
$zone_name = array('Africa' => __('Africa'), 'America' => __('America'), 'Antarctica' => __('Antarctica'), 'Arctic' => __('Arctic'), 'Asia' => __('Asia'), 'Atlantic' => __('Atlantic'), 'Australia' => __('Australia'), 'Europe' => __('Europe'), 'Indian' => __('Indian'), 'Pacific' => __('Pacific'), 'UTC' => __('UTC'));
|
||||
|
||||
if ($zone_selected == "") {
|
||||
if ($config["timezone"] != "") {
|
||||
list($zone) = explode("/", $config["timezone"]);
|
||||
$zone_selected = $zone;
|
||||
}
|
||||
else {
|
||||
$zone_selected = 'Europe';
|
||||
}
|
||||
}
|
||||
|
||||
$timezones = timezone_identifiers_list();
|
||||
foreach ($timezones as $timezone) {
|
||||
if (strpos($timezone, $zone_selected) !== false) {
|
||||
$timezone_n[$timezone] = $timezone;
|
||||
}
|
||||
}
|
||||
|
||||
$table->data[2][0] = __('Timezone setup'). ' ' . ui_print_help_tip(
|
||||
__('Must have the same time zone as the system or database to avoid mismatches of time.'), true);
|
||||
$table->data[2][1] = html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone()', '', '', true);
|
||||
$table->data[2][1] .= " ". html_print_select($timezone_n, 'timezone', $config["timezone"], '', '', '', true);
|
||||
|
||||
$table->data[4][0] = __('E-mail');
|
||||
$table->data[4][1] = html_print_input_text ('email', $email, '', 50, 255, true);
|
||||
|
||||
html_print_table ($table);
|
||||
echo '</div>';
|
||||
|
||||
echo '<div style="position:absolute; margin: 0 auto; bottom: 0px; right: 10px; border: 1px solid #FFF; width: 570px">';
|
||||
echo '<div style="float: right; width: 20%;">';
|
||||
html_print_submit_button("Register", 'id_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
|
||||
echo '</div>';
|
||||
echo '<div id="all-required" style="float: right; margin-right: 30px; display: none; color: red;">';
|
||||
echo __("All fields required");
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
echo '</div>';
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
/* <![CDATA[ */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//HELPER FUNCTIONS
|
||||
function show_timezone () {
|
||||
zone = $("#zone").val();
|
||||
console.log("Z: " +zone);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: "page=godmode/setup/setup&select_timezone=1&zone=" + zone,
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$("#timezone").empty();
|
||||
jQuery.each (data, function (id, value) {
|
||||
timezone = value;
|
||||
$("select[name='timezone']").append($("<option>").val(timezone).html(timezone));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//EVENT FUNCTIONS
|
||||
$("#submit-id_dialog_button").click (function () {
|
||||
|
||||
//All fields required
|
||||
if ($("#text-email").val() == '') {
|
||||
$("#all-required").show();
|
||||
} else {
|
||||
var timezone = $("#timezone").val();
|
||||
var language = $("#language").val();
|
||||
var email_identification = $("#text-email").val();
|
||||
|
||||
jQuery.post ("ajax.php",
|
||||
{"page": "general/login_required",
|
||||
"save_required_wizard": 1,
|
||||
"email": email_identification,
|
||||
"language": language,
|
||||
"timezone": timezone},
|
||||
function (data) {}
|
||||
);
|
||||
|
||||
$("#login_id_dialog").dialog('close');
|
||||
first_time_identification ();
|
||||
}
|
||||
});
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//DISPLAY
|
||||
$(document).ready (function () {
|
||||
|
||||
$("#login_id_dialog").dialog({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 280,
|
||||
width: 630,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
closeOnEscape: false,
|
||||
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
|
||||
});
|
||||
});
|
||||
|
||||
/* ]]> */
|
||||
</script>
|
|
@ -1195,6 +1195,20 @@ function enterprise_installed() {
|
|||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the license is PANDORA-FREE.
|
||||
*
|
||||
* @return boolean.
|
||||
*/
|
||||
function license_free() {
|
||||
$return = true;
|
||||
|
||||
$pandora_license = db_get_value ('value', 'tupdate_settings', '`key`', 'customer_key');
|
||||
if ($pandora_license !== 'PANDORA-FREE') $return = false;
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Document enterprise functions
|
||||
*/
|
||||
|
|
|
@ -1472,6 +1472,18 @@ function config_process_config () {
|
|||
config_update_value ('max_file_size', "2M");
|
||||
}
|
||||
|
||||
if (!isset ($config["initial_wizard"])) {
|
||||
config_update_value ('initial_wizard', 0);
|
||||
}
|
||||
|
||||
if (!isset ($config["identification_reminder"])) {
|
||||
config_update_value ('identification_reminder', 1);
|
||||
}
|
||||
|
||||
if (!isset ($config["instance_registered"])) {
|
||||
config_update_value ('instance_registered', 0);
|
||||
}
|
||||
|
||||
// eHorus
|
||||
if (!isset($config['ehorus_enabled'])) {
|
||||
config_update_value('ehorus_enabled', 0);
|
||||
|
@ -1663,6 +1675,24 @@ function config_check () {
|
|||
__("Variable disable_functions containts functions system() or exec(), in PHP configuration file (php.ini)"). '<br /><br />' .
|
||||
__('Please, change it on your PHP configuration file (php.ini) or contact with administrator (Dont forget restart apache process after changes)'), __("Problems with disable functions in PHP.INI"));
|
||||
}
|
||||
|
||||
if (license_free() && users_is_admin($config['id_user'])) {
|
||||
//Newsletter advice
|
||||
$newsletter = db_get_value ('middlename', 'tusuario', 'id_user', $config['id_user']);
|
||||
if ($newsletter != 1) {
|
||||
set_pandora_error_for_header(
|
||||
__('Click <a style="font-weight:bold;" href="javascript: force_run_newsletter();"> HERE </a> to init the newsletter subscription process'),
|
||||
__("Missing user in newsletter"));
|
||||
}
|
||||
|
||||
//Registration advice
|
||||
if (!isset ($config['instance_registered']) || ($config['instance_registered'] != 1)) {
|
||||
set_pandora_error_for_header(
|
||||
__('Click <a style="font-weight:bold;" href="javascript: force_run_register();"> HERE </a> to init the registration process'),
|
||||
__("This PandoraFMS instance is not registered"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function config_return_in_bytes($val) {
|
||||
|
|
|
@ -78,6 +78,7 @@ if(session_id() == '') {
|
|||
session_start ();
|
||||
}
|
||||
require_once ("include/config.php");
|
||||
require_once ("include/functions_config.php");
|
||||
|
||||
|
||||
// If metaconsole activated, redirect to it
|
||||
|
@ -602,12 +603,19 @@ if ($old_global_counter_chat != $now_global_counter_chat) {
|
|||
$_SESSION['new_chat'] = true;
|
||||
}
|
||||
|
||||
if ($config['initial_wizard'] != 1) {
|
||||
include_once ("general/login_required.php");
|
||||
}
|
||||
if (get_parameter ('login', 0) !== 0) {
|
||||
// Display news dialog
|
||||
include_once("general/news_dialog.php");
|
||||
|
||||
// Display login help info dialog
|
||||
// If it's configured to not skip this
|
||||
|
||||
if ($config['initial_wizard'] == 1) {
|
||||
include_once("general/login_identification_wizard.php");
|
||||
}
|
||||
if (!isset($config['skip_login_help_dialog']) ||
|
||||
$config['skip_login_help_dialog'] == 0) {
|
||||
|
||||
|
@ -830,6 +838,71 @@ require('include/php_to_js_values.php');
|
|||
};
|
||||
})();
|
||||
|
||||
|
||||
function force_run_register () {
|
||||
run_identification_wizard (1, 0, 0);
|
||||
}
|
||||
function force_run_newsletter () {
|
||||
run_identification_wizard (0, 1, 0);
|
||||
}
|
||||
function first_time_identification () {
|
||||
run_identification_wizard (-1, -1, 1);
|
||||
}
|
||||
var times_fired_register_wizard = 0;
|
||||
function run_identification_wizard (register, newsletter , return_button) {
|
||||
|
||||
if (times_fired_register_wizard) {
|
||||
console.log ("only open");
|
||||
$(".ui-dialog-titlebar-close").show();
|
||||
|
||||
//Reset some values
|
||||
$("#label-email-newsletter").hide();
|
||||
$("#text-email-newsletter").hide();
|
||||
$("#required-email-newsletter").hide();
|
||||
$("#checkbox-register").removeAttr('checked');
|
||||
$("#checkbox-newsletter").removeAttr('checked');
|
||||
|
||||
// Hide or show parts
|
||||
if (register == 1) {
|
||||
$("#checkbox-register").show();
|
||||
$("#label-register").show ();
|
||||
}
|
||||
if (register == 0) {
|
||||
$("#checkbox-register").attr ('style', 'display: none !important');
|
||||
$("#label-register").hide ();
|
||||
}
|
||||
if (newsletter == 1) {
|
||||
$("#checkbox-newsletter").show();
|
||||
$("#label-newsletter").show ();
|
||||
}
|
||||
if (newsletter == 0) {
|
||||
$("#checkbox-newsletter").attr ('style', 'display: none !important');
|
||||
$("#label-newsletter").hide ();
|
||||
}
|
||||
$("#login_accept_register").dialog('open');
|
||||
}
|
||||
else {
|
||||
console.log ("ajax open wizard");
|
||||
$(".ui-dialog-titlebar-close").show();
|
||||
$("#container").append('<div class="id_wizard"></div>');
|
||||
jQuery.get ("ajax.php",
|
||||
{"page": "general/login_identification_wizard",
|
||||
"not_return": 1,
|
||||
"force_register": register,
|
||||
"force_newsletter": newsletter,
|
||||
"return_button": return_button},
|
||||
function (data) {
|
||||
$(".id_wizard").hide ()
|
||||
.empty ()
|
||||
.append (data);
|
||||
},
|
||||
"html"
|
||||
);
|
||||
}
|
||||
times_fired_register_wizard++;
|
||||
return false;
|
||||
}
|
||||
|
||||
//Dynamically assign footer position and width.
|
||||
function adjustFooter() {
|
||||
/*
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis malesuada ante et nibh bibendum vehicula sed a nulla. Vivamus volutpat elit dictum dui mollis lacinia. Cras ac nibh cursus dui dignissim faucibus. Vivamus felis nisi, vulputate eget ipsum ac, tristique volutpat nisi. Curabitur lacinia maximus purus, a gravida purus tempor at. Nullam nec metus quis ligula laoreet consectetur vitae ut massa. Ut commodo nunc in pellentesque imperdiet. Nam justo ex, eleifend sed justo in, rhoncus auctor ex. Nullam commodo nulla in sodales faucibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
|
||||
|
||||
Proin suscipit a quam sed auctor. Fusce commodo, ex vitae congue molestie, lacus leo maximus risus, quis lobortis sem lacus in velit. Sed a egestas nisi. Aenean nec gravida enim, id venenatis enim. Nunc imperdiet porttitor posuere. Nunc tempor at quam ut suscipit. Aenean at bibendum erat, nec pretium sem. Etiam congue eu risus et accumsan. Ut viverra nisl augue, in rutrum nibh tincidunt sit amet. Nunc ac felis auctor, interdum nibh ac, gravida eros. In lacinia, metus pharetra maximus ultricies, diam risus ultrices enim, in posuere nibh nulla a libero. Aenean cursus interdum metus id bibendum.
|
||||
|
||||
Proin vulputate leo sed iaculis ultricies. Nunc et dapibus libero. Aenean vitae mauris sit amet nisl fringilla elementum. Maecenas iaculis ipsum vitae enim vulputate, aliquam sodales dui iaculis. Sed elementum urna at lectus consequat, sed vestibulum arcu mollis. Sed non magna malesuada, condimentum elit et, feugiat ante. Pellentesque a consectetur eros. Fusce aliquet sit amet sem ac fringilla. Praesent sagittis convallis tincidunt. Aliquam et pellentesque neque. Sed consectetur, neque sollicitudin feugiat tincidunt, libero odio tempus ligula, mollis fringilla dui mauris nec sem. Pellentesque pulvinar mauris ac enim consequat, vel pulvinar neque imperdiet.
|
||||
|
||||
Vivamus varius consequat lacus. Sed gravida est a molestie congue. In iaculis lacus magna, a malesuada enim finibus at. Nullam auctor nunc vitae diam vestibulum convallis. Curabitur gravida, metus nec sodales ultrices, leo libero consectetur orci, at rhoncus turpis tortor eget felis. Fusce tempor, leo sed rutrum rhoncus, nisl augue pellentesque purus, et facilisis leo nisi non leo. Nam sed congue erat, vitae sagittis orci. Integer luctus nibh arcu, eu viverra est mollis ac. Sed in tempor dui. Proin a pretium nisi. Sed felis neque, mattis eu nisi fermentum, efficitur semper nulla. Quisque lacinia tellus et odio aliquet eleifend.
|
||||
|
||||
Aliquam gravida ligula in massa blandit, eu semper magna vulputate. Suspendisse potenti. In vitae fringilla metus. Mauris iaculis, ex non condimentum semper, felis lectus rhoncus quam, at consectetur turpis sem vitae sem. Quisque sed turpis diam. In a nunc faucibus, accumsan tellus ut, rhoncus elit. Nulla consequat magna non massa cursus pulvinar.
|
||||
|
||||
Etiam tincidunt sed odio sit amet placerat. Duis mattis dui a placerat aliquet. Etiam finibus orci nec mi dignissim euismod. Suspendisse ac metus sit amet ex lobortis iaculis at vel eros. In finibus lectus non interdum sagittis. Nulla non efficitur odio. Aliquam tempus sagittis gravida. Nam vel magna et leo molestie faucibus a sit amet ipsum. Duis ultricies, enim et rhoncus maximus, est ipsum ornare arcu, ut tempus diam lacus ac dolor.
|
||||
|
||||
In vel condimentum lacus, elementum sodales magna. Etiam porta, neque ac sodales tincidunt, diam mi semper quam, a molestie massa ligula eget ligula. Praesent et sodales enim. Donec in ultrices enim. Etiam dapibus, sem at faucibus vehicula, metus ipsum tempus dolor, id tincidunt neque erat vel nulla. Sed in justo eu ipsum accumsan tempor. Vestibulum blandit metus quam, ac condimentum magna vehicula nec. Integer sagittis ante non sapien efficitur porttitor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ut justo volutpat, venenatis nisi quis, imperdiet lorem. Quisque nec justo id urna convallis rutrum sit amet vitae quam. Nullam scelerisque, sem et egestas bibendum, ipsum nunc lacinia orci, et feugiat ex purus vitae magna.
|
||||
|
||||
Quisque suscipit auctor nisi, nec mattis nisi cursus a. Proin nec turpis ut libero condimentum aliquam eget eleifend arcu. Aliquam commodo sed ante in efficitur. Fusce sollicitudin sit amet felis at ultricies. Praesent pulvinar aliquam malesuada. Praesent vel dolor feugiat, eleifend metus in, molestie arcu. Nunc efficitur, orci eget tristique congue, metus arcu tempor sapien, non ultricies mauris massa vel mauris. Praesent tristique ornare felis, a laoreet tellus varius pharetra. Phasellus ex eros, faucibus quis orci laoreet, commodo mattis magna. Morbi nec nisl finibus, vulputate erat et, fringilla justo.
|
||||
|
||||
Suspendisse semper scelerisque mi, vel faucibus ante hendrerit non. Praesent auctor quam at purus elementum, venenatis faucibus erat mollis. Morbi consequat eu mi a imperdiet. Sed volutpat nunc eget euismod condimentum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vivamus cursus, enim in eleifend egestas, nunc libero congue dui, eget vehicula nulla erat eu nisl. Pellentesque ipsum velit, condimentum non risus nec, hendrerit accumsan arcu. Praesent maximus, augue et tristique rhoncus, est tortor ullamcorper nisl, ut pharetra elit lectus ac nulla. Sed ultricies dignissim arcu. In consequat lectus a aliquet sagittis. Curabitur sit amet arcu ante. Etiam finibus velit tellus, sed consectetur felis euismod nec. Etiam a dui sed sem iaculis molestie. Duis auctor augue nec condimentum cursus. Aliquam volutpat erat urna, eget accumsan tellus dictum tincidunt. Proin nec convallis lorem.
|
||||
|
||||
Donec pulvinar interdum odio. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vestibulum fermentum gravida purus, et dictum elit fermentum id. Sed elementum, neque lobortis consequat sodales, nisi diam efficitur lectus, et blandit enim justo non tortor. Maecenas lacus libero, efficitur ut commodo sit amet, vulputate in felis. Nulla in ullamcorper turpis, vel pellentesque urna. In tempus, nulla eget laoreet maximus, urna velit porttitor est, sed egestas lectus dui vel lectus. Fusce et dictum nibh, iaculis rutrum enim. Vestibulum in consequat augue. Phasellus at sem eget diam suscipit scelerisque nec et justo. Aliquam erat volutpat.
|
|
@ -102,6 +102,7 @@ if (isset ($_GET["modified"]) && !$view_mode) {
|
|||
$upd_info["language"] = get_parameter_post ("language", $user_info["language"]);
|
||||
$upd_info["id_skin"] = get_parameter ("skin", $user_info["id_skin"]);
|
||||
$upd_info["block_size"] = get_parameter ("block_size", $config["block_size"]);
|
||||
$upd_info["firstname"] = get_parameter ("newsletter_reminder", $user_info["first_name"]);
|
||||
$default_block_size = get_parameter ("default_block_size", 0);
|
||||
if($default_block_size) {
|
||||
$upd_info["block_size"] = 0;
|
||||
|
@ -355,7 +356,25 @@ if ($double_auth_enabled) {
|
|||
}
|
||||
// Dialog
|
||||
$data[0] .= "<div id=\"dialog-double_auth\"><div id=\"dialog-double_auth-container\"></div></div>";
|
||||
$table->colspan[count($table->data)][0] = 3;
|
||||
|
||||
// Newsletter
|
||||
if (license_free()) {
|
||||
$data[1] = __('Newsletter Subscribed');
|
||||
$data[1] .= $jump . ui_print_help_tip(__('Subs news'), true);
|
||||
if ($user_info["middlename"]) {
|
||||
$data[1] .= $jump . __('You are subscribed to PandoraFMS newsletter');
|
||||
}
|
||||
else {
|
||||
$data[1] .= $jump . __('Click <a style="font-weight:bold;" href="javascript: force_run_newsletter();"> HERE </a> to init the newsletter subscription process');
|
||||
}
|
||||
|
||||
$data[2] = __('Newsletter Reminder');
|
||||
$data[2] .= ui_print_help_tip(__('Remind news'), true);
|
||||
if ($user_info["firstname"] != 0) $user_info["firstname"] = 1;
|
||||
$data[2] .= html_print_checkbox('newsletter_reminder', 1, $user_info["firstname"], true);
|
||||
} else {
|
||||
$table->colspan[count($table->data)][0] = 3;
|
||||
}
|
||||
$table->rowclass[] = '';
|
||||
$table->rowstyle[] = 'font-weight: bold;';
|
||||
$table->data[] = $data;
|
||||
|
|
Loading…
Reference in New Issue