diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index f4c7a7352ea..a6b6b5af1e6 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1907,8 +1907,8 @@ class User extends CommonObject if ($this->pass != $this->pass_indatabase && $this->pass != $this->pass_indatabase_crypted) { // Si mot de passe saisi et different de celui en base $result = $this->setPassword($user, $this->pass, 0, $notrigger, $nosyncmemberpass); - if (!$nbrowsaffected) { - $nbrowsaffected++; + if ($result < 0) { + return -5; } } } @@ -2148,6 +2148,7 @@ class User extends CommonObject } } + // Now, we encrypt the new password $password_crypted = dol_hash($password); }