X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FController%2FConfigController.php;h=1791eac23719e09ba34929ab0dd36ef162599107;hb=d7cc16c8b585f6a600cd309a9bb5630794fcf9aa;hp=87196b0ec3f2bb9d1794069a46dd24c2237be49d;hpb=a4f42c59f0d8a408cf9f5d7971146866530012d3;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 87196b0e..1791eac2 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -58,20 +58,16 @@ class ConfigController extends Controller if ($pwdForm->isValid()) { 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.' - ); + $message = 'In demonstration mode, you can\'t change password for this user.'; } else { + $message = 'Password updated'; + $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', $message); + return $this->redirect($this->generateUrl('config').'#set4'); }