mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Use internal config instead for demo
This commit is contained in:
parent
d8d56448c9
commit
a4f42c59f0
9 changed files with 25 additions and 17 deletions
|
@ -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) {
|
||||
|
|
|
@ -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.'
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue