mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-10-10 19:13:28 -04:00
19 lines
416 B
PHP
19 lines
416 B
PHP
<?php
|
|
|
|
if (!$Viewer->permitted('site_moderate_forums')) {
|
|
error(403);
|
|
}
|
|
authorize();
|
|
|
|
$threadId = (int)$_POST['threadid'];
|
|
$forum = (new Gazelle\Manager\Forum)->findByThreadId($threadId);
|
|
if (is_null($forum)) {
|
|
error(404);
|
|
}
|
|
if (!$forum->hasRevealVotes()) {
|
|
error(403);
|
|
}
|
|
$forum->addPollAnswer($threadId, trim($_POST['new_option']));
|
|
|
|
header("Location: forums.php?action=viewthread&threadid=$threadId");
|