aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index 6eb621d8..04b54644 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -57,13 +57,20 @@ 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->getParameter('demo') === false) {
61 $userManager->updateUser($user, true); 61 $user->setPlainPassword($pwdForm->get('new_password')->getData());
62 62 $userManager->updateUser($user, true);
63 $this->get('session')->getFlashBag()->add( 63
64 'notice', 64 $this->get('session')->getFlashBag()->add(
65 'Password updated' 65 'notice',
66 ); 66 'Password updated'
67 );
68 } else {
69 $this->get('session')->getFlashBag()->add(
70 'notice',
71 'In demonstration mode, you can`t change password.'
72 );
73 }
67 74
68 return $this->redirect($this->generateUrl('config').'#set4'); 75 return $this->redirect($this->generateUrl('config').'#set4');
69 } 76 }