X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/5485abb5d902c8c6d6d6445b1868d4c8178740b3..67bff06aa6fd4d7d3a9aefc2919307326fa6d755:/api/users.php diff --git a/api/users.php b/api/users.php index df97e09..c2e6234 100644 --- a/api/users.php +++ b/api/users.php @@ -4,14 +4,15 @@ 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(); $out = []; foreach($users as $user) { - // base64_encode($user->id) - $isBot = (strpos($user->user->modes, "B") !== false) ? ' Bot' : ""; $nick = htmlspecialchars($user->name).$isBot; @@ -26,27 +27,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" => "", + "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, ];