]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - users.php
Code cleanup: spamfilter list: use $spamfilter_target_info from "Add entry" too.
[irc/unrealircd/unrealircd-webpanel.git] / users.php
index e33b6fca2ed5b4d562215584a611bb4113609ecc..ebb9e93b44cbd349ce551bc78ea77fa5c7091aeb 100644 (file)
--- a/users.php
+++ b/users.php
@@ -28,12 +28,14 @@ if (!empty($_POST)) {
                                                $duration .= $banlen_h;
                                }
                                $user = $rpc->user()->get($user);
-                               if (!$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 ($rpc->serverban()->add($user->id, $bantype, $duration, $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");
@@ -48,6 +50,7 @@ $users = $rpc->user()->getAll();
 ?>
 <h4>Users Overview</h4>
 
+Click on a username to view more information.
 
 <div id="Users">
        
@@ -66,7 +69,7 @@ $users = $rpc->user()->getAll();
 
        ?>
        <table class="table table-responsive caption-top table-striped">
-       <thead class="table-light">
+       <thead>
                <th scope="col"><h5>Filter:</h5></th>
                <form action="" method="post">
                <th scope="col" colspan="2">Nick <input name="uf_nick" type="text" class="form-control short-form-control">
@@ -74,17 +77,19 @@ $users = $rpc->user()->getAll();
                <th scope="col" colspan="2">IP <input name="uf_ip" type="text" class="form-control short-form-control"></th>
                <th scope="col" colspan="2">Account <input name="uf_account" type="text" class="form-control short-form-control"></th>
                <th scope="col"> <input class="btn btn-primary" type="submit" value="Search"></th></form>
-       </thead><thead class="table-primary">
-               <th scope="col"><input type="checkbox" label='selectall' onClick="toggle_user(this)" />Select all</th>
+       </thead></table>
+
+       <table class="table table-responsive caption-top table-striped">
+       <thead class="table-primary">
+               <th scope="col"><input type="checkbox" label='selectall' onClick="toggle_user(this)" /></th>
                <th scope="col">Nick</th>
-               <th scope="col">UID</th>
                <th scope="col">Host / IP</th>
-               <th scope="col">Account</th>
+               <th scope="col"><span data-toggle="tooltip" data-placement="bottom" title="The services account name, if the user identified to services." style="border-bottom: 1px dotted #000000">Account</span></th>
                <th scope="col">Usermodes <a href="https://www.unrealircd.org/docs/User_modes" target="_blank">ℹ️</a></th>
                <th scope="col">Oper</th>
-               <th scope="col">Secure</th>
+               <th scope="col"><span data-toggle="tooltip" data-placement="bottom" title="This shows [Secure] if the user is using SSL/TLS or is on localhost." style="border-bottom: 1px dotted #000000">Secure</span></th>
                <th scope="col">Connected to</th>
-               <th scope="col">Reputation <a href="https://www.unrealircd.org/docs/Reputation_score" target="_blank">ℹ️</a></th>
+               <th scope="col"><span data-toggle="tooltip" data-placement="bottom" title="The reputation score gets higher when someone with this IP address has been connected in the past weeks. A low reputation score (like <10) is an indication of a new IP." style="border-bottom: 1px dotted #000000">Reputation</span> <a href="https://www.unrealircd.org/docs/Reputation_score" target="_blank">ℹ️</a></th>
        </thead>
        
        <tbody>
@@ -94,6 +99,7 @@ $users = $rpc->user()->getAll();
                foreach($users 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 &&
@@ -121,8 +127,7 @@ $users = $rpc->user()->getAll();
                        echo "<tr>";
                        echo "<th scope=\"row\"><input type=\"checkbox\" value='" . base64_encode($user->id)."' name=\"userch[]\"></th>";
                        $isBot = (strpos($user->user->modes, "B") !== false) ? ' <span class="badge-pill badge-dark">Bot</span>' : "";
-                       echo "<td>".$user->name.$isBot.'</td>';
-                       echo "<td>".$user->id."</td>";
+                       echo "<td><a href=\"user-lookup.php?nick=".$user->id."\">$user->name$isBot</a></td>";
                        echo "<td>".$user->hostname." (".$user->ip.")</td>";
                        $account = (isset($user->user->account)) ? $user->user->account : '<span class="badge-pill badge-primary">None</span>';
                        echo "<td>".$account."</td>";
@@ -201,7 +206,7 @@ $users = $rpc->user()->getAll();
        <label for="ban_reason">Reason: </label>
        <input class="form-control short-form-control" type="text" name="ban_reason" id="ban_reason" value="No reason">
        <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">
-                       Apply
+                       Apply ban
        </button></td></table>
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
@@ -218,7 +223,7 @@ $users = $rpc->user()->getAll();
                </div>
                <div class="modal-footer">
                        <button id="CloseButton" type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
-                       <button type="submit" action="post" class="btn btn-danger">Ban Hammer</button>
+                       <button type="submit" action="post" class="btn btn-danger">Ban</button>
                        
                </div>
                </div>