- $user->password = common_munge_password($newpassword, $this->scoped);
-
- $val = $user->validate();
- if ($val !== true) {
- // TRANS: Form validation error on page where to change password.
- throw new ServerException(_('Error saving user; invalid.'));
- }
-
- if (!$user->update($original)) {
- // TRANS: Server error displayed on page where to change password when password change
- // TRANS: could not be made because of a server error.
- throw new ServerException(_('Cannot save new password.'));
- }