How can I allow anonymous users to vote aswell?
I´ve checked at the access control panel the option "give points with extra voting forms" to anon users, but it still redirects them to the login page...

Comments

mercmobily’s picture

Status: Active » Closed (works as designed)

Hi,

extra_voting_forms, the voting subsystem used by default by Drigg, does not allow anonymous voting - and never will. Sorry.
However, Drigg will work with any voting system (at least in theory) as long as it's based on VotingAPI. I believe some of the other voting systems do allow anonymous voting, although I am not 1000% sure.

It would be great if somebody with Drupal/voting experience tried to use Drigg with a different voting subsystem. At the moment, I don't think anybody has.

Bye,

Merc.

Rosamunda’s picture

How sad, because I think Extra Voting is awsome. I mean, it´s easy, nice, and seems pretty fast.
You´ve mentioned on your answer Drigg module. I´ve readed and seems terrific, but... isn´t it the same that this module? (Extra voting...) I mean, they seems to be created for the same thing...
But I really didn´t try it yet...

Thanks again for all your kindness and good predisposition to help!

Rosamunda
Buenos Aires / Argentina

mercmobily’s picture

Issue tags: +Newbie

Hi,

No problem.
In general, I've noticed that people who give their modules the ability to accept anonymous voting... soon regret it. There are just too many things that can go wrong (fake voters, proxy servers, and so on).

Sorry...

Merc.

sphism’s picture

Version: 5.x-1.3 » 6.x-1.x-dev

SO i'm using extra voting forms and really like it but the client insists on anonymous voting - which i'm not hugely keen on especially when there is a big prize at stake.

Anyhoo, what do i know? :)

So i've been looking through the code to allow anon voting in the drupal 6 version of the module, here's the 3 changes i've made to switch off the anti-anonymous stuff: (just comment out a few lines)

extra_voting_forms.module:

function extra_voting_forms_give_vote($o, $vote, $account = NULL) {
.....
// The user is not logged in: RETURN with error
  if ($account->uid == 0) {
    //hack: matt: allow anon votes
    //return array( t("Only logged in users can vote!"), 0 );
    //end hack
  }
.....
}

function extra_voting_forms_handle() {
....
    // It's a direct form, and the user doesn't
    // have voting rights!
    if ($form_type != 'ajax' && $user->uid == 0) {
      //hack: matt: allow anonymous votes
      drupal_set_message('Anonymous vote logged, please log in to vote next time', 'error');
      //drupal_goto(extra_voting_forms_anonymous_url(), "destination=". extra_voting_forms_destination($o) );
      //end hack
    }
....
}

and in extra_voting_forms.js:

var KarmaSendForm = function() {
....
    if (  destination ) {
    // top.location = Drupal.settings.extra_voting_forms.base_path + Drupal.settings.extra_voting_forms.login_page + '?destination=' + destination;
    
    //hack: matt: allow anon voting
    //top.location = '/' + Drupal.settings.extra_voting_forms.login_page + '?destination=' + destination;
    //return false;
    //end hack
  }
....
}

So next i was expecting to have to log ip addresses and hack up some more code but it seems that votingapi already does this for me, and when i go to /admin/settings/votingapi i can set how often an anonymous voter can vote.

Is there a problem with doing this? How open to abuse does this leave the voting system?

Thanks for your help, great module.

nocean’s picture

@sphism: Awesome. Cheers for sharing that! I've just implemented it, and will post back here if I notice problems.

slicedsoup’s picture

I've tried this change suggested above and initially it seemed to work but I have begun noticing a few problems where it shows that an anonymous visitor has voted on scoops that they haven't. So I am not sure that this is a viable solution, looking here instead: http://drupal.org/node/335617