Files
ops-Gazelle/sections/forums/take_topic_notes.php
T
2021-01-31 18:12:36 +00:00

21 lines
478 B
PHP

<?php
authorize();
if (!check_perms('site_moderate_forums')) {
error(403);
}
$threadId = (int)$_POST['threadid'];
$forum = (new Gazelle\Manager\Forum)->findByThreadId($threadId);
if (is_null($forum)) {
error(404);
}
$body = trim($_POST['threadid'] ?? null);
if (!strlen($body)) {
error("Thread note cannot be empty");
}
$forum->addThreadNote($threadId, $LoggedUser['ID'], $body);
header("Location: forums.php?action=viewthread&threadid=$threadId#thread_notes");