diff --git a/README.md b/README.md index 5cc77912d5..2a6c68fc2b 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ ![logo Pandora-FMS](https://user-images.githubusercontent.com/8567291/151817953-dc9c4c88-5f3c-459b-98a7-da0534930a2c.png) - -With more than 50,000 customer installations across the five continents, Pandora FMS is an out-of-the-box monitoring solution: profitable and scalable, covering most infrastructure deployment options. +With more than 50,000 customer installations across the five continents, Pandora FMS is an out-of-the-box monitoring solution: profitable and scalable, covering most infrastructure deployment options. Pandora FMS gives you the agility to find and solve problems quickly, scaling them so they can be derived from any source, on-premise, multi cloud or both of them mixed. Now you have that capability across your entire IT stack and analytics to find any problem, even the ones that are hard to find. diff --git a/pandora_console/extras/mr/52.sql b/pandora_console/extras/mr/52.sql index e757dfc6ea..b32d41238c 100644 --- a/pandora_console/extras/mr/52.sql +++ b/pandora_console/extras/mr/52.sql @@ -1,6 +1,8 @@ START TRANSACTION; + ALTER TABLE `tpolicy_queue` MODIFY COLUMN `progress` int(10) NOT NULL default '0'; CREATE INDEX `IDX_tservice_element` ON `tservice_element`(`id_service`,`id_agente_modulo`); +ALTER TABLE `tusuario` ADD COLUMN `local_user` tinyint(1) unsigned NOT NULL DEFAULT 0; ALTER TABLE tevent_response ADD COLUMN display_command tinyint(1) default 0; ALTER TABLE `talert_templates` ADD COLUMN `schedule` TEXT; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 5c190984ae..eaf855798e 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1551,6 +1551,7 @@ ALTER TABLE `tusuario` MODIFY COLUMN `default_event_filter` int(10) unsigned NOT DROP INDEX `fk_id_filter`; ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_user` VARCHAR(60); ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_pass` VARCHAR(45); +ALTER TABLE `tusuario` ADD COLUMN `local_user` tinyint(1) unsigned NOT NULL DEFAULT 0; -- --------------------------------------------------------------------- diff --git a/pandora_console/godmode/agentes/planned_downtime.editor.php b/pandora_console/godmode/agentes/planned_downtime.editor.php index 4eec189958..7b81e1e16d 100644 --- a/pandora_console/godmode/agentes/planned_downtime.editor.php +++ b/pandora_console/godmode/agentes/planned_downtime.editor.php @@ -639,20 +639,20 @@ $table->data[5][1] = " ".ui_get_using_system_timezone_warning().' '.__('Type Periodicity:').' '.html_print_select( - [ - 'weekly' => __('Weekly'), - 'monthly' => __('Monthly'), - ], - 'type_periodicity', - $type_periodicity, - 'change_type_periodicity();', - '', - 0, - true, - false, - true, - '', - $disabled_in_execution + [ + 'weekly' => __('Weekly'), + 'monthly' => __('Monthly'), + ], + 'type_periodicity', + $type_periodicity, + 'change_type_periodicity();', + '', + 0, + true, + false, + true, + '', + $disabled_in_execution )." @@ -672,31 +672,31 @@ $table->data[5][1] = " ".__('From day:').' '.html_print_select( - $days, - 'periodically_day_from', - $periodically_day_from, - '', - '', - 0, - true, - false, - true, - '', - $disabled_in_execution + $days, + 'periodically_day_from', + $periodically_day_from, + '', + '', + 0, + true, + false, + true, + '', + $disabled_in_execution ).' '.__('To day:').' '.html_print_select( - $days, - 'periodically_day_to', - $periodically_day_to, - '', - '', - 0, - true, - false, - true, - '', - $disabled_in_execution + $days, + 'periodically_day_to', + $periodically_day_to, + '', + '', + 0, + true, + false, + true, + '', + $disabled_in_execution ).' '.ui_print_help_tip(__('The end day must be higher than the start day'), true).' @@ -705,26 +705,26 @@ $table->data[5][1] = " '.__('From hour:').' '.html_print_input_text( - 'periodically_time_from', - $periodically_time_from, - '', - 7, - 7, - true, - $disabled_in_execution + 'periodically_time_from', + $periodically_time_from, + '', + 7, + 7, + true, + $disabled_in_execution ).ui_print_help_tip( __('The end time must be higher than the start time'), true ).' '.__('To hour:').' '.html_print_input_text( - 'periodically_time_to', - $periodically_time_to, - '', - 7, - 7, - true, - $disabled_in_execution + 'periodically_time_to', + $periodically_time_to, + '', + 7, + 7, + true, + $disabled_in_execution ).ui_print_help_tip( __('The end time must be higher than the start time'), true @@ -1008,13 +1008,13 @@ $table->data['module'][1] = " ".''.html_print_image( - 'images/cross.png', - true, - [ - 'border' => '0', - 'alt' => __('Delete'), - 'class' => 'invert_filter', - ] + 'images/cross.png', + true, + [ + 'border' => '0', + 'alt' => __('Delete'), + 'class' => 'invert_filter', + ] ).''." diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index b98b651201..d2a3335319 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -4004,23 +4004,23 @@ function print_SLA_list($width, $action, $idItem=null) ], ] ); - if (!empty($services_tmp) - && $services_tmp != ENTERPRISE_NOT_HOOK + if (!empty($services_tmp) + && $services_tmp != ENTERPRISE_NOT_HOOK + ) { + foreach ($services_tmp as $service) { + $check_module_sla = modules_check_agentmodule_exists( + $service['sla_id_module'] + ); + $check_module_sla_value = modules_check_agentmodule_exists( + $service['sla_value_id_module'] + ); + if ($check_module_sla + && $check_module_sla_value ) { - foreach ($services_tmp as $service) { - $check_module_sla = modules_check_agentmodule_exists( - $service['sla_id_module'] - ); - $check_module_sla_value = modules_check_agentmodule_exists( - $service['sla_value_id_module'] - ); - if ($check_module_sla - && $check_module_sla_value - ) { - $services[$service['id']] = $service['name']; - } - } + $services[$service['id']] = $service['name']; } + } + } echo ''; echo html_print_select( diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index 006f4b41da..acce545440 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -285,6 +285,7 @@ if ($new_user && $config['admin_can_add_user']) { $user_info['language'] = 'default'; $user_info['timezone'] = ''; $user_info['not_login'] = false; + $user_info['local_user'] = false; $user_info['strict_acl'] = false; $user_info['session_time'] = 0; $user_info['middlename'] = 0; @@ -370,6 +371,7 @@ if ($create_user) { } $values['not_login'] = (bool) get_parameter('not_login', false); + $values['local_user'] = (bool) get_parameter('local_user', false); $values['middlename'] = get_parameter('middlename', 0); $values['strict_acl'] = (bool) get_parameter('strict_acl', false); $values['session_time'] = (int) get_parameter('session_time', 0); @@ -571,6 +573,7 @@ if ($update_user) { } $values['not_login'] = (bool) get_parameter('not_login', false); + $values['local_user'] = (bool) get_parameter('local_user', false); $values['strict_acl'] = (bool) get_parameter('strict_acl', false); $values['session_time'] = (int) get_parameter('session_time', 0); @@ -1212,6 +1215,18 @@ $not_login .= html_print_checkbox_switch( true ).''; +$local_user = '

'.__('Local user').'

'; +$local_user .= ui_print_help_tip( + __('The user with local authentication enabled will always use local authentication.'), + true +); +$local_user .= html_print_checkbox_switch( + 'local_user', + 1, + $user_info['local_user'], + true +).'
'; + $session_time = '

'.__('Session Time'); $session_time .= ui_print_help_tip( __('This is defined in minutes, If you wish a permanent session should putting -1 in this field.'), @@ -1379,7 +1394,7 @@ if ($id != '' && !$is_err) { echo '

-

Extra info

'.$email.$phone.$not_login.$session_time.'
+

Extra info

'.$email.$phone.$not_login.$local_user.$session_time.'
'.$language.$access_or_pagination.$skin.$home_screen.$default_event_filter.$double_authentication.'
diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index 24e9f713b0..d4a5ea4ce2 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -82,8 +82,15 @@ function process_user_login($login, $pass, $api=false) { global $config; + // 0. Check first is user y set as local user. + $local_user = (bool) db_get_value_filter( + 'local_user', + 'tusuario', + ['id_user' => $login] + ); + // 1. Try remote. - if (strtolower($config['auth']) != 'mysql') { + if ($local_user !== true && strtolower($config['auth']) != 'mysql') { $login_remote = process_user_login_remote( $login, io_safe_output($pass), @@ -97,6 +104,7 @@ function process_user_login($login, $pass, $api=false) if ($login_remote === false && ($config['fallback_local_auth'] || is_user_admin($login) + || $local_user === true || strtolower($config['auth']) == 'mysql') ) { return process_user_login_local($login, $pass, $api); diff --git a/pandora_console/operation/users/user_edit.php b/pandora_console/operation/users/user_edit.php index f76fbfff31..d847e643e9 100644 --- a/pandora_console/operation/users/user_edit.php +++ b/pandora_console/operation/users/user_edit.php @@ -557,13 +557,13 @@ $table_ichanges = '