mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-09-30 16:12:54 -04:00
21 lines
424 B
PHP
21 lines
424 B
PHP
<?php
|
|
/** @phpstan-var \Gazelle\User $Viewer */
|
|
|
|
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, $vote);
|
|
|
|
header("Location: " . $poll->location());
|