Added new setup menu to mail

This commit is contained in:
Arturo Gonzalez 2017-04-20 12:15:45 +02:00
parent df80304a80
commit a1f23af142
4 changed files with 45 additions and 6 deletions

View File

@ -249,6 +249,7 @@ if (check_acl ($config['id_user'], 0, "PM")) {
enterprise_hook ('enterprise_submenu');
enterprise_hook ('historydb_submenu');
enterprise_hook ('log_collector_submenu');
enterprise_hook ('mail_submenu');
$sub2["godmode/setup/setup&section=auth"]["text"] = __('Authentication');
$sub2["godmode/setup/setup&section=auth"]["refr"] = 0;

View File

@ -708,6 +708,20 @@ function config_update_config () {
if (!config_update_value ('history_db_delay', get_parameter ('history_db_delay')))
$error_update[] = __('Delay');
break;
case 'mail':
if (!config_update_value ('email_from_dir', get_parameter('email_from_dir')))
$error_update[] = __('From dir');
if (!config_update_value ('email_from_name', get_parameter('email_from_name')))
$error_update[] = __('From name');
if (!config_update_value ('email_smtpServer', get_parameter('email_smtpServer')))
$error_update[] = __('Server SMTP');
if (!config_update_value ('email_smtpPort', (int)get_parameter('email_smtpPort')))
$error_update[] = __('Port SMTP');
if (!config_update_value ('email_username', get_parameter('email_username')))
$error_update[] = __('Email user');
if (!config_update_value ('email_password', get_parameter('email_password')))
$error_update[] = __('Email password');
break;
case 'ehorus':
if (!config_update_value('ehorus_enabled', (int) get_parameter('ehorus_enabled', $config['ehorus_enabled'])))
$error_update[] = __('Enable eHorus');
@ -1187,7 +1201,31 @@ function config_process_config () {
if (!isset ($config['history_db_delay'])) {
config_update_value ( 'history_db_delay', 0);
}
if (!isset ($config['email_from_dir'])) {
config_update_value ( 'email_from_dir', "pandora@pandorafms.org");
}
if (!isset ($config['email_from_name'])) {
config_update_value ( 'email_from_name', "Pandora FMS");
}
if (!isset ($config['email_smtpServer'])) {
config_update_value ( 'email_smtpServer', "127.0.0.1");
}
if (!isset ($config['email_smtpPort'])) {
config_update_value ( 'email_smtpPort', 25);
}
if (!isset ($config['email_username'])) {
config_update_value ( 'email_username', "");
}
if (!isset ($config['email_password'])) {
config_update_value ( 'email_password', "");
}
if (!isset ($config['activate_gis'])) {
config_update_value ( 'activate_gis', 0);
}

View File

@ -36,8 +36,7 @@ function clippy_extension_cron_send_email() {
'intro' => '<table>' .
'<tr>' .
'<td class="context_help_body">' .
__('The configuration of email for the task email is in the file:') . '<br />' .
'&lt;www&gt;/pandora_console/enterprise/extensions/cron/email_config.php <br />' .
__('The configuration of email for the task email is in the mail setup:') . '<br />' .
__('Please check if the email configuration is correct.') .
'</td>' .
'</tr>' .

View File

@ -547,6 +547,10 @@ if (! isset ($config['id_user'])) {
}
// There is no user connected
else {
if ($config['enterprise_installed']) {
enterprise_include_once ('include/functions_reset_pass.php');
}
$correct_pass_change = (boolean)get_parameter('correct_pass_change', 0);
$reset = (boolean)get_parameter('reset', 0);
$first = (boolean)get_parameter('first', 0);
@ -599,9 +603,6 @@ if (! isset ($config['id_user'])) {
}
}
else {
if ($config['enterprise_installed']) {
enterprise_include_once ('include/functions_reset_pass.php');
}
if (!$reset) {
require_once ('general/login_page.php');
}