Commit c082e55d authored by Cameron Munroe's avatar Cameron Munroe 💬
Browse files

Initial Release

parents
<?php
// Prevent someone directly connecting to this.
if(!defined('IN_MYBB')) {
die();
}
// Detail our information
function blackbox_info() {
return array(
"name" => "Blackbox",
"description" => 'Block Registration from known hosting, VPN, and Proxy IPs.',
"website" => "https://blackbox.ipinfo.app",
"author" => "Cameron Munroe",
"authorsite" => "https://gitlab.com/cmunroe",
"version" => "0.1",
'compatibility' => '18*',
'codename' => 'blackbox'
);
}
// Looks for registrations, and runs check function.
$plugins->add_hook("member_register_start", "check");
// Main Function for Checking Registrations.
function check(){
global $session;
$ip = $session->ipaddress;
// Set our API.
$api = 'https://blackbox.ipinfo.app/lookup/';
// Get our Reponse.
$response = file_get_contents($api . $ip);
// Verify response headers.
if(!strpos($http_response_header[0], "200")){
return;
}
if($reponse === "Y"){
error("Hello, please try again without having your VPN or Proxy active.");
}
return;
}
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