Empty commit

This commit is contained in:
Git 2013-08-14 08:00:46 +00:00
parent d16aef7dbf
commit 9251320939
2 changed files with 5 additions and 12 deletions

View File

@ -120,7 +120,7 @@ function check_perms($PermissionName, $MinClass = 0) {
*/ */
function json_die($Status, $Message) { function json_die($Status, $Message) {
if ($Status == "success" && $Message) { if ($Status == 'success' && $Message) {
print json_encode(array('status' => $Status, 'response' => $Message)); print json_encode(array('status' => $Status, 'response' => $Message));
} elseif ($Message) { } elseif ($Message) {
print json_encode(array('status' => $Status, 'error' => $Message)); print json_encode(array('status' => $Status, 'error' => $Message));

View File

@ -24,18 +24,11 @@
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: application/json; charset=utf-8');
// Enforce rate limiting everywhere except info.php // Enforce rate limiting everywhere except info.php
if (!in_array($UserID, $UserExceptions) && isset($_GET['action']) && in_array($_GET['action'], $LimitedPages)) { if (!in_array($UserID, $UserExceptions) && isset($_GET['action']) && in_array($_GET['action'], $LimitedPages)) {
if (!$userrequests = $Cache->get_value('ajax_requests_'.$UserID)) { if (!$UserRequests = $Cache->get_value('ajax_requests_'.$UserID)) {
$userrequests = 0; $UserRequests = 0;
$Cache->cache_value('ajax_requests_'.$UserID, '0', $AJAX_LIMIT[1]); $Cache->cache_value('ajax_requests_'.$UserID, '0', $AJAX_LIMIT[1]);
} }
if ($userrequests > $AJAX_LIMIT[0]) { if ($UserRequests > $AJAX_LIMIT[0]) {
print json_encode(
array(
'status' => 'failure',
'response' => 'Rate limit exceeded.'
)
);
json_die("failure", "rate limit exceeded"); json_die("failure", "rate limit exceeded");
} else { } else {
$Cache->increment_value('ajax_requests_'.$UserID); $Cache->increment_value('ajax_requests_'.$UserID);