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

View File

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