]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Controller/ConfigController.php
Fix translations mistake
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Controller / ConfigController.php
index 04b54644385516d1d54032e7ca11886e1e4c74bb..1791eac23719e09ba34929ab0dd36ef162599107 100644 (file)
@@ -57,21 +57,17 @@ class ConfigController extends Controller
         $pwdForm->handleRequest($request);
 
         if ($pwdForm->isValid()) {
-            if ($this->getParameter('demo') === false) {
+            if ($this->get('craue_config')->get('demo_mode_enabled') && $this->get('craue_config')->get('demo_mode_username') === $user->getUsername()) {
+                $message = 'In demonstration mode, you can\'t change password for this user.';
+            } else {
+                $message = 'Password updated';
+
                 $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.'
-                );
             }
 
+            $this->get('session')->getFlashBag()->add('notice', $message);
+
             return $this->redirect($this->generateUrl('config').'#set4');
         }