Fix ldap auth php function passwords with special chars

This commit is contained in:
Calvo 2021-10-05 18:00:16 +02:00
parent d1b9dc4ef8
commit 1fca24d8dc
2 changed files with 3 additions and 3 deletions

View File

@ -770,7 +770,7 @@ function ldap_process_user_login($login, $password)
io_safe_output($config['ldap_base_dn']),
$config['ldap_login_attr'],
io_safe_output($config['ldap_admin_login']),
io_safe_output($config['ldap_admin_pass']),
io_output_password($config['ldap_admin_pass']),
io_safe_output($login)
);
@ -794,7 +794,7 @@ function ldap_process_user_login($login, $password)
} else {
// PHP LDAP function
if ($config['ldap_admin_login'] != '' && $config['ldap_admin_pass'] != '') {
if (!@ldap_bind($ds, io_safe_output($config['ldap_admin_login']), $config['ldap_admin_pass'])) {
if (!@ldap_bind($ds, io_safe_output($config['ldap_admin_login']), io_output_password($config['ldap_admin_pass']))) {
$config['auth_error'] = 'Admin ldap connection fail';
@ldap_close($ds);
return false;

View File

@ -620,7 +620,7 @@ function config_update_config()
$error_update[] = __('Admin LDAP login');
}
if (!config_update_value('ldap_admin_pass', get_parameter('ldap_admin_pass'))) {
if (!config_update_value('ldap_admin_pass', io_input_password(io_safe_output(get_parameter('ldap_admin_pass'))))) {
$error_update[] = __('Admin LDAP password');
}