Merge branch 'ent-8066-errores-ldap-con-simbolos-en-la-pass-PHP' into 'develop'

Fix ldap auth php function passwords with special chars

See merge request artica/pandorafms!4444
This commit is contained in:
Daniel Rodriguez 2021-11-16 14:12:27 +00:00
commit 7c7402e5fb
2 changed files with 3 additions and 3 deletions

View File

@ -780,7 +780,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)
);
@ -804,7 +804,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');
}