From: Ismaƫl Bouya Date: Thu, 30 Apr 2020 21:44:11 +0000 (+0200) Subject: Allow group users to change their password X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=commitdiff_plain;h=e9c91c19475ed679676829bfd716e41009b560c8 Allow group users to change their password --- diff --git a/modules/private/websites/tools/tools/landing/ldap_password.php b/modules/private/websites/tools/tools/landing/ldap_password.php index 54448a4..8b1f80f 100644 --- a/modules/private/websites/tools/tools/landing/ldap_password.php +++ b/modules/private/websites/tools/tools/landing/ldap_password.php @@ -31,8 +31,11 @@ function changePassword($user,$oldPassword,$newPassword,$newPasswordCnf){ $user_dn = "uid=$user,ou=users,dc=immae,dc=eu"; if (ldap_bind($con, $user_dn, $oldPassword) === false) { - $message[] = "Error E101 - Current Username or Password is wrong."; - return false; + $user_dn = "uid=$user,ou=group_users,dc=immae,dc=eu"; + if (ldap_bind($con, $user_dn, $oldPassword) === false) { + $message[] = "Error E101 - Current Username or Password is wrong."; + return false; + } } if ($newPassword != $newPasswordCnf ) { $message[] = "Error E102 - Your New passwords do not match!";