While testing an implementation of OG Contact I found that I could never get the threshold functionality to trigger no matter how times I submitted a contact form. I did a little digging and found a minor error that was prevent the flood control from firing properly.
Basically, it all came down to a single character: underscore vs. dash.
In og_contact_mail_page_submit() the module registers the flood event on line 391:
flood_register_event('og-contact');
Then in og_contact_page() the module does a check the check to see if flooding has occured:
if (!flood_is_allowed('og-contact', variable_get('og_contact_hourly_threshold', 3))) {
This problem arises because the flood data is registered as og-contact and is checked as og_contact. I opted to change the check value to match any values that might be in a drupal installations db, even though the benefit is extremely minor.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | og_contact-314069.patch | 578 bytes | molenick |
Comments
Comment #1
molenick commentedHere's the patch.
Comment #2
gnat commentedGood catch. And thank your for the patch. It patched cleanly, and corrects threshold checking issue.
It will be part of the next release, as well as the next dev version.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.