- if ($list = $rpc->user()->getAll())
- echo json_encode($list);
- else
- echo json_encode(["error" => "No users found"]);
- die();
+ $isBot = (strpos($user->user->modes, "B") !== false) ? ' <span class="badge rounded-pill badge-dark">Bot</span>' : "";
+ $nick = htmlspecialchars($user->name).$isBot;
+
+ $country = isset($user->geoip->country_code) ? '<img src="https://flagcdn.com/48x36/'.htmlspecialchars(strtolower($user->geoip->country_code)).'.png" width="20" height="15"> '.htmlspecialchars($user->geoip->country_code) : "";
+
+ if ($user->hostname == $user->ip)
+ $hostip = $user->ip;
+ else if ($user->ip == null)
+ $hostip = $user->hostname;
+ else
+ $hostip = $user->hostname . " (".$user->ip.")";
+ $hostip = htmlspecialchars($hostip);
+
+ $account = (isset($user->user->account)) ? "<a href=\"".get_config("base_url")."users/?account=".$user->user->account."\">".htmlspecialchars($user->user->account)."</a>" : '<span class="badge rounded-pill badge-primary">None</span>';
+ $oper = (isset($user->user->operlogin)) ? $user->user->operlogin." <span class=\"badge rounded-pill badge-secondary\">".$user->user->operclass."</span>" : "";
+ if (!strlen($oper))
+ $oper = (strpos($user->user->modes, "S") !== false) ? '<span class="badge rounded-pill badge-warning">Services Bot</span>' : "";
+ $servername = $user->user->servername;
+ $reputation = $user->user->reputation;
+
+ $nick = "<a href=\"details.php?nick=".$user->id."\">$nick</a>";
+
+ $out[] = [
+ "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,
+ "Account" => $account,
+ "Oper" => $oper,
+ "Connected to" => $servername,
+ "Reputation" => $reputation,
+ ];