mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-23 08:06:33 +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
|
||||
|
||||
from_email: no-reply@wallabag.org
|
||||
|
||||
# set to true to prevent changing password
|
||||
demo: false
|
||||
|
|
|
@ -35,3 +35,6 @@ parameters:
|
|||
fosuser_confirmation: true
|
||||
|
||||
from_email: no-reply@wallabag.org
|
||||
|
||||
# set to true to prevent changing password
|
||||
demo: false
|
||||
|
|
|
@ -35,3 +35,6 @@ parameters:
|
|||
fosuser_confirmation: true
|
||||
|
||||
from_email: no-reply@wallabag.org
|
||||
|
||||
# set to true to prevent changing password
|
||||
demo: false
|
||||
|
|
|
@ -35,3 +35,6 @@ parameters:
|
|||
fosuser_confirmation: true
|
||||
|
||||
from_email: no-reply@wallabag.org
|
||||
|
||||
# set to true to prevent changing password
|
||||
demo: false
|
||||
|
|
|
@ -57,13 +57,20 @@ class ConfigController extends Controller
|
|||
$pwdForm->handleRequest($request);
|
||||
|
||||
if ($pwdForm->isValid()) {
|
||||
$user->setPlainPassword($pwdForm->get('new_password')->getData());
|
||||
$userManager->updateUser($user, true);
|
||||
if ($this->getParameter('demo') === false) {
|
||||
$user->setPlainPassword($pwdForm->get('new_password')->getData());
|
||||
$userManager->updateUser($user, true);
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Password updated'
|
||||
);
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Password updated'
|
||||
);
|
||||
} else {
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'In demonstration mode, you can`t change password.'
|
||||
);
|
||||
}
|
||||
|
||||
return $this->redirect($this->generateUrl('config').'#set4');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue