CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCampaign (Moderators: Kiran Jagtap, xavier) »
  • Allowing multiple petition signatures from the same computer
Pages: [1]

Author Topic: Allowing multiple petition signatures from the same computer  (Read 1202 times)

AndyHarkness

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 0
    • Andy's Blog
  • CiviCRM version: 4.5.0
  • CMS version: Wordpress 4.0
  • MySQL version: 5.1.61
  • PHP version: 5.3.3
Allowing multiple petition signatures from the same computer
August 05, 2014, 09:10:27 am
Is there a way of allowing multiple petition signatures from the same computer? At the moment multiple petition sign ups from the same computer are prevented by cookies. I would prefer to allow multiple people to sign the petition from the same computer. In fact my client wants to have a laptop set up on a University campus where people may sign up to a petition.

AndyHarkness

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 0
    • Andy's Blog
  • CiviCRM version: 4.5.0
  • CMS version: Wordpress 4.0
  • MySQL version: 5.1.61
  • PHP version: 5.3.3
Re: Allowing multiple petition signatures from the same computer
August 12, 2014, 06:11:04 am
Is there anything stopping me from just removing the cookies? I have added this to my functions.php file:

Code: [Select]
//disable petition cookie
if(isset($_COOKIE['petitionid'])) {
  unset($_COOKIE['petitionid']);
  setcookie('petitionid', '', time() - 3600); // empty value and old timestamp
}

if(isset($_COOKIE['signed_3'])) {
  unset($_COOKIE['signed_3']);
  setcookie('signed_3', '', time() - 3600); // empty value and old timestamp
}

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Allowing multiple petition signatures from the same computer
August 13, 2014, 01:23:43 am
That will probably work, although hacks to CiviCRM core can be difficult to maintain throughout upgrades.
Creating a setting for this and exposing it to the UI would be even better :)
Try asking your question on the new CiviCRM help site.

AndyHarkness

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 0
    • Andy's Blog
  • CiviCRM version: 4.5.0
  • CMS version: Wordpress 4.0
  • MySQL version: 5.1.61
  • PHP version: 5.3.3
Re: Allowing multiple petition signatures from the same computer
August 13, 2014, 02:58:50 am
Hi Coleman,

So far it seems to be working anyway :). I've added the code to my theme's functions.php file, so hopefully I should be able to retain the code if i upgrade CiviCRM (assuming cookies don't change). I'm not sure if I'd have the programming skills to move this onto the UI, but I'll check it out!

uscucedd

  • I’m new here
  • *
  • Posts: 6
  • Karma: 1
  • CiviCRM version: 4.5.2
  • CMS version: Joomla 3.3.6
  • MySQL version: don't know
  • PHP version: don't know
Re: Allowing multiple petition signatures from the same computer
April 17, 2015, 08:31:27 am
Andy,

I am on the same boat, in terms of the need to allow the same computer to be used for multiple people to sign petitions.  I want to implement your solution, but my knowledge is more limited than yours.

Where do I find the functions.php file so I can add code to it?  I can't seem to find it on my own.

Thanks!

Michelle

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCampaign (Moderators: Kiran Jagtap, xavier) »
  • Allowing multiple petition signatures from the same computer

This forum was archived on 2017-11-26.