Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Similar to watchdog. This was originally part of the project description but I think it makes more sense as an issue.
Issue fork login_history-2619042
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 8.x-1.x compare
- 2619042-optionally-delete-older changes, plain diff MR !2
Comments
Comment #3
catapipperI took a stab at this, I'm still learning the correct coding standards and how to make these types of administrative settings. It's expanding on what greggles posted on Issue 2026903 and my own basic knowledge. I hope it at least gives someone a starting point.
The code creates two configuration settings, one integer for Per User and one for Total. Using this information, it then has a cron that removes login history events based on these integer values. It will also check on user login to see if the number of logins is above the per user limit and removes the oldest.
Comment #4
catapipperComment #6
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedComment #7
Christopher Riley CreditAttribution: Christopher Riley commentedThis would be a nice feature to have, hopefully it will be rolled into a release.
Comment #8
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedComment #9
Svitlana CreditAttribution: Svitlana at 1xINTERNET commentedI tested it in Drupal 10. Works fine (per user)
Comment #10
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedI was almost to the point of committing this, but I started to dislike the security implications of some users being able to erase the login history of others. For that reason, the keep_total option must be removed.
Comment #12
jcnventura CreditAttribution: jcnventura at 1xINTERNET commented