diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-02-22 11:38:25 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-02-22 11:44:39 +0100 |
commit | a4f42c59f0d8a408cf9f5d7971146866530012d3 (patch) | |
tree | 6dfab2947110a88426e230b17782f9c869ed866d | |
parent | d8d56448c993bdf4811a193f96e5ff44ed026417 (diff) | |
download | wallabag-a4f42c59f0d8a408cf9f5d7971146866530012d3.tar.gz wallabag-a4f42c59f0d8a408cf9f5d7971146866530012d3.tar.zst wallabag-a4f42c59f0d8a408cf9f5d7971146866530012d3.zip |
Use internal config instead for demo
9 files changed, 25 insertions, 17 deletions
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml index 719e51ea..b627376e 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml | |||
@@ -25,3 +25,5 @@ modify_settings: "apply" | |||
25 | piwik_host: Host of your website in Piwik | 25 | piwik_host: Host of your website in Piwik |
26 | piwik_site_id: ID of your website in Piwik | 26 | piwik_site_id: ID of your website in Piwik |
27 | piwik_enabled: Enable Piwik | 27 | piwik_enabled: Enable Piwik |
28 | demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" | ||
29 | demo_mode_username: "Demo user" | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml index ab5dfc72..084eb6df 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml | |||
@@ -25,3 +25,5 @@ modify_settings: "appliquer" | |||
25 | piwik_host: URL de votre site dans Piwik | 25 | piwik_host: URL de votre site dans Piwik |
26 | piwik_site_id: ID de votre site dans Piwik | 26 | piwik_site_id: ID de votre site dans Piwik |
27 | piwik_enabled: Activer Piwik | 27 | piwik_enabled: Activer Piwik |
28 | demo_mode_enabled: "Activer le mode démo ? (utiliser uniquement pour la démo publique de wallabag)" | ||
29 | demo_mode_username: "Utilisateur de la démo" | ||
diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 5f22b147..7c7413fb 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist | |||
@@ -45,7 +45,3 @@ parameters: | |||
45 | fosuser_confirmation: true | 45 | fosuser_confirmation: true |
46 | 46 | ||
47 | from_email: no-reply@wallabag.org | 47 | from_email: no-reply@wallabag.org |
48 | |||
49 | # 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 | ||
50 | demo: false | ||
51 | demo_username: wallabag | ||
diff --git a/app/config/tests/parameters.yml.dist.mysql b/app/config/tests/parameters.yml.dist.mysql index 126e11eb..1951f021 100644 --- a/app/config/tests/parameters.yml.dist.mysql +++ b/app/config/tests/parameters.yml.dist.mysql | |||
@@ -35,7 +35,3 @@ parameters: | |||
35 | fosuser_confirmation: true | 35 | fosuser_confirmation: true |
36 | 36 | ||
37 | from_email: no-reply@wallabag.org | 37 | from_email: no-reply@wallabag.org |
38 | |||
39 | # 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 | ||
40 | demo: false | ||
41 | demo_username: wallabag | ||
diff --git a/app/config/tests/parameters.yml.dist.pgsql b/app/config/tests/parameters.yml.dist.pgsql index 8fc33a94..36ad6cde 100644 --- a/app/config/tests/parameters.yml.dist.pgsql +++ b/app/config/tests/parameters.yml.dist.pgsql | |||
@@ -35,7 +35,3 @@ parameters: | |||
35 | fosuser_confirmation: true | 35 | fosuser_confirmation: true |
36 | 36 | ||
37 | from_email: no-reply@wallabag.org | 37 | from_email: no-reply@wallabag.org |
38 | |||
39 | # 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 | ||
40 | demo: false | ||
41 | demo_username: wallabag | ||
diff --git a/app/config/tests/parameters.yml.dist.sqlite b/app/config/tests/parameters.yml.dist.sqlite index 8e3d49b3..6564014a 100644 --- a/app/config/tests/parameters.yml.dist.sqlite +++ b/app/config/tests/parameters.yml.dist.sqlite | |||
@@ -35,7 +35,3 @@ parameters: | |||
35 | fosuser_confirmation: true | 35 | fosuser_confirmation: true |
36 | 36 | ||
37 | from_email: no-reply@wallabag.org | 37 | from_email: no-reply@wallabag.org |
38 | |||
39 | # 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 | ||
40 | demo: false | ||
41 | demo_username: wallabag | ||
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 93520f9a..2e241757 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php | |||
@@ -327,6 +327,16 @@ class InstallCommand extends ContainerAwareCommand | |||
327 | 'value' => '1', | 327 | 'value' => '1', |
328 | 'section' => 'analytics', | 328 | 'section' => 'analytics', |
329 | ], | 329 | ], |
330 | [ | ||
331 | 'name' => 'demo_mode_enabled', | ||
332 | 'value' => '0', | ||
333 | 'section' => 'misc', | ||
334 | ], | ||
335 | [ | ||
336 | 'name' => 'demo_mode_username', | ||
337 | 'value' => 'wallabag', | ||
338 | 'section' => 'misc', | ||
339 | ], | ||
330 | ]; | 340 | ]; |
331 | 341 | ||
332 | foreach ($settings as $setting) { | 342 | foreach ($settings as $setting) { |
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 9ff79ba9..87196b0e 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php | |||
@@ -57,7 +57,7 @@ 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') === true && $this->getParameter('demo_username') === $user->getUsername()) { | 60 | if ($this->get('craue_config')->get('demo_mode_enabled') && $this->get('craue_config')->get('demo_mode_username') === $user->getUsername()) { |
61 | $this->get('session')->getFlashBag()->add( | 61 | $this->get('session')->getFlashBag()->add( |
62 | 'notice', | 62 | 'notice', |
63 | 'In demonstration mode, you can\'t change password for this user.' | 63 | 'In demonstration mode, you can\'t change password for this user.' |
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php index 10b60f30..1f4cafdf 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php | |||
@@ -125,6 +125,16 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface | |||
125 | 'value' => '1', | 125 | 'value' => '1', |
126 | 'section' => 'analytics', | 126 | 'section' => 'analytics', |
127 | ], | 127 | ], |
128 | [ | ||
129 | 'name' => 'demo_mode_enabled', | ||
130 | 'value' => '0', | ||
131 | 'section' => 'misc', | ||
132 | ], | ||
133 | [ | ||
134 | 'name' => 'demo_mode_username', | ||
135 | 'value' => 'wallabag', | ||
136 | 'section' => 'misc', | ||
137 | ], | ||
128 | ]; | 138 | ]; |
129 | 139 | ||
130 | foreach ($settings as $setting) { | 140 | foreach ($settings as $setting) { |