slicker check for upload permissions, included http response code

This commit is contained in:
Chris
2020-06-23 09:17:49 +02:00
parent e13f4816fb
commit 0250b6a577
5 changed files with 13 additions and 8 deletions

View File

@@ -691,4 +691,13 @@ function isCloudflare() {
$ipCheck = _cloudflare_CheckIP($_SERVER['REMOTE_ADDR']);
$requestCheck = _cloudflare_Requests_Check();
return ($ipCheck && $requestCheck);
}
function executeUploadPermission()
{
if(defined('ALLOWED_SUBNET') && !isIPInRange( getUserIP(), ALLOWED_SUBNET ))
{
http_response_code(403);
exit(json_encode(array('status'=>'err','reason'=> 'Access denied')));
}
}