mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-10-17 04:03:13 -04:00
26 lines
656 B
PHP
26 lines
656 B
PHP
<?php
|
|
/** @phpstan-var \Gazelle\User $Viewer */
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Gazelle;
|
|
|
|
if (!$Viewer->permitted('forums_polls_moderate')) {
|
|
error(403);
|
|
}
|
|
authorize();
|
|
|
|
$poll = (new Manager\ForumPoll())->findById((int)($_POST['threadid'] ?? 0));
|
|
if (is_null($poll)) {
|
|
error('Cannot find a poll for that thread');
|
|
}
|
|
if (isset($_POST['ck-feat']) && isset($_POST['feature'])) {
|
|
$poll->setField('Featured', $poll->isFeatured() ? null : date('Y-m-d H:i:s'));
|
|
}
|
|
if (isset($_POST['ck-close']) && isset($_POST['close'])) {
|
|
$poll->setField('Closed', $poll->isClosed() ? '0' : '1');
|
|
}
|
|
$poll->modify();
|
|
|
|
header("Location: {$poll->location()}");
|