diff --git a/pandora_console/extras/mr/51.sql b/pandora_console/extras/mr/51.sql index 2a6de782c6..da52a569d1 100644 --- a/pandora_console/extras/mr/51.sql +++ b/pandora_console/extras/mr/51.sql @@ -41,4 +41,6 @@ ALTER TABLE `talert_special_days` ADD FOREIGN KEY (`id_calendar`) REFERENCES `ta ALTER TABLE `tagent_repository` ADD COLUMN `deployment_timeout` INT UNSIGNED DEFAULT 600 AFTER `path`; +UPDATE `tconfig` c1 JOIN (select count(*) as n FROM `tconfig` c2 WHERE (c2.`token` = "node_metaconsole" AND c2.`value` = 1) OR (c2.`token` = "centralized_management" AND c2.`value` = 1) ) v SET c1. `value` = 0 WHERE c1.token = "autocreate_remote_users" AND v.n = 2; + COMMIT; 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 536aa8f22d..ba0c0c32e3 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 @@ -4264,3 +4264,5 @@ UPDATE `talert_special_days` set `day_code` = 7 WHERE `same_day` = 'sunday'; ALTER TABLE `talert_special_days` DROP COLUMN `same_day`; ALTER TABLE `talert_special_days` ADD FOREIGN KEY (`id_calendar`) REFERENCES `talert_calendar`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; + +UPDATE `tconfig` c1 JOIN (select count(*) as n FROM `tconfig` c2 WHERE (c2.`token` = "node_metaconsole" AND c2.`value` = 1) OR (c2.`token` = "centralized_management" AND c2.`value` = 1) ) v SET c1. `value` = 0 WHERE c1.token = "autocreate_remote_users" AND v.n = 2; diff --git a/pandora_console/godmode/setup/setup_auth.php b/pandora_console/godmode/setup/setup_auth.php index d0177731e2..ea3397b30f 100644 --- a/pandora_console/godmode/setup/setup_auth.php +++ b/pandora_console/godmode/setup/setup_auth.php @@ -60,6 +60,7 @@ if (is_ajax()) { $table->data['fallback_local_auth'] = $row; if (enterprise_installed()) { + $is_management_allowed = is_management_allowed(); // Autocreate remote users. $row = []; $row['name'] = __('Autocreate remote users'); @@ -67,7 +68,7 @@ if (is_ajax()) { 'autocreate_remote_users', 1, $config['autocreate_remote_users'], - false, + (is_metaconsole() === false) ? !$is_management_allowed : false, '', '', true