mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-10-07 10:13:02 -04:00
25 lines
640 B
PHP
25 lines
640 B
PHP
<?php
|
|
|
|
$request = (new Gazelle\Manager\Request)->findById((int)$_GET['id']);
|
|
if (is_null($request)) {
|
|
error(404);
|
|
}
|
|
$action = $_GET['action'];
|
|
if ($action === 'unfill') {
|
|
if (!in_array($Viewer->id(), [$request->userId(), $request->fillerId()]) && !$Viewer->permitted('site_moderate_requests')) {
|
|
error(403);
|
|
}
|
|
} elseif ($action === 'delete') {
|
|
if ($Viewer->id() != $request->userId() && !$Viewer->permitted('site_moderate_requests')) {
|
|
error(403);
|
|
}
|
|
} else {
|
|
error(0);
|
|
}
|
|
|
|
echo $Twig->render('request/interim.twig', [
|
|
'action' => $action,
|
|
'request' => $request,
|
|
'viewer' => $Viewer,
|
|
]);
|