From e9c91c19475ed679676829bfd716e41009b560c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 30 Apr 2020 23:44:11 +0200 Subject: [PATCH] Allow group users to change their password --- .../private/websites/tools/tools/landing/ldap_password.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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!"; -- 2.41.0