Gazelle/sections/reports/ajax_claim_report.php

36 lines
602 B
PHP
Raw Normal View History

2012-12-10 08:00:21 +00:00
<?php
if (!check_perms('site_moderate_forums') || empty($_GET['id'])) {
print
json_encode(
array(
'status' => 'failure'
)
);
die();
}
$ID = (int)$_GET['id'];
$DB->query("SELECT ClaimerID FROM reports WHERE ID = '$ID'");
list($ClaimerID) = $DB->next_record();
if ($ClaimerID) {
print
json_encode(
array(
'status' => 'dupe'
)
);
2012-12-12 08:00:17 +00:00
die();
2012-12-10 08:00:21 +00:00
} else {
$UserID = $LoggedUser['ID'];
$DB->query("UPDATE reports SET ClaimerID = '$UserID' WHERE ID = '$ID'");
print
json_encode(
array(
'status' => 'success',
'username' => $LoggedUser['Username']
)
);
2012-12-12 08:00:17 +00:00
die();
2013-02-22 08:00:24 +00:00
}