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(); ?> +

Users Overview


+ +Click on a username to view more information.
- - - - - - - -
Filter by: -
- Nick: - -
-
-
- Hostname: - -
-
-
- IP: - -
-
-
- Account: - -
-
+ user()->getAll(); Message::Info("Listing users which match account: \"" . $_POST['uf_account'] . "\""); ?> - - - - - - - - - - - +
Select allNickUIDHost / IPAccountUsermodes ℹ️OperSecureConnected toReputation ℹ️
+ + + + + + + + + + + + + + + + + + + + name), strtolower($_POST['uf_nick'])) !== 0 && @@ -143,35 +123,41 @@ $users = $rpc->user()->getAll(); continue; echo ""; - echo ""; - $isBot = (strpos($user->user->modes, "B") !== false) ? ' Bot' : ""; - echo "'; + echo ""; + $isBot = (strpos($user->user->modes, "B") !== false) ? ' Bot' : ""; + echo ""; echo ""; echo ""; - $account = (isset($user->user->account)) ? $user->user->account : 'None'; + $account = (isset($user->user->account)) ? $user->user->account : 'None'; echo ""; $modes = (isset($user->user->modes)) ? "+" . $user->user->modes : ""; echo ""; - $oper = (isset($user->user->operlogin)) ? $user->user->operlogin." ".$user->user->operclass."" : ""; + $oper = (isset($user->user->operlogin)) ? $user->user->operlogin." ".$user->user->operclass."" : ""; if (!strlen($oper)) - $oper = (strpos($user->user->modes, "S") !== false) ? 'Service' : ""; + $oper = (strpos($user->user->modes, "S") !== false) ? 'Services Bot' : ""; echo ""; - $secure = (isset($user->tls)) ? "Secure" : "Insecure"; + + $secure = (isset($user->tls)) ? "Secure" : "Insecure"; + if (strpos($user->user->modes, "S") !== false) + $secure = ""; echo ""; echo ""; echo ""; } - ?>
Filter:
Nick + Host IP Account
Select allNickUIDHost / IPAccountUsermodes ℹ️OperSecureConnected toReputation ℹ️
".$user->name.$isBot.'id."\">$user->name$isBot".$user->id."".$user->hostname." (".$user->ip.")".$account."".$modes."".$oper."".$secure."".$user->user->servername."".$user->user->reputation."
-
+ ?> + + + +
+ -
-
+
+ -
-
- +
+ + + +
+ + -
+ + +