Skip to content

Commit

Permalink
Should fix an issue with simple poll voting by anonmymous users [#588
Browse files Browse the repository at this point in the history
…state:resolved milestone:2.0.7]
  • Loading branch information
dleffler committed Apr 24, 2012
1 parent 647bbe1 commit 21a00d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/modules-1/simplepollmodule/actions/vote.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

// Time blocking
$timeblock = null;
if ($user) {
if (is_object($user) && $user->id > 0) {
$timeblock = $db->selectObject('poll_timeblock','user_id='.$user->id.' AND question_id='.$answer->question_id);
} else {
$timeblock = $db->selectObject('poll_timeblock',"ip_hash='".md5($_SERVER['REMOTE_ADDR'])."' AND question_id=".$answer->question_id);
Expand All @@ -54,7 +54,7 @@

// Update the timeblock
$timeblock->question_id = $answer->question_id;
if ($user) {
if (is_object($user) && $user->id > 0) {
$timeblock->lock_expires = 0;
$timeblock->user_id = $user->id;
$timeblock->ip_hash = '';
Expand Down

0 comments on commit 21a00d5

Please sign in to comment.