$email), array('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, array('field1' => $email,
'field1_recovery' => $email));
}
config_update_value ('initial_wizard', 1);
}
//Change the language if is change in checkbox
if ($change_language !== 0) {
config_update_value ('language', $change_language);
}
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 '
';
echo '
';
echo __('Please fill the following information in order to configure your Pandora FMS instance successfully') . '.';
echo '
';
echo '
';
$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_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);
html_print_table ($table);
echo '
';
echo '
';
echo '
';
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 '
';
echo '
';
echo __("All fields required");
echo '
';
echo '
';
echo '
';
?>