]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Controller/ConfigController.php
work
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Controller / ConfigController.php
index 91cdcae506fe75f2176f84fbe3c31911c29d3a66..0a306d57c8aa271455d915cb7da7784f60696140 100644 (file)
@@ -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'));
+     }
 }