diff --git a/globals/config.php b/globals/config.php index 7c54f77..ed2438f 100644 --- a/globals/config.php +++ b/globals/config.php @@ -12,6 +12,7 @@ use Alphaland\Users\Activation; use Alphaland\Users\TwoFactor; +use Alphaland\Moderation\UserModerationManager; try { @@ -136,11 +137,10 @@ try } $activated = Activation::IsUserActivated($GLOBALS['user']->id); - $twofactor = TwoFactor::IsSession2FAUnlocked(); + $banned = UserModerationManager::IsBanned($GLOBALS['user']->id); $maintenance = checkIfUnderMaintenance(); - $banned = checkIfBanned($GLOBALS['user']->id); //step 1, check if under maintenance if ($maintenance) { //maintenance redirect diff --git a/globals/functions.php b/globals/functions.php index c384d9c..fec5c8a 100644 --- a/globals/functions.php +++ b/globals/functions.php @@ -6846,19 +6846,6 @@ function RCCHeaderEnvironment($nodie=false) //authenticates if the accesskey hea return false; } -function checkIfBanned($uid) -{ - $checkban = $GLOBALS['pdo']->prepare("SELECT * FROM user_bans WHERE uid = :i AND valid = 1"); - $checkban->bindParam(":i", $uid, PDO::PARAM_INT); - $checkban->execute(); - - if ($checkban->rowCount() > 0) - { - return true; - } - return false; -} - function isUnderMaintenance() { $checkMaintenance = $GLOBALS['pdo']->prepare("SELECT * FROM websettings WHERE maintenance = 1"); diff --git a/html/ban.php b/html/ban.php index 7a5d476..8aee9b2 100644 --- a/html/ban.php +++ b/html/ban.php @@ -1,6 +1,8 @@ id)) +use Alphaland\Moderation\UserModerationManager; + +if (UserModerationManager::IsBanned($user->id)) { $banInfo = $pdo->prepare("SELECT * FROM user_bans WHERE uid = :id AND valid = 1"); $banInfo->bindParam(":id", $user->id, PDO::PARAM_INT); @@ -105,5 +107,5 @@ if (checkIfBanned($user->id)) else { //not banned - redirect("/404"); + redirect("/"); } \ No newline at end of file