mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-31 02:21:36 +00:00
Empty commit
This commit is contained in:
parent
d16aef7dbf
commit
9251320939
@ -120,9 +120,9 @@ 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));
|
||||||
} else if ($Message) {
|
} elseif ($Message) {
|
||||||
print json_encode(array('status' => $Status, 'error' => $Message));
|
print json_encode(array('status' => $Status, 'error' => $Message));
|
||||||
} else {
|
} else {
|
||||||
print json_encode(array('status' => $Status));
|
print json_encode(array('status' => $Status));
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user