Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is it possible to add a new time frame limit of 5 minutes in the list of available time frames?
Available time frames are
Per user submission limit
- Ever
- Every hour
- Every day
- Every week
Comment | File | Size | Author |
---|---|---|---|
#8 | webform-1_and_5_minute_limits-1593870-8.patch | 1.89 KB | DanChadwick |
#6 | minute-interval-1593870-6.patch | 463 bytes | smira |
#5 | webform-honeypot-2.png | 48.62 KB | quicksketch |
Comments
Comment #1
quicksketchSounds like a good idea to me. I don't know why we don't have that option already. Although if you're thinking of limiting users to "1 submission every 5 minutes", your users may be frustrated by such a restriction. Imagine if you had someone contacting you, but they forgot to say something in the first message and tried immediately again. They'd be much better off with a "2 submissions every 10 minutes", or even better, "3 submissions every 15 minutes". The most spam you'd receive is 3 messages instead of 1, but your end users would never accidentally hit the limit by making submissions close together.
So thinking this way, I agree that "1 hour" probably too long for some limits, but 5 minutes is probably too short for most situations. But ultimately, what lengths are appropriate depend on your use-case.
Comment #2
maustyle CreditAttribution: maustyle commentedI see what you mean.
This really had to do with another issue. Apparently the webform submitted multiple times instead of one. Resulting in 4 emails sent and 4 results. So that's why I wanted to restrict the submissions to 1. Any ideas on why that would happen?
Back to this issue, for the purpose of my website 1 submission every 5 minutes is okay. I think that it must be possible to hook the PHP code to add more custom time frame options, but I would not know where to go.
Comment #3
quicksketchTo prevent accidental double-submissions, a module like http://drupal.org/project/honeypot might be better really. Then you could set the timeframe to a couple seconds to prevent the "double click" problem.
Comment #4
maustyle CreditAttribution: maustyle commentedThank you but the Honeypot module doesn't seem to work properly like the webform cookie restriction. I would love to know where to start looking to set a 5 minutes restriction on it. Could you please help?
Comment #5
quicksketchHm, actually I looked at Honeypot again and you're right that it doesn't stop repeated submissions to the same form. It only stops the *rapid* submission of forms, so the user has to wait a few seconds before submitting the form after the page has been loaded. We still don't have more granular options for limiting users, so this issue is still valid.
Comment #6
smira CreditAttribution: smira commentedthis seems to add minute interval submissions which is what i needed, it might help you as well...
Comment #7
DanChadwick CreditAttribution: DanChadwick commentedI don't see any harm in offering 1 and 5 minute options.
Comment #8
DanChadwick CreditAttribution: DanChadwick commentedAdded 1 and 5 minute limits to total and per/user limits. Committed to 7.x-4.x and 8.x
Comment #11
commonpike CreditAttribution: commonpike commentedI'm having this. The submissions appear (in the results) as having been submitted at the very same second (by the same user, same ip, etc).
However, setting the limit to 'one per user, per day' does not prevent this either (weirdly). So 5 minutes would not help me, I guess.