-
- /* Some basic filtering for NICK */
- if (isset($_POST['uf_nick']) && strlen($_POST['uf_nick']) &&
- strpos(strtolower($user->name), strtolower($_POST['uf_nick'])) !== 0 &&
- strpos(strtolower($user->name), strtolower($_POST['uf_nick'])) == false)
- continue;
-
- /* Some basic filtering for COUNTRY */
- if (isset($_POST['uf_country']) && strlen($_POST['uf_country']) &&
- @strtolower($user->geoip->country_code) !== strtolower($_POST['uf_country']))
- continue;
-
- /* Some basic filtering for HOST */
- if (isset($_POST['uf_host']) && strlen($_POST['uf_host']) &&
- strpos(strtolower($user->hostname), strtolower($_POST['uf_host'])) !== 0 &&
- strpos(strtolower($user->hostname), strtolower($_POST['uf_host'])) == false)
- continue;
-
- /* Some basic filtering for IP */
- if (isset($_POST['uf_ip']) && strlen($_POST['uf_ip']) &&
- strpos(strtolower($user->ip), strtolower($_POST['uf_ip'])) !== 0 &&
- strpos(strtolower($user->ip), strtolower($_POST['uf_ip'])) == false)
- continue;
-
- /* Some basic filtering for ACCOUNT */
- if (isset($_POST['uf_account']) && strlen($_POST['uf_account']) &&
- strtolower($user->user->account) !== strtolower($_POST['uf_account']))
- continue;
-
- /* Some basic filtering for SERVER */
- if (isset($_POST['uf_server']) && strlen($_POST['uf_server']) &&
- strpos(strtolower($user->user->servername), strtolower($_POST['uf_server'])) !== 0 &&
- strpos(strtolower($user->user->servername), strtolower($_POST['uf_server'])) == false)
- continue;
-
- /* Some basic filtering for OPER */
- if (isset($_POST['operonly']) &&
- (strpos($user->user->modes, "o") == false || strpos($user->user->modes,"S") !== false))
- continue;
-
- /* Some basic filtering for SERVICES */
- if (isset($_POST['servicesonly']) &&
- (strpos($user->user->modes,"S") == false))
- continue;
-
- echo "\n<tr id=\"$user->id\" value=\"$user->name\" class=\"userselector\">";
- echo "<th scope=\"row\"><input type=\"checkbox\" value='" . base64_encode($user->id)."' name=\"userch[]\"></th>";
- $isBot = (strpos($user->user->modes, "B") !== false) ? ' <span class="badge rounded-pill badge-dark">Bot</span>' : "";
- echo "<td><a href=\"details.php?nick=".$user->id."\">$user->name$isBot</a></td>";
- echo "<td class=\"countrycol\">".(isset($user->geoip->country_code) ? '<img src="https://flagcdn.com/48x36/'.htmlspecialchars(strtolower($user->geoip->country_code)).'.png" width="20" height="15"> '.$user->geoip->country_code : "")."</td>";
- echo "<td class=\"hostname\">".htmlspecialchars($user->hostname)." (".($user->hostname == $user->ip ? 'the same' : htmlspecialchars($user->ip ?? "None")).")</td>";
- $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>';
- echo "<td class=\"accountcol\">".$account."</td>";
- $modes = (isset($user->user->modes)) ? "+" . $user->user->modes : "<none>";
- echo "<td class=\"umodescol\">".$modes."</td>";
- $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>' : "";
- echo "<td class=\"opercol\">".$oper."</td>";
-
- $secure = (isset($user->tls) || $user->hostname !== "localhost") ? "<span class=\"badge rounded-pill badge-success\">Secure</span>" : "<span class=\"badge rounded-pill badge-danger\">Insecure</span>";
- if (strpos($user->user->modes, "S") !== false)
- $secure = "";
- echo "<td class=\"securecol\">".$secure."</td>";
- echo "<td class=\"uplinkcol\"><a href=\"".get_config("base_url")."servers/details.php?server=".substr($user->id, 0, 3)."\">".$user->user->servername."</a></td>";
- echo "<td class=\"reputationcol\">".$user->user->reputation."</td>";
- echo "</tr>";
- $currentNumberUsers++;
- if (isset($user->user->account))
- $currentNumberUsersIdentified++;
- if (isset($user->geoip->country_code))
- array_push($registrationOfaAllFlags, $user->geoip->country_code);
- }
- $registrationOfaAllFlags = array_count_values($registrationOfaAllFlags);
- ?>
- </tbody></table>
- <div id="currentNumberUsers"><?=$currentNumberUsers?> connected users including <?=$currentNumberUsersIdentified?> identified and <?=($currentNumberUsers-$currentNumberUsersIdentified)?> not identified.</div>