|
|
@@ -4,6 +4,7 @@ require_once("user.php");
|
|
|
$USER = new User("registration_callback");
|
|
|
$ban = isset($_GET['ban']) ? strtoupper($_GET['ban']) : "";
|
|
|
$whitelist = isset($_GET['whitelist']) ? $_GET['whitelist'] : false;
|
|
|
+$blacklist = isset($_GET['blacklist']) ? $_GET['blacklist'] : false;
|
|
|
$currentIP = get_client_ip();
|
|
|
|
|
|
if ($whitelist) {
|
|
|
@@ -14,6 +15,11 @@ if ($whitelist) {
|
|
|
$skipped = true;
|
|
|
}
|
|
|
}
|
|
|
+if ($blacklist) {
|
|
|
+ if(in_array($currentIP, getWhitelist($blacklist))) {
|
|
|
+ !$debug ? exit(http_response_code(401)) : die("$currentIP Blacklisted");
|
|
|
+ }
|
|
|
+}
|
|
|
if (isset($_GET['admin'])) {
|
|
|
if($USER->authenticated && $USER->role == "admin" && !in_array(strtoupper($USER->username), getBannedUsers($ban))) {
|
|
|
!$debug ? exit(http_response_code(200)) : die("$USER->username on $currentIP Authorized At Admin Level");
|
|
|
@@ -36,4 +42,4 @@ if ($skipped) {
|
|
|
!$debug ? exit(http_response_code(401)) : die("$USER->username on $currentIP Not Authorized Nor On Whitelist");
|
|
|
}
|
|
|
|
|
|
-?>
|
|
|
+?>
|