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'));
+ }
}
notice:
# client_created: 'New client created.'
# client_deleted: 'Client deleted'
+ account:
+ notice:
+ # account_deleted: 'Account deleted'
notice:
client_created: 'Neuer Client erstellt.'
client_deleted: 'Client gelöscht'
+ account:
+ notice:
+ # account_deleted: 'Account deleted'
notice:
client_created: 'New client %name% created.'
client_deleted: 'Client %name% deleted'
+ account:
+ notice:
+ account_deleted: 'Account deleted'
user:
notice:
added: 'User "%username%" added'
notice:
client_created: 'Nuevo cliente creado.'
client_deleted: 'Cliente suprimido'
+ account:
+ notice:
+ # account_deleted: 'Account deleted'
notice:
# client_created: 'New client created.'
# client_deleted: 'Client deleted'
+ account:
+ notice:
+ # account_deleted: 'Account deleted'
notice:
client_created: 'Nouveau client %name% créé'
client_deleted: 'Client %name% supprimé'
+ account:
+ notice:
+ account_deleted: 'Compte supprimé'
notice:
client_created: 'Nuovo client creato.'
client_deleted: 'Client eliminato'
+ account:
+ notice:
+ # account_deleted: 'Account deleted'
notice:
client_created: 'Novèl client creat'
client_deleted: 'Client suprimit'
+ account:
+ notice:
+ # account_deleted: 'Account deleted'
notice:
client_created: 'Nowy klient utworzony.'
client_deleted: 'Klient usunięty'
+ account:
+ notice:
+ # account_deleted: 'Account deleted'
notice:
# client_created: 'New client created.'
# client_deleted: 'Client deleted'
+ account:
+ notice:
+ # account_deleted: 'Account deleted'
notice:
# client_created: 'New client created.'
# client_deleted: 'Client deleted'
+ account:
+ notice:
+ # account_deleted: 'Account deleted'
{{ 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">
* @UniqueEntity("email")
* @UniqueEntity("username")
*/
-class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface
+class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface, \Serializable
{
/**
* @var int
return false;
}
+
+ public function serialize()
+ {
+ return serialize($this->id);
+ }
+
+ public function unserialize($serialized)
+ {
+ $this->id = unserialize($serialized);
+ }
}