mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-05 16:39:49 +00:00
work
This commit is contained in:
parent
d9b0673dbb
commit
e4b46f77ef
14 changed files with 65 additions and 1 deletions
|
@ -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'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -486,3 +486,6 @@ flashes:
|
|||
notice:
|
||||
# client_created: 'New client created.'
|
||||
# client_deleted: 'Client deleted'
|
||||
account:
|
||||
notice:
|
||||
# account_deleted: 'Account deleted'
|
||||
|
|
|
@ -486,3 +486,6 @@ flashes:
|
|||
notice:
|
||||
client_created: 'Neuer Client erstellt.'
|
||||
client_deleted: 'Client gelöscht'
|
||||
account:
|
||||
notice:
|
||||
# account_deleted: 'Account deleted'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -486,3 +486,6 @@ flashes:
|
|||
notice:
|
||||
client_created: 'Nuevo cliente creado.'
|
||||
client_deleted: 'Cliente suprimido'
|
||||
account:
|
||||
notice:
|
||||
# account_deleted: 'Account deleted'
|
||||
|
|
|
@ -485,3 +485,6 @@ flashes:
|
|||
notice:
|
||||
# client_created: 'New client created.'
|
||||
# client_deleted: 'Client deleted'
|
||||
account:
|
||||
notice:
|
||||
# account_deleted: 'Account deleted'
|
||||
|
|
|
@ -486,3 +486,6 @@ flashes:
|
|||
notice:
|
||||
client_created: 'Nouveau client %name% créé'
|
||||
client_deleted: 'Client %name% supprimé'
|
||||
account:
|
||||
notice:
|
||||
account_deleted: 'Compte supprimé'
|
||||
|
|
|
@ -486,3 +486,6 @@ flashes:
|
|||
notice:
|
||||
client_created: 'Nuovo client creato.'
|
||||
client_deleted: 'Client eliminato'
|
||||
account:
|
||||
notice:
|
||||
# account_deleted: 'Account deleted'
|
||||
|
|
|
@ -486,3 +486,6 @@ flashes:
|
|||
notice:
|
||||
client_created: 'Novèl client creat'
|
||||
client_deleted: 'Client suprimit'
|
||||
account:
|
||||
notice:
|
||||
# account_deleted: 'Account deleted'
|
||||
|
|
|
@ -486,3 +486,6 @@ flashes:
|
|||
notice:
|
||||
client_created: 'Nowy klient utworzony.'
|
||||
client_deleted: 'Klient usunięty'
|
||||
account:
|
||||
notice:
|
||||
# account_deleted: 'Account deleted'
|
||||
|
|
|
@ -486,3 +486,6 @@ flashes:
|
|||
notice:
|
||||
# client_created: 'New client created.'
|
||||
# client_deleted: 'Client deleted'
|
||||
account:
|
||||
notice:
|
||||
# account_deleted: 'Account deleted'
|
||||
|
|
|
@ -485,3 +485,6 @@ flashes:
|
|||
notice:
|
||||
# client_created: 'New client created.'
|
||||
# client_deleted: 'Client deleted'
|
||||
account:
|
||||
notice:
|
||||
# account_deleted: 'Account deleted'
|
||||
|
|
|
@ -167,6 +167,7 @@
|
|||
{{ 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">
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue