- /* 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>";
- 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>".htmlspecialchars($user->hostname)." (".htmlspecialchars($user->ip ?? "None").")</td>";
- $account = (isset($user->user->account)) ? "<a href=\"".BASE_URL."users/?account=".$user->user->account."\">".htmlspecialchars($user->user->account)."</a>" : '<span class="badge rounded-pill badge-primary">None</span>';
- echo "<td>".$account."</td>";
- $modes = (isset($user->user->modes)) ? "+" . $user->user->modes : "<none>";
- echo "<td>".$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>".$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>".$secure."</td>";
- echo "<td><a href=\"".BASE_URL."servers/details.php?server=".substr($user->id, 0, 3)."\">".$user->user->servername."</a></td>";
- echo "<td>".$user->user->reputation."</td>";
- echo "</tr>";
- }
- ?>
- </tbody></table>