4 function generate_html_servermodes($server)
7 <table
class="table-sm table-responsive caption-top table-hover">
15 foreach ($server->server
->features
->chanmodes
as $set)
19 for ($i = 0; isset($set[$i]); $i++
)
22 if (isset(IRCList
::$cmodes[$mode])) {
25 <th
><?php
echo IRCList
::$cmodes[$mode]['name']; ?></th
>
26 <th
><code
><?php
echo $mode; ?></code
></th
>
27 <td
><?php
echo IRCList
::$cmodes[$mode]['description']; ?></td
>
28 <td
><div
class="badge rounded-pill badge-dark"><?php
echo IRCList
::$cmodes[$mode]['requires']; ?></div
></td
>
35 <td
>Mode
"<?php echo $mode; ?>"</td
>
46 function sinfo_conv_version_string($server) : string
48 $string = (isset($server->server
->features
->software
)) ? $server->server
->features
->software
: "";
52 $display_string = $string;
54 if (strlen($string) && strpos($string,"-"))
56 $tok = split($string, "-");
57 if (($tok[0] == "UnrealIRCd") && isset($tok[2]))
62 $badge = "git:".$tok[3];
65 $tooltip = "Installed from GitHub";
66 $display_string = $tok[0]."-".$tok[1]."-".$tok[2];
67 } else if (substr($tok[2],0,2) == "rc")
69 $tooltip = "Release Candidate/Beta Version";
71 } else if (strlen($tok[2]) == 9)
73 /* Guess that this is a commit id :D */
74 $badge = "git:".$tok[2];
75 $tooltip = "Installed from GitHub";
76 $display_string = $tok[0]."-".$tok[1];
78 $tooltip = htmlspecialchars($tooltip);
79 $display_string = htmlspecialchars($display_string);
81 $return = "<span data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"$tooltip\"><code>" . $display_string . "</code> <div class=\"badge rounded-pill badge-dark\">$badge</div></a>";
83 if (isset($server->server
->ulined
) && $server->server
->ulined
)
84 $return .= "<div class=\"badge rounded-pill badge-warning\">Services</div>";
88 function generate_html_serverinfo($server)
92 <table
class="table-sm table-responsive caption-top table-hover">
96 <td colspan
="2"><code
><?php
echo htmlspecialchars($server->name
); ?></code
></td
>
98 <th
>Server
ID (SID
)</th
>
99 <td colspan
="2"><code
><?php
echo htmlspecialchars($server->id
); ?></code
></td
>
102 <td colspan
="2"><code
><?php
echo htmlspecialchars($server->server
->info
); ?></code
></td
>
105 <?php
$serverlkup = (isset($server->server
->uplink
)) ? $rpc->server()->get($server->server
->uplink
) : "<span class=\"badge rounded-pill badge-info\">None</span>"; ?>
106 <td colspan
="2"><code
><?php
echo "<a href=\"".get_config("base_url")."servers/details.php?server=".htmlspecialchars($serverlkup->id
)."\">".htmlspecialchars($server->server
->uplink
)."</a>"; ?></code
></td
>
109 <td colspan
="2"><code
><?php
echo htmlspecialchars($server->server
->num_users
); ?></code
></td
>
112 <td colspan
="2"><?php
echo sinfo_conv_version_string($server); ?></td
>
120 function generate_html_usermodes($server)
122 $modes = $server->server
->features
->usermodes
;
123 echo "<table class=\"table-sm table-responsive caption-top table-hover\">";
124 for ($i=0; ($mode = (isset($modes[$i])) ? $modes[$i] : NULL); $i++
)
133 User is an IRC Operator
.
138 elseif ($mode == "S")
144 User is a Services Bot
.
149 elseif ($mode == "d")
154 <td
>User is ignoring channel messages
.</td
>
158 elseif ($mode == "i")
163 <td
>Not shown in
/WHO searches
.</td
>
167 elseif ($mode == "p")
171 <th
>Private channels
</th
>
172 <td
>Channels hidden in
/WHOIS outputs
.</td
>
176 elseif ($mode == "r")
180 <th
>Registered Nick
</th
>
181 <td
>User is using a registered nick
.</td
>
185 elseif ($mode == "s")
189 <th
>Server Notices
</th
>
190 <td
>User is receiving server notices
.</td
>
194 elseif ($mode == "t")
198 <th
>Virtual Host
</th
>
199 <td
>Using a custom hostmask
.</td
>
203 elseif ($mode == "w")
208 <td
>Listening to
<code
>/WALLOPS
</code
> notices from IRC Operators
.</td
>
212 elseif ($mode == "x")
217 <td
>Using a
hostmask (hiding their IP from non
-IRCops
).</td
>
221 elseif ($mode == "z")
227 User is using a secure connection
.
232 elseif ($mode == "B")
238 User is marked
as a Bot
.
243 elseif ($mode == "D")
249 User is rejecting incoming
private messages
.
254 elseif ($mode == "G")
260 User is filtering Bad Words
.
265 elseif ($mode == "H")
271 User is hiding their IRCop status
.
276 elseif ($mode == "I")
282 User is hiding their idle time
.
287 elseif ($mode == "R")
291 <th
>RegOnly Messages
</th
>
293 User is only accepting
private messages from registered users
.
298 elseif ($mode == "T")
304 Denying CTCP requests
.
309 elseif ($mode == "W")
315 User is receiving notifications when someone does a
<code
>/WHOIS
</code
> on them
.
320 elseif ($mode == "Z")
324 <th
>Deny Insecure Messages
</th
>
326 User is only accepting messages from users using a secure connection
.
335 function generate_html_extserverinfo($server)
338 <table
class="table-sm table-responsive caption-top table-hover">
342 <td colspan
="2"><code
><?php
echo htmlspecialchars($server->ip
); ?></code
></td
>
345 <td colspan
="2"><code
><?php
echo htmlspecialchars($server->server
->boot_time
); ?></code
></td
>
348 <td colspan
="2"><?php
echo ($server->server
->ulined
) ? "<span class=\"badge rounded-pill badge-success\">Yes</span>" : "<span class=\"badge rounded-pill badge-danger\">No</span>"; ?></td
>
351 <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
>
353 <?php
if (property_exists($server, "tls")) { ?>
359 <th
>Cert Fingerprint
</th
>
360 <td
><?php
echo "<span class=\"badge rounded-pill badge-info\">".htmlspecialchars($server->tls
->certfp
)."</span>"; ?></td
>
363 <td
><?php
echo "<span class=\"badge rounded-pill badge-info\">".htmlspecialchars($server->tls
->cipher
)."</span>"; ?></td
>
374 function generate_html_modlist($srv)
377 $modules = $rpc->server()->module_list($srv->id
);
378 if (!$modules || !$modules->list)
384 <table
class="table table-sm table-responsive table-hover">
385 <thead
class="table-info">
394 foreach ($modules->list as $module) {
396 echo "<td><code>".htmlspecialchars($module->name
)."</code></td>";
397 $desc = $module->description
;
398 $short_desc = substr($desc, 0, 70); // truncate to 80 chars
399 if (strlen($desc) > strlen($short_desc))
400 $short_desc .= "...";
401 echo "<td><span href='#' data-toggle='tooltip' title=\"".htmlspecialchars($desc)."\">".htmlspecialchars($short_desc)."</span></td>";
402 $source = (!$module->third_party
) ? "<div class=\"badge rounded-pill badge-success\">Official</div>" : "<div class=\"badge rounded-pill badge-info\">Third-Party</div>";
403 echo "<td>$source</td>";
404 echo "<td>".htmlspecialchars($module->author
)."</td>";
405 echo "<td>".htmlspecialchars($module->version
)."</td>";
416 function get_unreal_latest_version()
418 $url = "https://www.unrealircd.org/downloads/list.json";
419 $contents = file_get_contents($url);
422 Message
::Fail("Could not get latest version of UnrealIRCd. Please check again later.");
425 $arr = json_decode($contents, true);
427 foreach($arr as $key => $value)
434 Message
::Fail("Could not get latest version of UnrealIRCd. Please check again later.");
437 return $arr[$biggest]['Stable']['version'];