]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - api/users.php
Add search bar to navbar
[irc/unrealircd/unrealircd-webpanel.git] / api / users.php
index 109386200a68e1a0320ca50573c6056c36276680..a5b9bb12ffc09cd5600bf422a866bcbf048cc8eb 100644 (file)
@@ -2,7 +2,9 @@
 
 define('NO_EVENT_STREAM_HEADER',1);
 require_once('common_api.php');
-header("Content-type: application/json; charset=utf-8");
+
+if (!$rpc)
+       die(json_encode([]));
 
 /* Get the user list */
 $users = $rpc->user()->getAll();
@@ -10,8 +12,6 @@ $users = $rpc->user()->getAll();
 $out = [];
 foreach($users as $user)
 {
-       // base64_encode($user->id)
-
        $isBot = (strpos($user->user->modes, "B") !== false) ? ' <span class="badge rounded-pill badge-dark">Bot</span>' : "";
        $nick = htmlspecialchars($user->name).$isBot;
 
@@ -35,7 +35,7 @@ foreach($users as $user)
        $nick = "<a href=\"details.php?nick=".$user->id."\">$nick</a>";
 
        $out[] = [
-               "Select" => "<input type=\"checkbox\" label='selectall' onClick=\"toggle_user(this)\" />", /* yeah ridiculous to have here in this file and the feed ;) */
+               "Select" => "<input type=\"checkbox\" value='" . base64_encode($user->id)."' name=\"userch[]\">", /* yeah ridiculous to have here in this file and the feed ;) */
                "Nick" => $nick,
                "Country" => $country,
                "Host/IP" => $hostip,