Commit 0358f501 authored by Zohten's avatar Zohten

ip blacklist filter

parent 3d43bd31
......@@ -26,6 +26,13 @@ abstract class Controller
public function execute()
{
// Filtering with IP blacklist
$ip_adress=$this->request->getIpAddr();
if(Blacklist::isBannedIP($ip_adress)){
$message = json_encode(["message" => "Your IP is banned!"]);
return Response::unauthorizedResponse($message);
};
$response = $this->processRequest();
if (empty($response)) {
// $response = Response::serverErrorResponse("error processing request in ". self::class); // Oh my PHP!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment