X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/a5400f9ae847a0ab45de050a721c57ba212399ed..4ee7eb56ec9413e399d85f1c0ead48d195630eab:/users/index.php diff --git a/users/index.php b/users/index.php index b95d70a..c8316ad 100644 --- a/users/index.php +++ b/users/index.php @@ -9,18 +9,29 @@ if (!empty($_GET)) if (isset($_GET['operonly']) && !isset($_POST['operonly'])) $_POST['operonly'] = $_GET['operonly']; + + if (isset($_GET['servicesonly']) && !isset($_POST['servicesonly'])) + $_POST['servicesonly'] = $_GET['servicesonly']; } -if (!empty($_POST)) { +if (!empty($_POST)) +{ do_log($_POST); $bantype = $_POST['bantype']; + if (isset($_POST['userch'])) { - foreach ($_POST["userch"] as $user) { + foreach ($_POST["userch"] as $user) + { $user = $name = base64_decode($user); $bantype = (isset($_POST['bantype'])) ? $_POST['bantype'] : NULL; - if (!$bantype) /* shouldn't happen? */{ + + if (!$bantype) /* shouldn't happen? */ + { Message::Fail("An error occured"); - } else { + } + + else + { $banlen_w = (isset($_POST['banlen_w'])) ? $_POST['banlen_w'] : NULL; $banlen_d = (isset($_POST['banlen_d'])) ? $_POST['banlen_d'] : NULL; $banlen_h = (isset($_POST['banlen_h'])) ? $_POST['banlen_h'] : NULL; @@ -37,15 +48,22 @@ if (!empty($_POST)) { $duration .= $banlen_h; } $user = $rpc->user()->get($user); + if (!$user && $bantype !== "qline") { Message::Fail("Could not find that user: User not online"); - } else { + } + + else + { $msg_msg = ($duration == "0" || $duration == "0w0d0h") ? "permanently" : "for " . rpc_convert_duration_string($duration); $reason = (isset($_POST['ban_reason'])) ? $_POST['ban_reason'] : "No reason"; + if ($bantype == "qline") $rpc->nameban()->add($name, $reason, $duration); + else if ($rpc->serverban()->add($user->id, $bantype, $duration, $reason)) Message::Success($user->name . " (*@" . $user->hostname . ") has been $bantype" . "d $msg_msg: $reason"); + else Message::Fail("Could not add $bantype against $name: $rpc->error"); } @@ -84,15 +102,22 @@ Click on a username to view more information. ?> - - - - - - - + + + + + + + + + + + + + +
Filter:
Nick - Host IP Account Server name="operonly" type="checkbox" value=""> Opers Only
Filter:
name="operonly" type="checkbox" value=""> Opers Only name="servicesonly" type="checkbox" value=""> Services Only
Nick + Host IP Account Server
@@ -151,12 +176,17 @@ Click on a username to view more information. (strpos($user->user->modes, "o") == false || strpos($user->user->modes,"S") !== false)) continue; + /* Some basic filtering for SERVICES */ + if (isset($_POST['servicesonly']) && + (strpos($user->user->modes,"S") == false)) + continue; + echo "\n"; echo ""; $isBot = (strpos($user->user->modes, "B") !== false) ? ' Bot' : ""; echo ""; - echo ""; - $account = (isset($user->user->account)) ? "user->account."\">".$user->user->account."" : 'None'; + echo ""; + $account = (isset($user->user->account)) ? "user->account."\">".htmlspecialchars($user->user->account)."" : 'None'; echo ""; $modes = (isset($user->user->modes)) ? "+" . $user->user->modes : ""; echo ""; @@ -165,7 +195,7 @@ Click on a username to view more information. $oper = (strpos($user->user->modes, "S") !== false) ? 'Services Bot' : ""; echo ""; - $secure = (isset($user->tls)) ? "Secure" : "Insecure"; + $secure = (isset($user->tls) || $user->hostname !== "localhost") ? "Secure" : "Insecure"; if (strpos($user->user->modes, "S") !== false) $secure = ""; echo "";
id."\">$user->name$isBot".$user->hostname." (".$user->ip.")".htmlspecialchars($user->hostname)." (".htmlspecialchars($user->ip ?? "None").")".$account."".$modes."".$oper."".$secure."