From b01e832617f40c8708dd228a64b3b992e1c42ad5 Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 23 Nov 2021 00:48:19 -0500 Subject: [PATCH] referral program disable --- globals/functions.php | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/globals/functions.php b/globals/functions.php index 8b90b1c..f348a5a 100644 --- a/globals/functions.php +++ b/globals/functions.php @@ -748,7 +748,11 @@ function inReferralProgram($user) } return false; */ - return true; + if ($GLOBALS['user']->isOwner()) + { + return true; + } + return false; } function isSignupKeyUserGenerated($signupkey) @@ -758,7 +762,10 @@ function isSignupKeyUserGenerated($signupkey) $key->execute(); if ($key->rowCount() > 0) { - return true; + if (!banned($key->fetch(PDO::FETCH_OBJ)->userGen)) + { + return true; + } } return false; } @@ -4997,18 +5004,21 @@ function banUser($uid, $reason, $banexpiration, $bantype) if ($isstaffcheck->rowCount() == 0) { - kickUserIfInGame($uid, "You've been banned from Alphaland, '".$reason."'"); - - $ban = $GLOBALS['pdo']->prepare("INSERT INTO user_bans(uid, banReason, whenBanned, banExpiration, banType, whoBanned, valid) VALUES(:u, :br, UNIX_TIMESTAMP(), :be, :bt, :wb, 1)"); - $ban->bindParam(":u", $uid, PDO::PARAM_INT); - $ban->bindParam(":br", $reason, PDO::PARAM_STR); - $ban->bindParam(":be", $banexpiration, PDO::PARAM_INT); - $ban->bindParam(":bt", $bantype, PDO::PARAM_INT); - $ban->bindParam(":wb", $GLOBALS['user']->id, PDO::PARAM_INT); - $ban->execute(); - if ($ban->rowCount() > 0) + if (!banned($uid)) { - return true; + kickUserIfInGame($uid, "You've been banned from Alphaland, '".$reason."'"); + + $ban = $GLOBALS['pdo']->prepare("INSERT INTO user_bans(uid, banReason, whenBanned, banExpiration, banType, whoBanned, valid) VALUES(:u, :br, UNIX_TIMESTAMP(), :be, :bt, :wb, 1)"); + $ban->bindParam(":u", $uid, PDO::PARAM_INT); + $ban->bindParam(":br", $reason, PDO::PARAM_STR); + $ban->bindParam(":be", $banexpiration, PDO::PARAM_INT); + $ban->bindParam(":bt", $bantype, PDO::PARAM_INT); + $ban->bindParam(":wb", $GLOBALS['user']->id, PDO::PARAM_INT); + $ban->execute(); + if ($ban->rowCount() > 0) + { + return true; + } } } }