diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/ConfigController.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/ConfigController.php | 14 |
1 files changed, 5 insertions, 9 deletions
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 | |||
58 | 58 | ||
59 | if ($pwdForm->isValid()) { | 59 | if ($pwdForm->isValid()) { |
60 | if ($this->get('craue_config')->get('demo_mode_enabled') && $this->get('craue_config')->get('demo_mode_username') === $user->getUsername()) { | 60 | if ($this->get('craue_config')->get('demo_mode_enabled') && $this->get('craue_config')->get('demo_mode_username') === $user->getUsername()) { |
61 | $this->get('session')->getFlashBag()->add( | 61 | $message = 'In demonstration mode, you can\'t change password for this user.'; |
62 | 'notice', | ||
63 | 'In demonstration mode, you can\'t change password for this user.' | ||
64 | ); | ||
65 | } else { | 62 | } else { |
63 | $message = 'Password updated'; | ||
64 | |||
66 | $user->setPlainPassword($pwdForm->get('new_password')->getData()); | 65 | $user->setPlainPassword($pwdForm->get('new_password')->getData()); |
67 | $userManager->updateUser($user, true); | 66 | $userManager->updateUser($user, true); |
68 | |||
69 | $this->get('session')->getFlashBag()->add( | ||
70 | 'notice', | ||
71 | 'Password updated' | ||
72 | ); | ||
73 | } | 67 | } |
74 | 68 | ||
69 | $this->get('session')->getFlashBag()->add('notice', $message); | ||
70 | |||
75 | return $this->redirect($this->generateUrl('config').'#set4'); | 71 | return $this->redirect($this->generateUrl('config').'#set4'); |
76 | } | 72 | } |
77 | 73 | ||