X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/89ba7ba42b9f5eeca0e55e62ab2f5cf0494e0be0..d5ffb4bb26cc3910c5e4da8de0f6ed8e64a273fa:/api/users.php
diff --git a/api/users.php b/api/users.php
index fa12746..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,7 +26,6 @@ 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' : "";
@@ -36,12 +35,11 @@ foreach($users as $user)
$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,
"Connected to" => $servername,
"Reputation" => $reputation,