Ent 5296 anadir boton guardar contrasena en active directory
This commit is contained in:
parent
b18bbbf237
commit
85a41af644
|
@ -261,7 +261,16 @@ function process_user_login_remote($login, $pass, $api=false)
|
||||||
if (($config['auth'] === 'ad')) {
|
if (($config['auth'] === 'ad')) {
|
||||||
// Check if autocreate remote users is active.
|
// Check if autocreate remote users is active.
|
||||||
if ($config['autocreate_remote_users'] == 1) {
|
if ($config['autocreate_remote_users'] == 1) {
|
||||||
change_local_user_pass_ldap($login, $pass);
|
if ($config['ad_save_password']) {
|
||||||
|
$update_credentials = change_local_user_pass_ldap($login, $pass);
|
||||||
|
|
||||||
|
if ($update_credentials) {
|
||||||
|
$config['auth_error'] = __('Your permissions have changed. Please, login again.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
delete_user_pass_ldap($login);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($config['ad_advanced_config']) && $config['ad_advanced_config']) {
|
if (isset($config['ad_advanced_config']) && $config['ad_advanced_config']) {
|
||||||
|
@ -948,7 +957,7 @@ function create_user_and_permisions_ldap(
|
||||||
$values = $user_info;
|
$values = $user_info;
|
||||||
$values['id_user'] = $id_user;
|
$values['id_user'] = $id_user;
|
||||||
|
|
||||||
if ($config['ldap_save_password']) {
|
if ($config['ldap_save_password'] || $config['ad_save_password']) {
|
||||||
$values['password'] = md5($password);
|
$values['password'] = md5($password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -720,6 +720,14 @@ function config_update_config()
|
||||||
if (!config_update_value('session_timeout', get_parameter('session_timeout'))) {
|
if (!config_update_value('session_timeout', get_parameter('session_timeout'))) {
|
||||||
$error_update[] = __('Session timeout');
|
$error_update[] = __('Session timeout');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($config['fallback_local_auth']) && $config['fallback_local_auth'] == 0) {
|
||||||
|
if (!config_update_value('ad_save_password', get_parameter('ad_save_password'))) {
|
||||||
|
$error_update[] = __('Save Password');
|
||||||
|
}
|
||||||
|
} else if (isset($config['fallback_local_auth']) && $config['fallback_local_auth'] == 1) {
|
||||||
|
config_update_value('ad_save_password', 1);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'perf':
|
case 'perf':
|
||||||
|
|
Loading…
Reference in New Issue