- if (!empty($_POST['tklch']))
- foreach ($_POST as $key => $value) {
- foreach ($value as $tok) {
- $tok = explode(",", $tok);
- $ban = base64_decode($tok[0]);
- $type = base64_decode($tok[1]);
- if ($rpc->serverban()->delete($ban, $type))
- Message::Success("$type has been removed for $ban");
- else
- Message::Fail("Unable to remove $type on $ban: $rpc->error");
- }
- }
-
- if (!empty($_POST['sf']))
- foreach ($_POST as $key => $value) {
- foreach ($value as $tok) {
- $tok = explode(",", $tok);
- $name = base64_decode($tok[0]);
- $match_type = base64_decode($tok[1]);
- $spamfilter_targets = base64_decode($tok[2]);
- $ban_action = base64_decode($tok[3]);
- if ($rpc->spamfilter()->delete($name, $match_type, $spamfilter_targets, $ban_action))
- Message::Success("Spamfilter on $name has been removed");
- else
- Message::Fail("Unable to remove spamfilter on $name: $rpc->error");
- }
- }
-}
-
-rpc_pop_lists();
-?>
-
-<div class="tab-content\">
-<div id="overview" data-tab-content class="active">
- <table class='unrealircd_overview'>
- <th>Chat Overview</th><th></th>
- <tr><td><b>Users</b></td><td><?php echo count(RPC_List::$user); ?></td></tr>
- <tr><td><b>Opers</b></td><td><?php echo RPC_List::$opercount; ?></td></tr>
- <tr><td><b>Services</b></td><td><?php echo RPC_List::$services_count; ?></td></tr>
- <tr><td><b>Most popular channel</b></td><td><?php echo RPC_List::$most_populated_channel; ?> (<?php echo RPC_List::$channel_pop_count; ?> users)</td></tr>
- <tr><td><b>Channels</b></td><td><?php echo count(RPC_List::$channel); ?></td></tr>
- <tr><td><b>Server bans</b></td><td><?php echo count(RPC_List::$tkl); ?></td></tr>
- <tr><td><b>Spamfilter entries</b></td><td><?php echo count(RPC_List::$spamfilter); ?></td></tr></th>
- </table></div></div>
-
- <div class="tab-content\">
- <div id="Users" data-tab-content>
- <table class='users_filter'>
- <th class="thuf">Filter by: </th>
- <th>
- <form action="" method="post">
- Nick: <input name="uf_nick" id="uf_nick" type="text">
- <input class="cute_button2" type="submit" value="Search">
- </form>
- </th>
- <th>
- <form action="" method="post">
- Hostname: <input name="uf_host" id="uf_host" type="text">
- <input class="cute_button2" type="submit" value="Search">
- </form>
- </th>
- <th>
- <form action="" method="post">
- IP: <input name="uf_ip" id="uf_ip" type="text">
- <input class="cute_button2" type="submit" value="Search">
- </form>
- </th>
- <th class="thuffer">
- <form action="" method="post">
- Account: <input name="uf_account" id="uf_account" type="text">
- <input class="cute_button2" type="submit" value="Search">
- </form>
- </th>
- </form>
- </table>
- <?php
- if (isset($_POST['uf_nick']) && strlen($_POST['uf_nick']))
- Message::Info("Listing users which match nick: \"" . $_POST['uf_nick'] . "\"");
-
- if (isset($_POST['uf_ip']) && strlen($_POST['uf_ip']))
- Message::Info("Listing users which match IP: \"" . $_POST['uf_ip'] . "\"");
-
- if (isset($_POST['uf_host']) && strlen($_POST['uf_host']))
- Message::Info("Listing users which match hostmask: \"" . $_POST['uf_host'] . "\"");
-
- if (isset($_POST['uf_account']) && strlen($_POST['uf_account']))
- Message::Info("Listing users which match account: \"" . $_POST['uf_account'] . "\"");
-
- ?>
- <table class='users_overview'>
- <th><input type="checkbox" label='selectall' onClick="toggle_user(this)" />Select all</th>
- <th>Nick</th>
- <th>UID</th>
- <th>Host / IP</th>
- <th>Account</th>
- <th>Usermodes<a href="https://www.unrealircd.org/docs/User_modes" target="_blank">ℹ️</a></th>
- <th>Oper</th>
- <th>Secure</th>
- <th>Connected to</th>
- <th>Reputation <a href="https://www.unrealircd.org/docs/Reputation_score" target="_blank">ℹ️</a></th>
-
- <form action="" method="post">
- <?php
- foreach(RPC_List::$user as $user)
- {
-
- /* Some basic filtering for NICK */
- if (isset($_POST['uf_nick']) && strlen($_POST['uf_nick']) &&
- strpos(strtolower($user->name), strtolower($_POST['uf_nick'])) !== 0 &&
- strpos(strtolower($user->name), strtolower($_POST['uf_nick'])) == false)
- continue;
-
- /* Some basic filtering for HOST */
- if (isset($_POST['uf_host']) && strlen($_POST['uf_host']) &&
- strpos(strtolower($user->hostname), strtolower($_POST['uf_host'])) !== 0 &&
- strpos(strtolower($user->hostname), strtolower($_POST['uf_host'])) == false)
- continue;
-
- /* Some basic filtering for IP */
- if (isset($_POST['uf_ip']) && strlen($_POST['uf_ip']) &&
- strpos(strtolower($user->ip), strtolower($_POST['uf_ip'])) !== 0 &&
- strpos(strtolower($user->ip), strtolower($_POST['uf_ip'])) == false)
- continue;
-
- /* Some basic filtering for ACCOUNT */
- if (isset($_POST['uf_account']) && strlen($_POST['uf_account']) &&
- strpos(strtolower($user->user->account), strtolower($_POST['uf_account'])) !== 0 &&
- strpos(strtolower($user->user->account), strtolower($_POST['uf_account'])) == false)
- continue;
-
- echo "<tr>";
- echo "<td><input type=\"checkbox\" value='" . base64_encode($user->id)."' name=\"userch[]\"></td>";
- $isBot = (strpos($user->user->modes, "B") !== false) ? ' <span class="label">Bot</span>' : "";
- echo "<td>".$user->name.$isBot.'</td>';
- echo "<td>".$user->id."</td>";
- echo "<td>".$user->hostname." (".$user->ip.")</td>";
- $account = (isset($user->user->account)) ? $user->user->account : '<span class="label noaccount">None</span>';
- echo "<td>".$account."</td>";
- $modes = (isset($user->user->modes)) ? "+" . $user->user->modes : "<none>";
- echo "<td>".$modes."</td>";
- $oper = (isset($user->user->operlogin)) ? $user->user->operlogin." <span class=\"label operclass-label\">".$user->user->operclass."</span>" : "";
- if (!strlen($oper))
- $oper = (strpos($user->user->modes, "S") !== false) ? '<span class="label secure-connection">Service</span>' : "";
- echo "<td>".$oper."</td>";
- $secure = (isset($user->tls)) ? "<span class=\"label secure-connection\">Secure</span>" : "<span class=\"label noaccount\">Insecure</span>";
- echo "<td>".$secure."</td>";
- echo "<td>".$user->user->servername."</td>";
- echo "<td>".$user->user->reputation."</td>";