- $user->password = common_munge_password($newpassword, $user->id);
-
- $val = $user->validate();
- if ($val !== true) {
- // TRANS: Form validation error on page where to change password.
- $this->showForm(_('Error saving user; invalid.'));
- return;
- }
-
- 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.
- $this->serverError(_('Cannot save new password.'));
- return;
- }
- Event::handle('EndChangePassword', array($user));