X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/8e3bf75ee7e9d5d38e8adc76acd94f28f3008b74..d5ffb4bb26cc3910c5e4da8de0f6ed8e64a273fa:/api/users.php
diff --git a/api/users.php b/api/users.php
index 659df5e..a5b9bb1 100644
--- a/api/users.php
+++ b/api/users.php
@@ -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) ? ' Bot' : "";
$nick = htmlspecialchars($user->name).$isBot;
@@ -26,27 +26,21 @@ foreach($users as $user)
$hostip = htmlspecialchars($hostip);
$account = (isset($user->user->account)) ? "user->account."\">".htmlspecialchars($user->user->account)."" : 'None';
- $modes = (isset($user->user->modes)) ? "+" . $user->user->modes : "";
$oper = (isset($user->user->operlogin)) ? $user->user->operlogin." ".$user->user->operclass."" : "";
if (!strlen($oper))
$oper = (strpos($user->user->modes, "S") !== false) ? 'Services Bot' : "";
- $secure = (isset($user->tls) || $user->hostname !== "localhost") ? "Secure" : "Insecure";
- if (strpos($user->user->modes, "S") !== false)
- $secure = "";
$servername = $user->user->servername;
$reputation = $user->user->reputation;
$nick = "id."\">$nick";
$out[] = [
- "Select" => "", /* yeah ridiculous to have here in this file and the feed ;) */
+ "Select" => "", /* yeah ridiculous to have here in this file and the feed ;) */
"Nick" => $nick,
"Country" => $country,
"Host/IP" => $hostip,
"Account" => $account,
- "Usermodes" => $modes,
"Oper" => $oper,
- "Secure" => $secure,
"Connected to" => $servername,
"Reputation" => $reputation,
];