anonymous users cannot vote in the 5.x version although the permissions are set correctly. I ported the respective permission check from the 4.x version and now it works.

So this:
if ($user->uid && user_access('rate content')) {

Becomes this:
if (user_access('rate content')) {

CommentFileSizeAuthor
#5 jrating-anonvote.patch3.28 KBmacrule

Comments

hickory’s picture

Status: Active » Closed (works as designed)

Anonymous users are not supposed to be able to vote - I need to fix that in the 4.7 version as well.

see http://drupal.org/node/125981

macrule’s picture

I think that would be a shame. I like jrating better than fivestar, but fivestar does let anonymous users vote, and for non-community sites it is vital that people can vote without having to register.

Please at least make it dependent on the permissons for anonymous users. These options are the strength of drupal. Everyone can use modules according to their needs this way.

hickory’s picture

I'll have a look at how fivestar does it - maybe it assigns made up uids to anonymous users.

hickory’s picture

Personally I'm unlikely to fix this as I don't like the way anonymous voting works. However, if anyone wants to provide a patch it could be incorporated.

macrule’s picture

Status: Closed (works as designed) » Needs review
StatusFileSize
new3.28 KB

Ok, I checked how fivestar does it. It has no need for using fake user IDs. It just uses some of the a bit lower level voting-api functions and some sql queries and thus can make sure that votes are restricted by IP (one vote per IP within 24 hours).

I implemented that for the current jrating dev release and have attached the patch.

hickory’s picture

I didn't want to implement this because it's so ridiculously open to abuse I can't see how it could ever be useful. However... if people want to use it (apparently so) I'll add in the patch.

Are there any big sites that allow anonymous voting?

macrule’s picture

I agree it IS open to abuse. However this is not relevant in some use cases.

For one, there are sites that are unlikely to be the target of abuse because they use rating for items that users don't feel so connected to (not own creation) that they long to vote it to the top.

And then there are sites where it can be more detrimental to force your visitors and potential customers to register than it is to accept the chance of twisted vote results. In most cases rating is just a fun widget for your users anyway, to keep them longer on a site and make them return.

eCRM’s picture

I'm grateful for this. I looked long and hard at the various voting/rating schemes to find one I liked with the facilities I needed.

Anonymous voting is important for my site, too. I have casual visitors and I simply want them to "vote and continue". I have no interest in who they are because my transactions are impersonal. I want them to have fun, and be on their way.

It's very simple to turn anonymous voting on and off, or should be. Not every use is deadly serious. Fun sites are allowed too

hickory’s picture

Category: bug » feature
Status: Needs review » Fixed

This should be committed now. The only issue is that it says 'rating saved' for anonymous users even if they're voting twice in the same day (ie the rating is being rejected).

Anonymous’s picture

Status: Fixed » Closed (fixed)