From b6c00b0b807108cd54ab32fa73f9c196f4f12d97 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 22 Feb 2016 13:33:22 +0100 Subject: Add tests --- src/Wallabag/CoreBundle/Controller/ConfigController.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/Wallabag/CoreBundle/Controller/ConfigController.php') diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 87196b0e..1791eac2 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -58,20 +58,16 @@ class ConfigController extends Controller if ($pwdForm->isValid()) { if ($this->get('craue_config')->get('demo_mode_enabled') && $this->get('craue_config')->get('demo_mode_username') === $user->getUsername()) { - $this->get('session')->getFlashBag()->add( - 'notice', - 'In demonstration mode, you can\'t change password for this user.' - ); + $message = 'In demonstration mode, you can\'t change password for this user.'; } else { + $message = 'Password updated'; + $user->setPlainPassword($pwdForm->get('new_password')->getData()); $userManager->updateUser($user, true); - - $this->get('session')->getFlashBag()->add( - 'notice', - 'Password updated' - ); } + $this->get('session')->getFlashBag()->add('notice', $message); + return $this->redirect($this->generateUrl('config').'#set4'); } -- cgit v1.2.3