X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FController%2FConfigController.php;h=0a306d57c8aa271455d915cb7da7784f60696140;hb=e4b46f77ef2984b33f4dff0efea0585c7ab0cfbf;hp=91cdcae506fe75f2176f84fbe3c31911c29d3a66;hpb=d9b0673dbb1138e805e039610cef893e49abe3d8;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 91cdcae5..0a306d57 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -251,4 +251,24 @@ class ConfigController extends Controller return $config; } + + /** + * Delete account for current user. + * + * @Route("/account/delete", name="delete_account") + * + * @return \Symfony\Component\HttpFoundation\RedirectResponse + */ + public function deleteAccountAction() + { + $em = $this->get('fos_user.user_manager'); + $em->deleteUser($this->getUser()); + + $this->get('session')->getFlashBag()->add( + 'notice', + 'flashes.account.notice.account_deleted' + ); + + return $this->redirect($this->generateUrl('fos_user_security_logout')); + } }