mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-09-13 01:45:16 -04: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());
|