preventing bot voting for anonymous polls

Created on 1 December 2024, 3 months ago

Problem/Motivation

Were a small dutch town magazine. We have an anonymous poll with like 8 choices, and usually we have like 300 choices on a poll.
Now we have the first choice chosen over 2000 times by ips ranging from Dhaka to Frankfurt am Main and Maine. The timelaps between the choices are like 10 minutes or so.

Proposed resolution

I there any way to prevent this in the poll module itself?

💬 Support request
Status

Active

Version

1.6

Component

Miscellaneous

Created by

🇳🇱Netherlands EgbertB

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

Comments & Activities

  • Issue created by @EgbertB
  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    I would expect that that something like Honeypot would solve this. But I have not tested to see if this works out of the box.

  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    Quickly checked and Honypot seems to be working for anonymous users when you select "protect all forms".

    No checkboxes are shown to specifically enable Poll forms, so we might look into that in the future.

  • 🇳🇱Netherlands EgbertB

    This works

    function [hook]_form_alter(&$form, &$form_state, $form_id)
    {
    if(strpos($form_id, "poll_view_form") !== false){
    \Drupal::service('honeypot')->addFormProtection($form, $form_state, array('honeypot', 'time_restriction'));
    }
    }

Production build 0.71.5 2024