Adding a reason_for_ban column

Created on 19 August 2009, over 15 years ago
Updated 3 May 2024, 8 months ago

I wanted to show a banned user the reason they've been banned in addition to how long they are being banned and the body from the site's code of conduct. I pointed the IP Ban Relocation Page to a new php file with read access to the Drupal db. Then I added a reason_for_ban column to the troll_ip_ban table. I also included the nid of the code of conduct in the query string of the block.php file so if that node is updated I don't have to manually update it on the blocked.php.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States kreynen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ͺπŸ‡¨Ecuador jwilson3

    A `reason` column would be a fantastic and helpful feature, along with a `timestamp` column, for the ban module bundled with Drupal core. Then manual bans entered by admins via the UI can explain why something was banned. And modules like Perimeter Defense and Autoban can supply a reason eg (a ban rule) along with their ban request.

    Having this info can be helpful for admins to do analysis to see why they were banned, in case they get emailed to unban, incase it was a false positive. Plus, having a reason column makes it easier to alter the ban message shown in the browser and cater the message to the user. Which is a bit better UX and friendlier than the terse "XXX.YYY.ZZZ.AAA has been banned" message.

    Since the Troll module appears to not have a D8+ branch or release, and there hasn't been movement on this in years, I'm thinking it might make sense to switch this issue over to core issue queue and repurpose it.

    Does anyone object?

Production build 0.71.5 2024