Gazelle/sections/requests/interim.php

49 lines
1.5 KiB
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
2013-05-04 08:00:48 +00:00
if (!isset($_GET['id']) || !is_number($_GET['id'])) {
error(404);
}
2011-03-28 14:21:28 +00:00
$Action = $_GET['action'];
2013-05-04 08:00:48 +00:00
if ($Action != 'unfill' && $Action != 'delete') {
2011-03-28 14:21:28 +00:00
error(404);
}
$DB->query("SELECT UserID, FillerID FROM requests WHERE ID = ".$_GET['id']);
list($RequestorID, $FillerID) = $DB->next_record();
2013-05-04 08:00:48 +00:00
if ($Action == 'unfill') {
if ($LoggedUser['ID'] != $RequestorID && $LoggedUser['ID'] != $FillerID && !check_perms('site_moderate_requests')) {
2013-02-22 08:00:24 +00:00
error(403);
2011-03-28 14:21:28 +00:00
}
2013-05-04 08:00:48 +00:00
} elseif ($Action == "delete") {
if ($LoggedUser['ID'] != $RequestorID && !check_perms('site_moderate_requests')) {
2013-02-22 08:00:24 +00:00
error(403);
2011-03-28 14:21:28 +00:00
}
}
2013-05-04 08:00:48 +00:00
View::show_header(ucwords($Action) . ' Request');
2011-03-28 14:21:28 +00:00
?>
<div class="thin center">
2013-05-04 08:00:48 +00:00
<div class="box" style="width: 600px; margin: 0px auto;">
2011-03-28 14:21:28 +00:00
<div class="head colhead">
<?=ucwords($Action)?> Request
</div>
<div class="pad">
2013-05-04 08:00:48 +00:00
<form class="<?=(($Action == 'delete') ? 'delete_form' : 'edit_form')?>" name="request" action="requests.php" method="post">
2011-03-28 14:21:28 +00:00
<input type="hidden" name="action" value="take<?=$Action?>" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="id" value="<?=$_GET['id']?>" />
2013-05-04 08:00:48 +00:00
<? if ($Action == 'delete') { ?>
2011-03-28 14:21:28 +00:00
<div class="warning">You will <strong>not</strong> get your bounty back if you delete this request.</div>
2013-05-04 08:00:48 +00:00
<? } ?>
2011-03-28 14:21:28 +00:00
<strong>Reason:</strong>
<input type="text" name="reason" size="30" />
<input value="<?=ucwords($Action)?>" type="submit" />
</form>
</div>
</div>
</div>
<?
2012-10-11 08:00:15 +00:00
View::show_footer();
2013-05-04 08:00:48 +00:00
?>