mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-10-16 19:13:11 -04:00
29 lines
478 B
PHP
29 lines
478 B
PHP
<?php
|
|
/** @phpstan-var \Gazelle\User $Viewer */
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Gazelle;
|
|
|
|
authorize();
|
|
|
|
if (!$Viewer->permitted('site_moderate_forums')) {
|
|
error(403);
|
|
}
|
|
|
|
$poll = (new Manager\ForumPoll())->findById((int)($_POST['threadid'] ?? 0));
|
|
if (is_null($poll)) {
|
|
error(404);
|
|
}
|
|
if (!$poll->hasRevealVotes()) {
|
|
error(403);
|
|
}
|
|
|
|
$vote = (int)$_GET['vote'];
|
|
if (!$vote) {
|
|
error(404);
|
|
}
|
|
$poll->removeAnswer($vote);
|
|
|
|
header("Location: " . $poll->location());
|