]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Allow group users to change their password
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 30 Apr 2020 21:44:11 +0000 (23:44 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 30 Apr 2020 21:44:11 +0000 (23:44 +0200)
modules/private/websites/tools/tools/landing/ldap_password.php

index 54448a46c9379b04e61a24985f7c9f3ef2ee9120..8b1f80f35b85bf88ff1021f6d99f3a98e92354cf 100644 (file)
@@ -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!";