/** * @param UI\Form $form */ public function changePasswordFormSucceeded(UI\Form $form) { try { $values = $form->getValues(); $this->userManager->changeUserPassword($values->old_password, $values->new_password, $this->getUser()->getId()); $form->setValues(array(), TRUE); $this->flashMessage('Your password change was successful.'); } catch (\Aprila\InvalidArgumentException $e) { $this->flashMessage('Fill your current password correctly.', 'error'); } }