]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
work
authorThomas Citharel <tcit@tcit.fr>
Sun, 26 Jun 2016 11:36:53 +0000 (13:36 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Sat, 8 Oct 2016 11:27:17 +0000 (13:27 +0200)
14 files changed:
src/Wallabag/CoreBundle/Controller/ConfigController.php
src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
src/Wallabag/UserBundle/Entity/User.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'));
+     }
 }
index 2652a1028fefcc7efbd71666dab049aef684aafe..69bfe7b3b559d15fd62305f7f02d538aecbec4cd 100644 (file)
@@ -486,3 +486,6 @@ flashes:
         notice:
             # client_created: 'New client created.'
             # client_deleted: 'Client deleted'
+    account:
+        notice:
+            # account_deleted: 'Account deleted'
index e0f29b6110449a8d6bbaf33891f9efdc31e3c60d..f4d134428f509349d5e93ab4ea2c4d29d8f6a3d7 100644 (file)
@@ -486,3 +486,6 @@ flashes:
         notice:
             client_created: 'Neuer Client erstellt.'
             client_deleted: 'Client gelöscht'
+    account:
+        notice:
+            # account_deleted: 'Account deleted'
index b8e98112994023532807553c00d8f60d4cb56df5..6ddb38a0c9dc84d5aeb16bb5f3ac52b470ac2e8a 100644 (file)
@@ -485,6 +485,9 @@ flashes:
         notice:
             client_created: 'New client %name% created.'
             client_deleted: 'Client %name% deleted'
+    account:
+        notice:
+            account_deleted: 'Account deleted'
     user:
         notice:
             added: 'User "%username%" added'
index 70633bd76ce90fb78cf4984dc7e95bff4617fa15..05b03938d3f12436e35f60c236f9f594de4a8358 100644 (file)
@@ -486,3 +486,6 @@ flashes:
         notice:
             client_created: 'Nuevo cliente creado.'
             client_deleted: 'Cliente suprimido'
+    account:
+        notice:
+            # account_deleted: 'Account deleted'
index 074ab7a8981c84666abd240110ff85f03358cc3c..3a01a8ed5437f6cb6bf73587fe427eaafd6b80a1 100644 (file)
@@ -485,3 +485,6 @@ flashes:
         notice:
             # client_created: 'New client created.'
             # client_deleted: 'Client deleted'
+    account:
+        notice:
+            # account_deleted: 'Account deleted'
index 6d85a5aeac9158ab62f1b923cb1a241d53d5e226..094458363d93cd0410cf5690e6633229a0e8d623 100644 (file)
@@ -486,3 +486,6 @@ flashes:
         notice:
             client_created: 'Nouveau client %name% créé'
             client_deleted: 'Client %name% supprimé'
+    account:
+        notice:
+            account_deleted: 'Compte supprimé'
index 15f7e7743822b1ab782d0348482e2e19e1099efc..93a11aee775f9d496d3d896be964393550cd0f59 100644 (file)
@@ -486,3 +486,6 @@ flashes:
         notice:
             client_created: 'Nuovo client creato.'
             client_deleted: 'Client eliminato'
+    account:
+        notice:
+            # account_deleted: 'Account deleted'
index 1d10be2aeb06cb2d72ebb73cefee7a6457ade90e..8cadf9a32f7e4274b3bc221778357819a9f96a1e 100644 (file)
@@ -486,3 +486,6 @@ flashes:
         notice:
             client_created: 'Novèl client creat'
             client_deleted: 'Client suprimit'
+    account:
+        notice:
+            # account_deleted: 'Account deleted'
index 547e9c8bf19825ab7fcf0369e536606f3550ed66..d392272f006dbb04e689dd83069ab19f78fda0b3 100644 (file)
@@ -486,3 +486,6 @@ flashes:
         notice:
             client_created: 'Nowy klient utworzony.'
             client_deleted: 'Klient usunięty'
+    account:
+        notice:
+            # account_deleted: 'Account deleted'
index 2b1d4f6db59bde5e883c8c6884d5a8dc7b598802..f2bce4428d3e2bc55a80dd23e8e43d2c14bc3f41 100644 (file)
@@ -486,3 +486,6 @@ flashes:
         notice:
             # client_created: 'New client created.'
             # client_deleted: 'Client deleted'
+    account:
+        notice:
+            # account_deleted: 'Account deleted'
index 8cfc245ab99a22616af157299d31110664870ac0..d2bf050461a0cd3f1ff854a9bc56e4ce2fb1aafe 100644 (file)
@@ -485,3 +485,6 @@ flashes:
         notice:
             # client_created: 'New client created.'
             # client_deleted: 'Client deleted'
+    account:
+        notice:
+            # account_deleted: 'Account deleted'
index 270c077f332de577644e574849c7ff7acd7e748e..cebde1acdfed5eff20fffb02fdd349543319ae5e 100644 (file)
                             {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
                             {{ form_widget(form.user._token) }}
                         </form>
+                        <a class='btn red' href='{{ path('delete_account') }}'>{{ 'config.user.delete_account' | trans }}</a>
                     </div>
 
                     <div id="set4" class="col s12">
index d98ae76a533d5871f0befb514b13fbaab4ec9a98..eb7774cd1153175da779e0a74d3e9fe90034ca24 100644 (file)
@@ -25,7 +25,7 @@ use Wallabag\CoreBundle\Entity\Entry;
  * @UniqueEntity("email")
  * @UniqueEntity("username")
  */
-class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface
+class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface, \Serializable
 {
     /**
      * @var int
@@ -240,4 +240,14 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
 
         return false;
     }
+
+    public function serialize()
+    {
+       return serialize($this->id);
+   }
+
+   public function unserialize($serialized)
+   {
+       $this->id = unserialize($serialized);
+   }
 }