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)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jaydub’s picture

Assigned: Unassigned » jaydub
Pomliane’s picture

Status: Active » Closed (won't fix)

This 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.

bibo’s picture

Version: 5.x-1.x-dev » 7.x-1.x-dev
Assigned: jaydub » Unassigned
Issue summary: View changes
Status: Closed (won't fix) » Needs review
FileSize
5.11 KB

I 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

bibo’s picture

Here is an alternative patch that defaults to 23:30 or 23:59 of current day instead of +1 hour.

mgifford’s picture

I 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?