mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-01-16 18:04:34 -05:00
23 lines
453 B
PHP
23 lines
453 B
PHP
<?php
|
|
/** @phpstan-var \Gazelle\User $Viewer */
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Gazelle;
|
|
|
|
if (!$Viewer->permitted('site_moderate_forums')) {
|
|
Error403::error();
|
|
}
|
|
authorize();
|
|
|
|
$poll = new Manager\ForumPoll()->findById((int)($_POST['threadid'] ?? 0));
|
|
if (is_null($poll)) {
|
|
Error404::error();
|
|
}
|
|
if (!$poll->hasRevealVotes()) {
|
|
Error403::error();
|
|
}
|
|
$poll->addAnswer(trim($_POST['new_option']));
|
|
|
|
header("Location: " . $poll->location());
|