aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@smile.fr>2016-02-17 17:02:12 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-02-22 11:43:28 +0100
commit6c9f50a6622cdc5c9f975cfb14994db1d9b3ab1b (patch)
tree15c0e663e552273039676d8d6d8cef53d0d6ddfb /src/Wallabag
parent12b5a8cea12c7c8b10ede7fd00d1f07ca06b1033 (diff)
downloadwallabag-6c9f50a6622cdc5c9f975cfb14994db1d9b3ab1b.tar.gz
wallabag-6c9f50a6622cdc5c9f975cfb14994db1d9b3ab1b.tar.zst
wallabag-6c9f50a6622cdc5c9f975cfb14994db1d9b3ab1b.zip
Demonstration mode to prevent password changes
Diffstat (limited to 'src/Wallabag')
-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 }