fixed several bugs in AD authentication in metaconsole

This commit is contained in:
alejandro.campos@artica.es 2021-10-29 16:12:23 +02:00
parent 14076efc69
commit b4c21cfdca
2 changed files with 14 additions and 6 deletions

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
) {