mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-23 09:31:04 +00:00
Demonstration mode to prevent password changes
This commit is contained in:
parent
12b5a8cea1
commit
6c9f50a662
5 changed files with 25 additions and 6 deletions
|
@ -45,3 +45,6 @@ parameters:
|
||||||
fosuser_confirmation: true
|
fosuser_confirmation: true
|
||||||
|
|
||||||
from_email: no-reply@wallabag.org
|
from_email: no-reply@wallabag.org
|
||||||
|
|
||||||
|
# set to true to prevent changing password
|
||||||
|
demo: false
|
||||||
|
|
|
@ -35,3 +35,6 @@ parameters:
|
||||||
fosuser_confirmation: true
|
fosuser_confirmation: true
|
||||||
|
|
||||||
from_email: no-reply@wallabag.org
|
from_email: no-reply@wallabag.org
|
||||||
|
|
||||||
|
# set to true to prevent changing password
|
||||||
|
demo: false
|
||||||
|
|
|
@ -35,3 +35,6 @@ parameters:
|
||||||
fosuser_confirmation: true
|
fosuser_confirmation: true
|
||||||
|
|
||||||
from_email: no-reply@wallabag.org
|
from_email: no-reply@wallabag.org
|
||||||
|
|
||||||
|
# set to true to prevent changing password
|
||||||
|
demo: false
|
||||||
|
|
|
@ -35,3 +35,6 @@ parameters:
|
||||||
fosuser_confirmation: true
|
fosuser_confirmation: true
|
||||||
|
|
||||||
from_email: no-reply@wallabag.org
|
from_email: no-reply@wallabag.org
|
||||||
|
|
||||||
|
# set to true to prevent changing password
|
||||||
|
demo: false
|
||||||
|
|
|
@ -57,6 +57,7 @@ class ConfigController extends Controller
|
||||||
$pwdForm->handleRequest($request);
|
$pwdForm->handleRequest($request);
|
||||||
|
|
||||||
if ($pwdForm->isValid()) {
|
if ($pwdForm->isValid()) {
|
||||||
|
if ($this->getParameter('demo') === false) {
|
||||||
$user->setPlainPassword($pwdForm->get('new_password')->getData());
|
$user->setPlainPassword($pwdForm->get('new_password')->getData());
|
||||||
$userManager->updateUser($user, true);
|
$userManager->updateUser($user, true);
|
||||||
|
|
||||||
|
@ -64,6 +65,12 @@ class ConfigController extends Controller
|
||||||
'notice',
|
'notice',
|
||||||
'Password updated'
|
'Password updated'
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
$this->get('session')->getFlashBag()->add(
|
||||||
|
'notice',
|
||||||
|
'In demonstration mode, you can`t change password.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('config').'#set4');
|
return $this->redirect($this->generateUrl('config').'#set4');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue