mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-10-06 07:13:05 -04:00
20 lines
386 B
PHP
20 lines
386 B
PHP
<?php
|
|
|
|
authorize();
|
|
|
|
$poll = (new Gazelle\Manager\ForumPoll)->findById((int)($_POST['threadid'] ?? 0));
|
|
if (is_null($poll)) {
|
|
error(404);
|
|
}
|
|
if (!$Viewer->permitted('site_moderate_forums') && !$poll->hasRevealVotes()) {
|
|
error(403);
|
|
}
|
|
|
|
$vote = (int)$_GET['vote'];
|
|
if (!$vote) {
|
|
error(404);
|
|
}
|
|
$poll->modifyVote($Viewer->id(), $vote);
|
|
|
|
header("Location: " . $poll->location());
|