= $config['license_expiry_date']) {
return true;
}
return false;
}
/**
* Parses responses from configuration wizard.
*
* @return void
*/
function config_wiz_process()
{
global $config;
$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',
['email' => $email],
['id_user' => $config['id_user']]
);
}
// Update the alert action Mail to XXX/Administrator
// if it is set to default.
$mail_check = 'yourmail@domain.es';
$mail_alert = alerts_get_alert_action_field1(1);
if ($mail_check === $mail_alert && $email !== false) {
alerts_update_alert_action(
1,
[
'field1' => $email,
'field1_recovery' => $email,
]
);
}
config_update_value('initial_wizard', 1);
}
/**
* Generates base code to print main configuration modal.
*
* Asks for timezone, mail.
*
* @param boolean $return Print output or not.
* @param boolean $launch Process JS modal.
* @param string $callback Call to JS function at end.
*
* @return string HTML.
*/
function config_wiz_modal(
$return=false,
$launch=true,
$callback=false
) {
global $config;
$email = db_get_value('email', 'tusuario', 'id_user', $config['id_user']);
// Avoid to show default email.
if ($email == 'admin@example.com') {
$email = '';
}
$output = '';
// Prints first step pandora registration.
$output .= '
';
$output .= '
';
$output .= __('Please fill the following information in order to configure your %s instance successfully', get_product_name()).'.';
$output .= '
';
$output .= '
';
$table = new StdClass();
$table->class = 'databox filters';
$table->width = '100%';
$table->data = [];
$table->size = [];
$table->size[0] = '40%';
$table->style[0] = 'font-weight:bold';
$table->size[1] = '60%';
$table->border = '5px solid';
$table->data[0][0] = __('Language code');
$table->data[0][1] = html_print_select_from_sql(
'SELECT id_language, name FROM tlanguage',
'language',
$config['language'],
'',
'',
'',
true
);
$zone_name = [
'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'] != '') {
$zone_array = explode('/', $config['timezone']);
$zone_selected = $zone_array[0];
} else {
$zone_selected = 'Europe';
}
}
$timezones = timezone_identifiers_list();
foreach ($timezones as $timezone) {
if (strpos($timezone, $zone_selected) !== false) {
$timezone_country = preg_replace('/^.*\//', '', $timezone);
$timezone_n[$timezone] = $timezone_country;
}
}
$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 for receiving alerts');
$table->data[4][1] = html_print_input_text('email', $email, '', 50, 255, true);
$output .= html_print_table($table, true);
$output .= '
';
$output .= '
';
$output .= html_print_submit_button(
__('Cancel'),
'cancel',
false,
'class="ui-widget ui-state-default ui-corner-all ui-button-text-only sub cancel submit-cancel" style="width:100px;"',
true
);
$output .= '
';
$output .= '
';
$output .= html_print_submit_button(
__('Continue'),
'register-next',
false,
'class="ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next" style="width:100px;"',
true
);
$output .= '
';
$output .= '
';
$output .= __('All fields required');
$output .= '
';
$output .= '
';
$output .= '';
// Verification modal.
$output .= '';
$output .= '
';
$output .= html_print_image('images/pandora_circle_big.png', true);
$output .= '
';
$output .= '
';
$output .= __(
'Keep this %s console up to date with latest updates.',
$product_name
);
$output .= '
';
$output .= '
';
$output .= '
';
$output .= __('When you subscribe to the %s Update Manager service, you accept that we register your %s instance as an identifier on a database owned by %s. This data will solely be used to provide you with information about %s and will not be conceded to third parties. You can unregister from said database at any time from the Update Manager options.', $product_name, $product_name, $product_name, $product_name);
$output .= '
';
$output .= '
';
$output .= '
';
$output .= '
';
$output .= '
';
$output .= '
';
// Verification modal.
$output .= '';
$output .= '
';
$output .= html_print_image('images/pandora_circle_big.png', true);
$output .= '
';
$output .= '
';
$output .= __(
'Subscribe to our newsletter',
$product_name
);
$output .= '
';
$output .= '
';
$output .= '
Stay up to date with updates, upgrades and promotions by subscribing to our newsletter.
';
$output .= '
';
$output .= __(
'By subscribing to the newsletter, you accept that your email will be transferred to a database owned by %s. These data will be used only to provide you with information about %s and will not be given to third parties. You can unsubscribe from this database at any time from the newsletter subscription options.',
$product_name,
$product_name
);
$output .= '
';
$output .= '
';
// Show regiter to newsletter state.
$show_newsletter = ($display_newsletter !== true) ? 'inline-block' : 'none';
$output .= '
';
$output .= '
';
$output .= ''.__('Email').' ';
$output .= html_print_input_text_extended(
'email-newsletter',
$email,
'text-email-newsletter',
'',
30,
255,
false,
'',
['style' => 'display:'.$show_newsletter.'; width: 200px;'],
true
);
$output .= '
';
$output .= '
';
$output .= '
';
$output .= '
';
$output .= '
';
$output .= '
';
// Verification modal.
$output .= '