if ($ip == -1 || $ip == false) { THdie("ADbanbadip"); } $banreason = 'This is an admin ban, you were not banned for a specific post.'; $bannedby = $_SESSION['username'] . " via admin ban panel"; $db->banip($ip, $_POST['ipsub'] == "on", $banreason, 'admin ban', $_POST['adminreason'], "", $_POST['duration'], $bannedby); header("Location: " . THurl . "admin.php?a=x"); } elseif ($_GET['t'] == "ux") { $reason = $_SESSION['username'] . " via admin ban panel"; if (isset($_GET['reason'])) { $reason = $_GET['reason']; } $bans = $db->getallbans(); foreach ($bans as $ban) { if ($_POST['del' . $ban['id']]) { $db->delban($ban['id'], $reason); } } header("Location: " . THurl . "admin.php?a=x"); } elseif ($_GET['t'] == "lx") { if (isset($_POST['ip'])) { $ban_info = $db->getban($_POST['ip']); // Did we find at least one ban? // If so, redirect to the ban ID of the first element in the array. if (count($ban_info) > 0) { header("Location: " . THurl . "admin.php?a=x&banselect=" . $ban_info[0]['id']); } else { header("Location: " . THurl . "admin.php?a=x"); // failure } } else {