Problem/Motivation
Add a cron function to purge login records with a configurable interval setting
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | login_tracker-purge-records-at-cron-3267300--6.patch | 4.79 KB | scalas89 |
Add a cron function to purge login records with a configurable interval setting
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | login_tracker-purge-records-at-cron-3267300--6.patch | 4.79 KB | scalas89 |
Comments
Comment #2
scalas89 commentedComment #3
leewillis77 commentedHi;
Thanks for opening this issue & for the associated patch. I haven't yet run it up and tested, but I have a few suggestions based on a quick skim through the code:
'#title' => $this->t('Purge records every'). This setting doesn't control how often records are purged, it controls the age of records that will be purged, and should describe itself as such. Maybe "Periodically purge records older than"?Comment #4
scalas89 commentedSorry, wrong patch attached! Here is a new one :)
Comment #5
leewillis77 commentedThanks. I'm happy with this in principal, with a few corrections / additions:
1. In
login_tracker.links.menu.yml, please can you amend the description to:"Configure settings related to tracking of user logins."
That avoids the inconsistent capitalisation in the current string, and is more consistent with the tone that other modules use (ie referring to the feature, not the module name).
2. In
login_tracker.module:if (isset($settings['purge_interval']) && $settings['purge_interval']) {can be simplified to:
if (!empty($settings['purge_interval'])) {3. In
login_tracker.permissions.yml, can you amend the followingto
4. In
login_tracker.routing.ymlthe permission declaration is incorrect (typo) so isn't checking the permission correctly5. Also in
login_tracker.routing.yml, the title should either be "Login Tracker settings", or "User login tracking settings"Comment #6
scalas89 commentedHere is the new patch
Comment #7
scalas89 commentedComment #8
leewillis77 commentedThanks - I'll review this week.
Comment #10
leewillis77 commentedCommitted thanks. Will be in 8.x-1.5 release.