From 6c9f50a6622cdc5c9f975cfb14994db1d9b3ab1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 17 Feb 2016 17:02:12 +0100 Subject: Demonstration mode to prevent password changes --- .../CoreBundle/Controller/ConfigController.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/Wallabag/CoreBundle/Controller') 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 $pwdForm->handleRequest($request); if ($pwdForm->isValid()) { - $user->setPlainPassword($pwdForm->get('new_password')->getData()); - $userManager->updateUser($user, true); - - $this->get('session')->getFlashBag()->add( - 'notice', - 'Password updated' - ); + if ($this->getParameter('demo') === false) { + $user->setPlainPassword($pwdForm->get('new_password')->getData()); + $userManager->updateUser($user, true); + + $this->get('session')->getFlashBag()->add( + 'notice', + 'Password updated' + ); + } else { + $this->get('session')->getFlashBag()->add( + 'notice', + 'In demonstration mode, you can`t change password.' + ); + } return $this->redirect($this->generateUrl('config').'#set4'); } -- cgit v1.2.3