From: Valerie Pond Date: Sat, 7 Jan 2023 23:47:33 +0000 (+0000) Subject: Allow soft-bans (doesn't affect logged-in users) X-Git-Tag: 0.9~563 X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/commitdiff_plain/dc961139b6abc47e087ec829b862cc07550329a9 Allow soft-bans (doesn't affect logged-in users) --- diff --git a/index.php b/index.php index 938b677..fbb29c8 100644 --- a/index.php +++ b/index.php @@ -37,8 +37,18 @@ if (!empty($_POST)) { else /* It did */ { - if (!strpos($iphost, "@")) // doesn't have full mask + if (( + $bantype == "gline" || + $bantype == "gzline" || + $bantype == "shun" || + $bantype == "eline" + ) && strpos($iphost, "@") == false) // doesn't have full mask $iphost = "*@" . $iphost; + + $soft = ($_POST['soft']) ? true : false; + + if ($soft) + $iphost = "%" . $iphost; /* duplicate code for now [= */ $banlen_w = (isset($_POST['banlen_w'])) ? $_POST['banlen_w'] : NULL; $banlen_d = (isset($_POST['banlen_d'])) ? $_POST['banlen_d'] : NULL; @@ -63,7 +73,7 @@ if (!empty($_POST)) { Message::Success("Host / IP: $iphost has been $bantype" . "d $msg_msg: $reason"); } else - Message::Fail("The $bantype against \"$iphost\" could not be added."); + Message::Fail("The $bantype against \"$iphost\" could not be added: $rpc->error"); } } else /* It came from the Users tab */ @@ -423,6 +433,7 @@ rpc_pop_lists();

+ Don't affect logged-in users (soft)