Skip to content

Commit 64e6e8c

Browse files
authored
Merge pull request #3021 from stof/register_last_login
Add an option to skip registering the last login date
2 parents 312c8a5 + 3ef42d3 commit 64e6e8c

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public function getConfigTreeBuilder()
5454
->scalarNode('firewall_name')->isRequired()->cannotBeEmpty()->end()
5555
->scalarNode('model_manager_name')->defaultNull()->end()
5656
->booleanNode('use_authentication_listener')->defaultTrue()->end()
57+
->booleanNode('register_last_login')->defaultTrue()->end()
5758
->booleanNode('use_listener')->defaultTrue()->end()
5859
->booleanNode('use_flash_notifications')->defaultTrue()->end()
5960
->booleanNode('use_username_form_type')->defaultTrue()->end()

DependencyInjection/FOSUserExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ public function load(array $configs, ContainerBuilder $container)
8282
$container->removeDefinition('fos_user.listener.authentication');
8383
}
8484

85+
if (!$config['register_last_login']) {
86+
$container->removeDefinition('fos_user.security.interactive_login_listener');
87+
}
88+
8589
if ($config['use_flash_notifications']) {
8690
$this->sessionNeeded = true;
8791
$loader->load('flash_notifications.xml');

Resources/doc/configuration_reference.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ All available configuration options are listed below with their default values.
1212
use_listener: true
1313
use_flash_notifications: true
1414
use_authentication_listener: true
15+
register_last_login: true
1516
use_username_form_type: true
1617
model_manager_name: null # change it to the name of your entity/document manager if you don't want to use the default one.
1718
from_email:

0 commit comments

Comments
 (0)