]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - users.php
Update channels.php: probably not really needed but ok :D
[irc/unrealircd/unrealircd-webpanel.git] / users.php
index ac38ddcfa2431abced14964019d39e754efa37b2..3118e5329123c7278991c2786735ba1f634cd2e0 100644 (file)
--- a/users.php
+++ b/users.php
@@ -6,7 +6,7 @@ require_once "header.php";
 if (!empty($_POST))
 {
        do_log($_POST);
-
+       $bantype = $_POST['bantype'];
        if (isset($_POST['userch']))
        {
                foreach ($_POST["userch"] as $user)
@@ -36,8 +36,8 @@ if (!empty($_POST))
                                        $duration .= $banlen_h;
                        }
 
-                       $nick = $rpc->user()->get($user);
-                       if (!$nick)
+                       $user = $rpc->user()->get($user);
+                       if (!user)
                        {
                                Message::Fail("Could not find that user. Maybe they disconnected after you clicked this?");
                                return;
@@ -46,10 +46,7 @@ if (!empty($_POST))
                        $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");
-                       }
+                               Message::Success($user->name . " (*@".$user->hostname.") has been $bantype" . "d $msg_msg: $reason");
                }
        }
 }
@@ -58,11 +55,11 @@ if (!empty($_POST))
 $users = $rpc->user()->getAll();
 ?>
 
-       <div id="Users" data-tab-content>
+<div id="Users">
        <table class='users_filter'>
        <th class="thuf">Filter by: </th>
        <th>
-               <form action="" method="post">
+               <form action="users.php" method="post">
                        Nick: <input name="uf_nick" id="uf_nick" type="text">
                        <input class="cute_button2" type="submit" value="Search">
                </form>
@@ -107,13 +104,13 @@ $users = $rpc->user()->getAll();
        <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>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">
+       <form action="users.php" method="post">
        <?php
                foreach($users as $user)
                {
@@ -219,6 +216,7 @@ $users = $rpc->user()->getAll();
        <input class="cute_button" type="submit" value="Apply">
        </form>
        
-       </div></div>
+       </div
+</div>
 
 <?php require_once 'footer.php'; ?>