mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-01-16 18:04:34 -05:00
20 lines
392 B
PHP
20 lines
392 B
PHP
<?php
|
|
/** @phpstan-var \Gazelle\User $Viewer */
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Gazelle;
|
|
|
|
if (!$Viewer->permitted('site_moderate_forums')) {
|
|
Error403::error();
|
|
}
|
|
authorize();
|
|
|
|
$post = new Manager\ForumPost()->findById((int)($_GET['postid'] ?? 0));
|
|
if (is_null($post)) {
|
|
Error404::error();
|
|
}
|
|
$post->pin($Viewer, empty($_GET['remove']));
|
|
|
|
header('Location: ' . $post->location());
|