Add access node in auth ad method in all cases. Gitlab: #367
This commit is contained in:
parent
ef0f55e2c2
commit
c7e1d682df
|
@ -306,11 +306,14 @@ function process_user_login_remote ($login, $pass, $api = false) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
$user_info = array ('fullname' => $login,
|
||||||
|
'comments' => 'Imported from ' . $config['auth']);
|
||||||
|
if ( is_metaconsole() && $config["auth"] === 'ad')
|
||||||
|
$user_info['metaconsole_access_node'] = $config['ad_adv_user_node'];
|
||||||
|
|
||||||
// Create the user in the local database
|
// Create the user in the local database
|
||||||
if (create_user ($login, $pass,
|
if (create_user ($login, $pass, $user_info ) === false) {
|
||||||
array ('fullname' => $login,
|
|
||||||
'comments' => 'Imported from ' . $config['auth'])
|
|
||||||
) === false) {
|
|
||||||
$config["auth_error"] = __("User not found in database or incorrect password");
|
$config["auth_error"] = __("User not found in database or incorrect password");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -339,7 +342,7 @@ function process_user_login_remote ($login, $pass, $api = false) {
|
||||||
foreach ($servers as $server) {
|
foreach ($servers as $server) {
|
||||||
$perfil_maestro = db_get_row('tperfil',
|
$perfil_maestro = db_get_row('tperfil',
|
||||||
'id_perfil', $config['default_remote_profile']);
|
'id_perfil', $config['default_remote_profile']);
|
||||||
|
|
||||||
if (metaconsole_connect($server) == NOERR ) {
|
if (metaconsole_connect($server) == NOERR ) {
|
||||||
|
|
||||||
if (!profile_exist($perfil_maestro['name'])) {
|
if (!profile_exist($perfil_maestro['name'])) {
|
||||||
|
@ -350,10 +353,12 @@ function process_user_login_remote ($login, $pass, $api = false) {
|
||||||
$id_profile = db_get_value('id_perfil', 'tperfil', 'name', $perfil_maestro['name']);
|
$id_profile = db_get_value('id_perfil', 'tperfil', 'name', $perfil_maestro['name']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (create_user ($login, $pass,
|
if ($config["auth"] === 'ad') {
|
||||||
array ('fullname' => $login,
|
unset($user_info['metaconsole_access_node']);
|
||||||
'comments' => 'Imported from ' . $config['auth'])
|
$user_info['not_login'] = (int) !$config['ad_adv_user_node'];
|
||||||
) === false)
|
}
|
||||||
|
|
||||||
|
if (create_user ($login, $pass, $user_info) === false)
|
||||||
continue;
|
continue;
|
||||||
profile_create_user_profile ($login, $id_profile,
|
profile_create_user_profile ($login, $id_profile,
|
||||||
$config['default_remote_group'], false, $config['default_assign_tags']);
|
$config['default_remote_group'], false, $config['default_assign_tags']);
|
||||||
|
|
Loading…
Reference in New Issue