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.
A task for future development would be to extend the current form that allows for setting an expiration on an IP ban to include time periods shorter than a day.
Some possibilities:
- Ban for X hours
- Ban for X days
- Ban for X weeks (days * 7)
- Ban for X months (days * 30)
Comment | File | Size | Author |
---|---|---|---|
#4 | troll_expire_granularity_to_minutes_default_to_endofday_233180_4.patch | 5.46 KB | bibo |
#3 | troll_expire_granularity_to_minutes_233180_1.patch | 5.11 KB | bibo |
Comments
Comment #1
jaydub CreditAttribution: jaydub commentedComment #2
Pomliane CreditAttribution: Pomliane commentedThis version of Troll is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.
This issue has been automagically closed by a script.
Comment #3
bibo CreditAttribution: bibo commentedI needed also the feature for more finetuned IP bans, so I created this relatively simple patch that adds there changes:
- IP ban form insert/update now handles minutes & hours as well as the day.
- The default timestamp is now +3600s to current time.
- Expire time is now on by default (avoiding totally useless and endless IP bans).
- IP bans shown on the table show the correct granularity (per minute, not per day)
My patch also contains a few lines fixing critical bugs in these issues:
#2616066: Troll lets Varnish cache the redirects, making ANY user see blocked.html!
#2473413: Ip banning doesnt work(!) -> oneliner fix
Comment #4
bibo CreditAttribution: bibo commentedHere is an alternative patch that defaults to 23:30 or 23:59 of current day instead of +1 hour.
Comment #5
mgiffordI took a quick look at this. Code applies nicely. I just added an expiry time /node#overlay=admin/people/troll/ip_ban
Seemed to work.
Anyone willing to mark this RTBC?