$value) { $tok = explode(",", $value); $ban = base64_decode($tok[0]); $type = base64_decode($tok[1]); $success = false; if ($type == "except") $success = $rpc->serverbanexception()->delete($ban); else if ($type == "qline" || $type == "local-qline") $success = $rpc->nameban()->delete($ban); else $success = $rpc->serverban()->delete($ban, $type); if ($success) Message::Success("$type has been removed for $ban"); else Message::Fail("Unable to remove $type on $ban: $rpc->error"); } } } elseif (isset($_POST['do_add_ban'])) { if (!current_user_can(PERMISSION_SERVER_BAN_ADD)) { Message::Fail("Could not add: Permission denied"); } else { if (empty($_POST['ban_host']) || empty($_POST['ban_type'])) { Message::Fail("Unable to add Server Ban: No host or ban type selected"); } else { $ban_host = $_POST['ban_host']; $ban_type = $_POST['ban_type']; $ban_soft = empty($_POST['ban_soft']) ? false : true; $ban_duration = $_POST['ban_duration'] ?? 0; $ban_reason = $_POST['ban_reason'] ?? ''; if (!str_contains($ban_host, "@")) $ban_host = "*@$ban_host"; // prefix ban with *@ if no @ present if ($ban_soft) $ban_host = "%$ban_host"; // prefix ban with % if soft-ban if ($rpc->serverban()->add($ban_host, $ban_type, $ban_duration, $ban_reason)) { Message::Success("Ban added on ".htmlspecialchars($ban_host)); } else { $success = false; if (($rpc->errno == -1001) && !empty($_POST['edit_existing'])) { // existing one = del + add // and yeah we do this after add() fails because then we now // at least the syntax and fields and everything are OK. // This so we don't accidentally remove a ban and the add fails // causing the edit to result in a deletion. $e = explode(":", $_POST['edit_existing'], 2); if (count($e) == 2) { if ($rpc->serverban()->delete($e[1], $e[0])) { /* Good, now try the add operation */ if ($rpc->serverban()->add($ban_host, $ban_type, $ban_duration, $ban_reason)) { Message::Success("Ban successfully modified: ".htmlspecialchars($ban_host)); $success = true; } } } } if (!$success) Message::Fail("The ".htmlspecialchars($ban_type)." on ".htmlspecialchars($ban_host)." could not be added: $rpc->error / $rpc->errno"); } } } } elseif (isset($_POST['search_types']) && !empty($_POST['search_types'])) { } } ?>

Server Bans Overview

Here are all your network bans, from K-Lines to G-Lines, it's all here.

Click on an entry to edit it.

> Add Ban

Mask Type Duration Reason Set By Set On Expires