X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/1a1ee050c8a65cb3bdf6162b50fecf1fea25e4bf..62d4ea03f96d19a718a104bfec4fa7a583341b12:/users.php diff --git a/users.php b/users.php index c992015..cbc44b0 100644 --- a/users.php +++ b/users.php @@ -1,54 +1,45 @@ user()->get($user); - if (!$nick) - { - Message::Fail("Could not find that user. Maybe they disconnected after you clicked this?"); - return; - } - - $msg_msg = ($duration == "0" || $duration == "0w0d0h") ? "permanently" : "for ".rpc_convert_duration_string($duration); - $reason = (isset($_POST['ban_reason'])) ? $_POST['ban_reason'] : "No reason"; - if ($rpc->serverban()->add($user, $bantype, $duration, $reason)) - { - $c = $nick->client; - Message::Success($c->name . " (*@".$c->hostname.") has been $bantype" . "d $msg_msg: $reason"); + } 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; + + $duration = ""; + if (!$banlen_d && !$banlen_h && !$banlen_w) + $duration .= "0"; + else { + if ($banlen_w) + $duration .= $banlen_w; + if ($banlen_d) + $duration .= $banlen_d; + if ($banlen_h) + $duration .= $banlen_h; + } + $user = $rpc->user()->get($user); + if (!$user && $bantype !== "qline") { + Message::Fail("Could not find that user: User not online"); + } 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"); + } } } } @@ -57,36 +48,12 @@ if (!empty($_POST)) /* Get the user list */ $users = $rpc->user()->getAll(); ?> +
Filter by: | -- - | -- - | -- - | -- - | - -
---|
Select all | -Nick | -UID | -Host / IP | -Account | -Usermodes â¹ï¸ | -Oper | -Secure | -Connected to | -Reputation â¹ï¸ | +
---|
Filter: |
+
+
+ Select all | +Nick | +UID | +Host / IP | +Account | +Usermodes â¹ï¸ | +Oper | +Secure | +Connected to | +Reputation â¹ï¸ | + +
---|
+
- - + |
+
- - - + | ||
+ + + + |