mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-26 19:11:07 +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,13 +57,20 @@ class ConfigController extends Controller
|
||||||
$pwdForm->handleRequest($request);
|
$pwdForm->handleRequest($request);
|
||||||
|
|
||||||
if ($pwdForm->isValid()) {
|
if ($pwdForm->isValid()) {
|
||||||
$user->setPlainPassword($pwdForm->get('new_password')->getData());
|
if ($this->getParameter('demo') === false) {
|
||||||
$userManager->updateUser($user, true);
|
$user->setPlainPassword($pwdForm->get('new_password')->getData());
|
||||||
|
$userManager->updateUser($user, true);
|
||||||
|
|
||||||
$this->get('session')->getFlashBag()->add(
|
$this->get('session')->getFlashBag()->add(
|
||||||
'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