Index: branches/5.2.x/units/polls/poll_tp.php =================================================================== diff -u -N -r15155 -r15567 --- branches/5.2.x/units/polls/poll_tp.php (.../poll_tp.php) (revision 15155) +++ branches/5.2.x/units/polls/poll_tp.php (.../poll_tp.php) (revision 15567) @@ -1,6 +1,6 @@ getObject($params); /* @var $object kDBItem */ - if (!$object->GetDBField('AllowMultipleVotings')) { + if ( !$object->GetDBField('AllowMultipleVotings') ) { + $where_clause = Array ( + 'PollId = ' . $object->GetID(), + 'CreatedById = ' . $this->Application->RecallVar('user_id'), + 'UserIP = ' . $this->Conn->qstr($this->Application->getClientIp()), + ); + $sql = 'SELECT StatisticsId - FROM '.TABLE_PREFIX.'PollsStatistics - WHERE PollId = '.$object->GetID().' AND CreatedById = '.$this->Application->RecallVar('user_id').' AND UserIP = '.$this->Conn->qstr(getenv('REMOTE_ADDR')); + FROM ' . TABLE_PREFIX . 'PollsStatistics + WHERE (' . implode(') AND (', $where_clause) . ')'; + return $this->Conn->GetOne($sql) > 0; } Index: branches/5.2.x/units/posts/post_eh.php =================================================================== diff -u -N -r15249 -r15567 --- branches/5.2.x/units/posts/post_eh.php (.../post_eh.php) (revision 15249) +++ branches/5.2.x/units/posts/post_eh.php (.../post_eh.php) (revision 15567) @@ -1,6 +1,6 @@ SetDBField('Modified_date', $now); $object->SetDBField('Modified_time', $now); - $object->SetDBField('IPAddress', $_SERVER['REMOTE_ADDR']); + $object->SetDBField('IPAddress', $this->Application->getClientIp()); $sql = 'SELECT Username FROM ' . TABLE_PREFIX . 'Users Index: branches/5.2.x/units/poll_comments/poll_comment_eh.php =================================================================== diff -u -N -r15148 -r15567 --- branches/5.2.x/units/poll_comments/poll_comment_eh.php (.../poll_comment_eh.php) (revision 15148) +++ branches/5.2.x/units/poll_comments/poll_comment_eh.php (.../poll_comment_eh.php) (revision 15567) @@ -1,6 +1,6 @@ SetDBField('CreatedById', $this->Application->RecallVar('user_id')); - $object->SetDBField('UserIP', $_SERVER['REMOTE_ADDR']); + $object->SetDBField('UserIP', $this->Application->getClientIp()); $object->SetDBField('Status', STATUS_ACTIVE); } Index: branches/5.2.x/units/polls/poll_eh.php =================================================================== diff -u -N -r15148 -r15567 --- branches/5.2.x/units/polls/poll_eh.php (.../poll_eh.php) (revision 15148) +++ branches/5.2.x/units/polls/poll_eh.php (.../poll_eh.php) (revision 15567) @@ -1,6 +1,6 @@ Application->getClientIp(); if (!$object->GetDBField('AllowMultipleVotings')) { $sql = 'SELECT StatisticsId