diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@smile.fr> | 2016-02-18 13:31:22 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-02-22 11:43:29 +0100 |
commit | d8d56448c993bdf4811a193f96e5ff44ed026417 (patch) | |
tree | c0d518e96fde7076f0c5d2885c449ac7df8e1305 /src/Wallabag | |
parent | c3b43c8a3ee5bc65296110a8c57c037461089745 (diff) | |
download | wallabag-d8d56448c993bdf4811a193f96e5ff44ed026417.tar.gz wallabag-d8d56448c993bdf4811a193f96e5ff44ed026417.tar.zst wallabag-d8d56448c993bdf4811a193f96e5ff44ed026417.zip |
add a username for demonstration mode
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/ConfigController.php | 12 |
1 files changed, 6 insertions, 6 deletions
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 | |||
57 | $pwdForm->handleRequest($request); | 57 | $pwdForm->handleRequest($request); |
58 | 58 | ||
59 | if ($pwdForm->isValid()) { | 59 | if ($pwdForm->isValid()) { |
60 | if ($this->getParameter('demo') === false) { | 60 | if ($this->getParameter('demo') === true && $this->getParameter('demo_username') === $user->getUsername()) { |
61 | $user->setPlainPassword($pwdForm->get('new_password')->getData()); | ||
62 | $userManager->updateUser($user, true); | ||
63 | |||
64 | $this->get('session')->getFlashBag()->add( | 61 | $this->get('session')->getFlashBag()->add( |
65 | 'notice', | 62 | 'notice', |
66 | 'Password updated' | 63 | 'In demonstration mode, you can\'t change password for this user.' |
67 | ); | 64 | ); |
68 | } else { | 65 | } else { |
66 | $user->setPlainPassword($pwdForm->get('new_password')->getData()); | ||
67 | $userManager->updateUser($user, true); | ||
68 | |||
69 | $this->get('session')->getFlashBag()->add( | 69 | $this->get('session')->getFlashBag()->add( |
70 | 'notice', | 70 | 'notice', |
71 | 'In demonstration mode, you can\'t change password.' | 71 | 'Password updated' |
72 | ); | 72 | ); |
73 | } | 73 | } |
74 | 74 | ||