mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-09-30 16:12:54 -04:00
31 lines
669 B
PHP
31 lines
669 B
PHP
<?php
|
|
authorize();
|
|
$ThreadID = (int)$_GET['threadid'];
|
|
$NewVote = (int)$_GET['vote'];
|
|
|
|
if (!$ThreadID || !$NewVote) {
|
|
error(404);
|
|
}
|
|
|
|
if (!check_perms('site_moderate_forums')) {
|
|
$ForumID = $DB->scalar("
|
|
SELECT ForumID
|
|
FROM forums_topics
|
|
WHERE ID = ?
|
|
", $ThreadID
|
|
);
|
|
if (!in_array($ForumID, $ForumsRevealVoters)) {
|
|
error(403);
|
|
}
|
|
}
|
|
|
|
$DB->prepared_query("
|
|
UPDATE forums_polls_votes SET
|
|
Vote = ?
|
|
WHERE TopicID = ?
|
|
AND UserID = ?
|
|
", $NewVote, $ThreadID, $LoggedUser['ID']
|
|
);
|
|
$Cache->delete_value('polls_'.$ThreadID);
|
|
header("Location: forums.php?action=viewthread&threadid=".$ThreadID);
|