Problem/Motivation
We are adding multiple layers of anti spam measures to our project. Whenever a layer fails validation, we would like to log an event in the flood table to eventually automatically block users when they go over a certain threshold. A hook seems the most flexible, the honeypot module has hook_honeypot_reject() for this. Maybe we could add something similar.
Proposed resolution
It would be great if the antibot module would add hook_antibot_reject() to respond to validation failures for antibot. In our case we would log to the flood table, but maybe other modules want a different way of handling this.
Remaining tasks
- Write a patch
- Review
- Commit
User interface changes
None
API changes
A new hook hook_antibot_reject() will be added.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3548615-2.patch | 1.34 KB | seanb |
Issue fork antibot-3548615
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:
Comments
Comment #2
seanbHere is a first simple patch that should do it.
Comment #3
danrodHi @seanb , I'm ok with this, would be a nice addition to the
antibot.api.phpAPI and it's a good starting point and it's up to the developer to implement extra validations or log the validation failure.I'll merge this (I'll create a MR)
Comment #5
danrodMerged, thanks a lot @seanb .
Credits given.
Comment #6
danrodComment #7
danrod