isStaff())) { redirect("../404"); //u not admin nigga } $alert = ""; if(isset($_POST['unbanuser'])) { $id = getID($_POST['unbanuser']); if (unbanUser($id)) { logStaffAction("Unbanned User ".$id); $alert = ""; } else { $alert = ""; } } if(isset($_POST['banuser'])) { $postcount = count($_POST); if ($postcount > 3) { $alert = ""; } elseif (empty($_POST['banuser'])) { $alert = ""; } elseif(usernameExists($_POST['banuser']) == false) { $alert = ""; } elseif (empty($_POST['banreason'])) { $alert = ""; } elseif ($postcount < 3) { $alert = ""; } else { $bantype = 0; //default warning bantype $banexpiration = 0; if (isset($_POST['temp_checkbox'])) { //tempban $bantype = 1; $banexpiration = time() + 86400; //add one day to current time } elseif (isset($_POST['perm_checkbox'])) { //perm ban $bantype = 2; } $id = getID($_POST['banuser']); if (banUser($id, cleanInput($_POST['banreason']), $banexpiration, $bantype)) { logStaffAction("Banned User ".$id); $alert = ""; } else { $alert = ""; } } } $b = $pdo->prepare("SELECT * FROM user_bans WHERE valid = 1"); $b->bindParam(":i", $id, PDO::PARAM_INT); $b->execute(); $banneduser = ""; if ($b->rowCount() > 0) { foreach ($b as $bannedplayer) { $banneddate = date("m/d/Y", $bannedplayer['whenBanned']); $bannedusername = getUsername($bannedplayer['uid']); $bannedreason = cleanOutputNoFilter($bannedplayer['banReason']); $bannedExpiration = (int)$bannedplayer['banExpiration']; $bannedType = (int)$bannedplayer['banType']; if ($bannedType == 0) { $bannedExpiration = "Warning"; } elseif ($bannedType == 2) { $bannedExpiration = "Permanent"; } else { $bannedExpiration = date("m/d/Y", $bannedplayer['banExpiration']); } $banneduser .= << {$banneddate} {$bannedusername} {$bannedreason} {$bannedExpiration} EOT; } } $body = << {$alert}
User Management



{$banneduser}
Date Username Reason Expiration
EOT; pageHandler(); $ph->pageTitle("User Manage"); $ph->body = $body; $ph->output(); ?>