mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-19 22:47:59 +00:00
slicker check for upload permissions, included http response code
This commit is contained in:
@@ -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')));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user