From d8d56448c993bdf4811a193f96e5ff44ed026417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 18 Feb 2016 13:31:22 +0100 Subject: add a username for demonstration mode --- src/Wallabag/CoreBundle/Controller/ConfigController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 31b59845..9ff79ba9 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -57,18 +57,18 @@ class ConfigController extends Controller $pwdForm->handleRequest($request); if ($pwdForm->isValid()) { - if ($this->getParameter('demo') === false) { - $user->setPlainPassword($pwdForm->get('new_password')->getData()); - $userManager->updateUser($user, true); - + if ($this->getParameter('demo') === true && $this->getParameter('demo_username') === $user->getUsername()) { $this->get('session')->getFlashBag()->add( 'notice', - 'Password updated' + 'In demonstration mode, you can\'t change password for this user.' ); } else { + $user->setPlainPassword($pwdForm->get('new_password')->getData()); + $userManager->updateUser($user, true); + $this->get('session')->getFlashBag()->add( 'notice', - 'In demonstration mode, you can\'t change password.' + 'Password updated' ); } -- cgit v1.2.3