Public Member Functions | |
addAction () | |
Protected Attributes | |
$_cookieCheckActions = array('add') |
Definition at line 34 of file VoteController.php.
addAction | ( | ) |
Check poll data
Definition at line 43 of file VoteController.php.
00044 { 00045 $pollId = intval($this->getRequest()->getParam('poll_id')); 00046 $answerId = intval($this->getRequest()->getParam('vote')); 00047 00048 $poll = Mage::getModel('poll/poll')->load($pollId); 00049 00050 /** 00051 * Check poll data 00052 */ 00053 if ($poll->getId() && !$poll->getClosed() && !$poll->isVoted()) { 00054 $vote = Mage::getModel('poll/poll_vote') 00055 ->setPollAnswerId($answerId) 00056 ->setIpAddress(ip2long($this->getRequest()->getServer('REMOTE_ADDR'))) 00057 ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId()); 00058 00059 $poll->addVote($vote); 00060 Mage::getSingleton('core/session')->setJustVotedPoll($pollId); 00061 } 00062 $this->_redirectReferer(); 00063 }
$_cookieCheckActions = array('add') [protected] |
Reimplemented from Mage_Core_Controller_Varien_Action.
Definition at line 41 of file VoteController.php.