]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Use internal config instead for demo
authorJeremy Benoist <jeremy.benoist@gmail.com>
Mon, 22 Feb 2016 10:38:25 +0000 (11:38 +0100)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Mon, 22 Feb 2016 10:44:39 +0000 (11:44 +0100)
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml
app/config/parameters.yml.dist
app/config/tests/parameters.yml.dist.mysql
app/config/tests/parameters.yml.dist.pgsql
app/config/tests/parameters.yml.dist.sqlite
src/Wallabag/CoreBundle/Command/InstallCommand.php
src/Wallabag/CoreBundle/Controller/ConfigController.php
src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php

index 719e51eab1618f09cfcf65f63c7afb961aed548e..b627376ec72700f1032e880b03e8e76b340fff3e 100644 (file)
@@ -25,3 +25,5 @@ modify_settings: "apply"
 piwik_host: Host of your website in Piwik
 piwik_site_id: ID of your website in Piwik
 piwik_enabled: Enable Piwik
+demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)"
+demo_mode_username: "Demo user"
index ab5dfc7219e38ee35c7eca9ca7754e8db5b492fb..084eb6df11c30eb01205b4a8c564dd549739178b 100644 (file)
@@ -25,3 +25,5 @@ modify_settings: "appliquer"
 piwik_host: URL de votre site dans Piwik
 piwik_site_id: ID de votre site dans Piwik
 piwik_enabled: Activer Piwik
+demo_mode_enabled: "Activer le mode démo ? (utiliser uniquement pour la démo publique de wallabag)"
+demo_mode_username: "Utilisateur de la démo"
index 5f22b147fa5736bce1e0d7992f72d620c6d2201b..7c7413fb9b276c5c4338724c41d90c25f53a7679 100644 (file)
@@ -45,7 +45,3 @@ parameters:
     fosuser_confirmation: true
 
     from_email: no-reply@wallabag.org
-
-    # this parameter is only used for the wallabag public demo, it means user won't be able to change the password of the demo_user account
-    demo: false
-    demo_username: wallabag
index 126e11eb1d32a12eb6c1a8ea752a6130038a366c..1951f02166f81d2d8d0ccab80963d3fd9e3062ee 100644 (file)
@@ -35,7 +35,3 @@ parameters:
     fosuser_confirmation: true
 
     from_email: no-reply@wallabag.org
-
-    # this parameter is only used for the wallabag public demo, it means user won't be able to change the password of the demo_user account
-    demo: false
-    demo_username: wallabag
index 8fc33a94ce8298e6a6cb138d4e4a414b63069c1c..36ad6cde5393ee5706b42b22b6818367aac7a3e4 100644 (file)
@@ -35,7 +35,3 @@ parameters:
     fosuser_confirmation: true
 
     from_email: no-reply@wallabag.org
-
-    # this parameter is only used for the wallabag public demo, it means user won't be able to change the password of the demo_user account
-    demo: false
-    demo_username: wallabag
index 8e3d49b358a7edb9fbd52cb186744767e51d3dbd..6564014aa09f5b8c1bf0fa1a0d1673b88cfef103 100644 (file)
@@ -35,7 +35,3 @@ parameters:
     fosuser_confirmation: true
 
     from_email: no-reply@wallabag.org
-
-    # this parameter is only used for the wallabag public demo, it means user won't be able to change the password of the demo_user account
-    demo: false
-    demo_username: wallabag
index 93520f9a87d09dd7c21d206be1831696868d01d2..2e241757d27606378405d98acc08cc648a189425 100644 (file)
@@ -327,6 +327,16 @@ class InstallCommand extends ContainerAwareCommand
                 'value' => '1',
                 'section' => 'analytics',
             ],
+            [
+                'name' => 'demo_mode_enabled',
+                'value' => '0',
+                'section' => 'misc',
+            ],
+            [
+                'name' => 'demo_mode_username',
+                'value' => 'wallabag',
+                'section' => 'misc',
+            ],
         ];
 
         foreach ($settings as $setting) {
index 9ff79ba9f4ce316bde300bc8edcbcfb9e4c53fe1..87196b0ec3f2bb9d1794069a46dd24c2237be49d 100644 (file)
@@ -57,7 +57,7 @@ class ConfigController extends Controller
         $pwdForm->handleRequest($request);
 
         if ($pwdForm->isValid()) {
-            if ($this->getParameter('demo') === true && $this->getParameter('demo_username') === $user->getUsername()) {
+            if ($this->get('craue_config')->get('demo_mode_enabled') && $this->get('craue_config')->get('demo_mode_username') === $user->getUsername()) {
                 $this->get('session')->getFlashBag()->add(
                     'notice',
                     'In demonstration mode, you can\'t change password for this user.'
index 10b60f30027b6b189882df51c18d519d6106275c..1f4cafdfc7dd9a64a6c45a9ca9eb448ee601004a 100644 (file)
@@ -125,6 +125,16 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface
                 'value' => '1',
                 'section' => 'analytics',
             ],
+            [
+                'name' => 'demo_mode_enabled',
+                'value' => '0',
+                'section' => 'misc',
+            ],
+            [
+                'name' => 'demo_mode_username',
+                'value' => 'wallabag',
+                'section' => 'misc',
+            ],
         ];
 
         foreach ($settings as $setting) {