aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/ConfigController.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/ConfigController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index 6eb621d8..1791eac2 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -57,13 +57,16 @@ class ConfigController extends Controller
57 $pwdForm->handleRequest($request); 57 $pwdForm->handleRequest($request);
58 58
59 if ($pwdForm->isValid()) { 59 if ($pwdForm->isValid()) {
60 $user->setPlainPassword($pwdForm->get('new_password')->getData()); 60 if ($this->get('craue_config')->get('demo_mode_enabled') && $this->get('craue_config')->get('demo_mode_username') === $user->getUsername()) {
61 $userManager->updateUser($user, true); 61 $message = 'In demonstration mode, you can\'t change password for this user.';
62 } else {
63 $message = 'Password updated';
62 64
63 $this->get('session')->getFlashBag()->add( 65 $user->setPlainPassword($pwdForm->get('new_password')->getData());
64 'notice', 66 $userManager->updateUser($user, true);
65 'Password updated' 67 }
66 ); 68
69 $this->get('session')->getFlashBag()->add('notice', $message);
67 70
68 return $this->redirect($this->generateUrl('config').'#set4'); 71 return $this->redirect($this->generateUrl('config').'#set4');
69 } 72 }