2011-03-28 14:21:28 +00:00
|
|
|
<?
|
|
|
|
authorize();
|
|
|
|
$ThreadID = $_GET['threadid'];
|
|
|
|
$NewVote = $_GET['vote'];
|
|
|
|
|
2013-05-05 08:00:31 +00:00
|
|
|
if (is_number($ThreadID) && is_number($NewVote)) {
|
2013-06-04 08:00:34 +00:00
|
|
|
if (!check_perms('site_moderate_forums')) {
|
|
|
|
$DB->query("
|
|
|
|
SELECT ForumID
|
|
|
|
FROM forums_topics
|
|
|
|
WHERE ID = $ThreadID");
|
2011-05-14 08:00:05 +00:00
|
|
|
list($ForumID) = $DB->next_record();
|
2013-05-05 08:00:31 +00:00
|
|
|
if (!in_array($ForumID, $ForumsRevealVoters)) {
|
2011-05-14 08:00:05 +00:00
|
|
|
error(403);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-05 08:00:31 +00:00
|
|
|
$DB->query("
|
|
|
|
UPDATE forums_polls_votes
|
|
|
|
SET Vote = $NewVote
|
|
|
|
WHERE TopicID = $ThreadID
|
|
|
|
AND UserID = ".$LoggedUser['ID']);
|
2011-03-28 14:21:28 +00:00
|
|
|
$Cache->delete_value('polls_'.$ThreadID);
|
|
|
|
header("Location: forums.php?action=viewthread&threadid=".$ThreadID);
|
2013-02-22 08:00:24 +00:00
|
|
|
|
2011-03-28 14:21:28 +00:00
|
|
|
} else {
|
|
|
|
error(404);
|
|
|
|
}
|