Merge remote-tracking branch 'origin/develop' into ent-7503-Calendarios-para-dias-especiales

This commit is contained in:
Daniel Barbero Martin 2021-11-03 11:16:46 +01:00
commit 53361484fd
6 changed files with 29 additions and 17 deletions

View File

@ -1450,13 +1450,13 @@ ALTER TABLE `ttag` MODIFY COLUMN `name` text NOT NULL default '';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 49);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 50);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package', 757);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package', 758);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password';

View File

@ -1321,6 +1321,8 @@ if (isset($double_authentication)) {
if ($meta) {
enterprise_include_once('include/functions_metaconsole.php');
$access_node = db_get_value('metaconsole_access_node', 'tusuario', 'id_user', $id);
$metaconsole_agents_manager = '<div class="label_select_simple" id="metaconsole_agents_manager_div"><p class="edit_user_labels">'.__('Enable agents managment').'</p>';
$metaconsole_agents_manager .= html_print_checkbox_switch(
'metaconsole_agents_manager',
@ -1342,7 +1344,7 @@ if ($meta) {
$metaconsole_access_node .= html_print_checkbox(
'metaconsole_access_node',
1,
$user_info['metaconsole_access_node'],
$access_node,
true
).'</div>';
}

View File

@ -349,18 +349,24 @@ function process_user_login_remote($login, $pass, $api=false)
return false;
}
$user_info = [
'fullname' => $login,
'comments' => 'Imported from '.$config['auth'],
];
if (is_metaconsole() === true) {
$user_info['metaconsole_access_node'] = $config['ad_adv_user_node'];
}
// Create the user.
if (enterprise_hook(
'prepare_permissions_groups_of_user_ad',
[
$login,
$pass,
[
'fullname' => $login,
'comments' => 'Imported from '.$config['auth'],
],
$user_info,
false,
defined('METACONSOLE'),
defined('METACONSOLE') && is_centralized() === false,
]
) === false
) {
@ -373,6 +379,10 @@ function process_user_login_remote($login, $pass, $api=false)
return false;
}
if (is_metaconsole() === true) {
$user_info['metaconsole_access_node'] = $config['ldap_adv_user_node'];
}
$permissions = fill_permissions_ldap($sr);
if (empty($permissions) === true) {
$config['auth_error'] = __('User not found in database or incorrect password');
@ -387,7 +397,7 @@ function process_user_login_remote($login, $pass, $api=false)
$pass,
$user_info,
$permissions,
is_metaconsole()
is_metaconsole() && is_centralized() === false
);
}
} else {

View File

@ -1732,9 +1732,9 @@ function is_management_allowed($hkey='')
$nodes = (int) $nodes;
}
return ( (is_metaconsole() && (is_centrallised() || $nodes === 0))
|| (!is_metaconsole() && !is_centrallised())
|| (!is_metaconsole() && is_centrallised()) && $hkey == generate_hash_to_api());
return ( (is_metaconsole() && (is_centralized() || $nodes === 0))
|| (!is_metaconsole() && !is_centralized())
|| (!is_metaconsole() && is_centralized()) && $hkey == generate_hash_to_api());
}
@ -1743,7 +1743,7 @@ function is_management_allowed($hkey='')
*
* @return boolean
*/
function is_centrallised()
function is_centralized()
{
global $config;
@ -1763,7 +1763,7 @@ function is_centrallised()
*/
function is_central_policies()
{
return is_metaconsole() && is_centrallised();
return is_metaconsole() && is_centralized();
}

View File

@ -452,7 +452,7 @@ if (check_acl($config['id_user'], 0, 'ER')) {
$autorefresh_list_out = [];
if (is_metaconsole() === false || is_centrallised() === true) {
if (is_metaconsole() === false || is_centralized() === true) {
$autorefresh_list_out['operation/agentes/estado_agente'] = 'Agent detail';
$autorefresh_list_out['operation/agentes/alerts_status'] = 'Alert detail';
$autorefresh_list_out['enterprise/operation/cluster/cluster'] = 'Cluster view';

View File

@ -109,10 +109,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
('custom_report_front_header', ''),
('custom_report_front_footer', ''),
('MR', 49),
('MR', 50),
('identification_reminder', 1),
('identification_reminder_timestamp', 0),
('current_package', 757),
('current_package', 758),
('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.00097656250000":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}'),
('custom_docs_logo', 'default_docs.png'),
('custom_support_logo', 'default_support.png'),