Contact flood control
b.hughes - April 8, 2007 - 05:50
| Project: | Email Field |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
While setting up the email module I found that the contact form limited me to 3 contacts/emails per hour, ignoring the sitewide contact threshold. I found what appears to be the problem:
Line 251 of the email.module shows: if (!flood_is_allowed('email', variable_get('email_hourly_threshold', 3))) { but the threshold variable should actually be contact_hourly_threshold
I've since changed line 251 (in my copy) to read: if (!flood_is_allowed('email', variable_get('contact_hourly_threshold', 3))) { and the contact form works as expected.

#1
You should also change this right under it:
$output = t("You cannot send more than %number messages per hour. Please try again later.", array('%number' => variable_get('email_hourly_threshold', 3)));To this:
$output = t("You cannot send more than %number messages per hour. Please try again later.", array('%number' => variable_get('contact_hourly_threshold', 3)));#2
Version 6.x-1.1 also has this bug. I don't think the fault description is quite right though. The problem is that the email module has not included a settings menu. I think email_hourly_threshold is the correct name and it is a variable that email module should provide an admin form to set.
The contact_hourly_threshold is set by the contact module and if you don't enable the contact module then you can't set it. Since the module can replace the contact module then is it quite likely that contact will be turned off.
#3
I added a configuration form for setting the value of email_hourly_threshold. See 'CCK Email Contact Form Settings' under 'Site Configuration'. Planing to make a new release soon, which will include the changes. Maybe you have to clear the menu cache to see the new menu item.
#4
Automatically closed -- issue fixed for 2 weeks with no activity.