4 function generate_html_servermodes($server)
7 <table
class="table-sm table-responsive caption-top table-hover">
15 if (isset($server->server
->features
->chanmodes
))
17 foreach ($server->server
->features
->chanmodes
as $set)
21 for ($i = 0; isset($set[$i]); $i++
)
24 if (isset(IRCList
::$cmodes[$mode])) {
27 <th
><?php
echo IRCList
::$cmodes[$mode]['name']; ?></th
>
28 <th
><code
><?php
echo $mode; ?></code
></th
>
29 <td
><?php
echo IRCList
::$cmodes[$mode]['description']; ?></td
>
30 <td
><div
class="badge rounded-pill badge-dark"><?php
echo IRCList
::$cmodes[$mode]['requires']; ?></div
></td
>
37 <td
>Mode
"<?php echo $mode; ?>"</td
>
48 function sinfo_conv_version_string($server) : string
50 $string = (isset($server->server
->features
->software
)) ? $server->server
->features
->software
: "";
54 $display_string = $string;
56 if (strlen($string) && strpos($string,"-"))
58 $tok = split($string, "-");
59 if (($tok[0] == "UnrealIRCd") && isset($tok[2]))
64 $badge = "git:".$tok[3];
67 $tooltip = "Installed from GitHub";
68 $display_string = $tok[0]."-".$tok[1]."-".$tok[2];
69 } else if (substr($tok[2],0,2) == "rc")
71 $tooltip = "Release Candidate/Beta Version";
73 } else if (strlen($tok[2]) == 9)
75 /* Guess that this is a commit id :D */
76 $badge = "git:".$tok[2];
77 $tooltip = "Installed from GitHub";
78 $display_string = $tok[0]."-".$tok[1];
80 $tooltip = htmlspecialchars($tooltip);
81 $display_string = htmlspecialchars($display_string);
83 $return = "<span data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"$tooltip\"><code>" . $display_string . "</code> <div class=\"badge rounded-pill badge-dark\">$badge</div></a>";
85 if (isset($server->server
->ulined
) && $server->server
->ulined
)
86 $return .= "<div class=\"badge rounded-pill badge-warning\">Services</div>";
90 function generate_html_serverinfo($server)
94 <table
class="table-sm table-responsive caption-top table-hover">
98 <td colspan
="2"><code
><?php
echo htmlspecialchars($server->name
); ?></code
></td
>
100 <th
>Server
ID (SID
)</th
>
101 <td colspan
="2"><code
><?php
echo htmlspecialchars($server->id
); ?></code
></td
>
104 <td colspan
="2"><code
><?php
echo htmlspecialchars($server->server
->info
); ?></code
></td
>
107 <?php
$serverlkup = (isset($server->server
->uplink
)) ? $rpc->server()->get($server->server
->uplink
) : NULL; ?>
108 <td colspan
="2"><code
><?php
echo ($serverlkup) ? "<a href=\"".get_config("base_url")."servers/details.php?server=".htmlspecialchars($serverlkup->id
)."\">".htmlspecialchars($server->server
->uplink
)."</a>" : "No uplink"; ?></code
></td
>
111 <td colspan
="2"><code
><?php
echo htmlspecialchars($server->server
->num_users
); ?></code
></td
>
114 <td colspan
="2"><?php
echo sinfo_conv_version_string($server); ?></td
>
122 function generate_html_usermodes($server)
124 $modes = $server->server
->features
->usermodes
?? NULL;
125 echo "<table class=\"table-sm table-responsive caption-top table-hover\">";
127 echo "<tr><td>There are no usermodes for this server</td></tr>";
129 for ($i=0; ($mode = (isset($modes[$i])) ? $modes[$i] : NULL); $i++
)
138 User is an IRC Operator
.
143 elseif ($mode == "S")
149 User is a Services Bot
.
154 elseif ($mode == "d")
159 <td
>User is ignoring channel messages
.</td
>
163 elseif ($mode == "i")
168 <td
>Not shown in
/WHO searches
.</td
>
172 elseif ($mode == "p")
176 <th
>Private channels
</th
>
177 <td
>Channels hidden in
/WHOIS outputs
.</td
>
181 elseif ($mode == "r")
185 <th
>Registered Nick
</th
>
186 <td
>User is using a registered nick
.</td
>
190 elseif ($mode == "s")
194 <th
>Server Notices
</th
>
195 <td
>User is receiving server notices
.</td
>
199 elseif ($mode == "t")
203 <th
>Virtual Host
</th
>
204 <td
>Using a custom hostmask
.</td
>
208 elseif ($mode == "w")
213 <td
>Listening to
<code
>/WALLOPS
</code
> notices from IRC Operators
.</td
>
217 elseif ($mode == "x")
222 <td
>Using a
hostmask (hiding their IP from non
-IRCops
).</td
>
226 elseif ($mode == "z")
232 User is using a secure connection
.
237 elseif ($mode == "B")
243 User is marked
as a Bot
.
248 elseif ($mode == "D")
254 User is rejecting incoming
private messages
.
259 elseif ($mode == "G")
265 User is filtering Bad Words
.
270 elseif ($mode == "H")
276 User is hiding their IRCop status
.
281 elseif ($mode == "I")
287 User is hiding their idle time
.
292 elseif ($mode == "R")
296 <th
>RegOnly Messages
</th
>
298 User is only accepting
private messages from registered users
.
303 elseif ($mode == "T")
309 Denying CTCP requests
.
314 elseif ($mode == "W")
320 User is receiving notifications when someone does a
<code
>/WHOIS
</code
> on them
.
325 elseif ($mode == "Z")
329 <th
>Deny Insecure Messages
</th
>
331 User is only accepting messages from users using a secure connection
.
341 function generate_html_extserverinfo($server)
344 <table
class="table-sm table-responsive caption-top table-hover">
348 <td colspan
="2"><code
><?php
echo (($server->ip
) ? htmlspecialchars($server->ip
) : "Unable to detect IP"); ?></code
></td
>
351 <td colspan
="2"><code
><?php
echo (($server->server
->boot_time
) ? htmlspecialchars($server->server
->boot_time
) : "Not available"); ?></code
></td
>
354 <td colspan
="2"><?php
echo (isset($server->server
->ulined
) && $server->server
->ulined
) ? "<span class=\"badge rounded-pill badge-success\">Yes</span>" : "<span class=\"badge rounded-pill badge-danger\">No</span>"; ?></td
>
357 <td colspan
="2"><a href
="https://www.unrealircd.org/docs/Server_protocol:Protocol_version"><code
><?php
echo htmlspecialchars($server->server
->features
->protocol
); ?></code
></a
></td
>
359 <?php
if (property_exists($server, "tls")) { ?>
365 <th
>Cert Fingerprint
</th
>
366 <td
><?php
echo "<span class=\"badge rounded-pill badge-info\">".htmlspecialchars($server->tls
->certfp
)."</span>"; ?></td
>
369 <td
><?php
echo "<span class=\"badge rounded-pill badge-info\">".htmlspecialchars($server->tls
->cipher
)."</span>"; ?></td
>
380 function generate_html_modlist($srv)
383 $modules = $rpc->server()->module_list($srv->id
);
384 if (!$modules || !$modules->list)
390 <table
class="table table-sm table-responsive table-hover">
391 <thead
class="table-info">
400 foreach ($modules->list as $module) {
402 echo "<td><code>".htmlspecialchars($module->name
)."</code></td>";
403 $desc = $module->description
;
404 $short_desc = substr($desc, 0, 70); // truncate to 80 chars
405 if (strlen($desc) > strlen($short_desc))
406 $short_desc .= "...";
407 echo "<td><span href='#' data-toggle='tooltip' title=\"".htmlspecialchars($desc)."\">".htmlspecialchars($short_desc)."</span></td>";
408 $source = (!$module->third_party
) ? "<div class=\"badge rounded-pill badge-success\">Official</div>" : "<div class=\"badge rounded-pill badge-info\">Third-Party</div>";
409 echo "<td>$source</td>";
410 echo "<td>".htmlspecialchars($module->author
)."</td>";
411 echo "<td>".htmlspecialchars($module->version
)."</td>";
422 function get_unreal_latest_version()
424 $url = "https://www.unrealircd.org/downloads/list.json";
425 $contents = file_get_contents($url);
428 Message
::Fail("Could not get latest version of UnrealIRCd. Please check again later.");
431 $arr = json_decode($contents, true);
433 foreach($arr as $key => $value)
440 Message
::Fail("Could not get latest version of UnrealIRCd. Please check again later.");
443 return $arr[$biggest]['Stable']['version'];