function generate_html_whois($user)
{
+ global $rpc;
?>
- <table class="table table-responsive caption-top table-hover">
+ <table class="table-sm table-responsive caption-top table-hover">
<tbody>
<tr>
<th>Nick</th>
- <td colspan="2"><code><?php echo $user->name; ?></code></td>
+ <td colspan="2"><code><?php echo htmlspecialchars($user->name); ?></code></td>
</tr><tr>
- <th>UID</th>
- <td colspan="2"><code><?php echo $user->id; ?></code></td>
+ <th>User ID (UID)</th>
+ <td colspan="2"><code><?php echo htmlspecialchars($user->id); ?></code></td>
</tr><tr>
<th>Real Host</th>
- <td colspan="2"><code><?php echo $user->hostname; ?></code></td>
+ <td colspan="2"><code><?php echo htmlspecialchars($user->hostname); ?></code></td>
</tr><tr>
<th>IP</th>
- <td colspan="2"><code><?php echo $user->ip." </code> ";
+ <td colspan="2"><code><?php echo htmlspecialchars($user->ip); ?></code>
+ <?php
if ($cc = (isset($user->geoip->country_code)) ? strtolower($user->geoip->country_code) : "")
{
- ?> <img src="https://flagcdn.com/48x36/<?php echo $cc; ?>.png"
+ ?> <img src="https://flagcdn.com/48x36/<?php echo htmlspecialchars($cc); ?>.png"
width="20"
height="15">
<?php } ?>
+ <a href="<?php echo htmlspecialchars(get_config("base_url")."tools/ip-whois.php?ip=$user->ip"); ?>"><button class="btn-sm btn-primary">WHOIS IP</button></a>
</td>
</tr><tr>
<th>Ident</th>
- <td colspan="2"><code><?php echo $user->user->username; ?></code></td>
+ <td colspan="2"><code><?php echo htmlspecialchars($user->user->username); ?></code></td>
</tr><tr>
<th>GECOS / Real Name</th>
- <td colspan="2"><code><?php echo $user->user->realname; ?></code></td>
+ <td colspan="2"><code><?php echo htmlspecialchars($user->user->realname); ?></code></td>
</tr><tr>
<th>Virtual Host</th>
- <td colspan="2"><code><?php echo (isset($user->user->vhost)) ? $user->user->vhost : ""; ?></code></td>
+ <td colspan="2"><code><?php echo (isset($user->user->vhost)) ? htmlspecialchars($user->user->vhost) : ""; ?></code></td>
</tr><tr>
<th>Connected to</th>
- <td colspan="2"><code><?php echo $user->user->servername; ?></code></td>
+ <?php $serverlkup = $rpc->server()->get($user->user->servername); ?>
+
+ <td colspan="2"><a href="<?php echo get_config("base_url")."servers/details.php?server=$serverlkup->id"; ?>"><code><?php echo htmlspecialchars($user->user->servername); ?></code></td>
</tr>
<tr>
<th>Logged in as</th>
- <td colspan="2"><code><?php echo (isset($user->user->account)) ? $user->user->account : ""; ?></code></td>
+ <td colspan="2"><code><?php echo (isset($user->user->account)) ? "<a href=\"".get_config("base_url")."users/?account=".htmlspecialchars($user->user->account)."\">".htmlspecialchars($user->user->account)."</a>" : ""; ?></code></td>
</tr>
{
?>
- <table class="table table-responsive caption-top table-hover">
+ <table class="table-sm table-responsive caption-top table-hover">
<tbody>
<?php
for ($i=0; ($mode = (isset($user->user->modes[$i])) ? $user->user->modes[$i] : NULL); $i++)
<tr>
<th>Oper</th>
<td>
- <table class="table table-responsive caption-top table-hover">
+ <table class="table-sm table-responsive caption-top table-hover">
<tr>
<td>Oper Login</td>
- <td><code><?php echo $user->user->operlogin; ?></code></td>
+ <td><code><?php
+ $operlogin = (isset($user->user->operlogin)) ? $user->user->operlogin : "";
+ echo htmlspecialchars($operlogin);
+ ?></code></td>
</tr>
<tr>
<td>Oper Class</td>
- <td><?php echo (isset($user->user->operclass)) ? "<span class=\"badge-pill badge-info\">".$user->user->operclass."</span>" : "<span class=\"badge-pill badge-info\">None</span>"; ?></td>
+ <td><?php echo (isset($user->user->operclass)) ? "<span class=\"rounded-pill badge badge-info\">".htmlspecialchars($user->user->operclass)."</span>" : "<span class=\"rounded-pill badge badge-info\">None</span>"; ?></td>
</tr>
</table>
</td>
<tr>
<th>Secure</th>
<td>
- <table class="table table-responsive caption-top table-hover">
+ <table class="table-sm table-responsive caption-top table-hover">
<tr>
<td>Cipher</td>
- <td><code><?php echo $user->tls->cipher; ?></code></td>
+ <td><code><?php
+ $cipher = (isset($user->tls->cipher)) ? $user->tls->cipher : "";
+ echo htmlspecialchars($cipher);
+ ?></code></td>
</tr>
<tr>
<td>Cert Fingerprint</td>
- <td><?php echo (isset($user->tls->certfp)) ? "".$user->tls->certfp."" : "<span class=\"badge-pill badge-info\">None</span>"; ?></td>
+ <td><?php echo (isset($user->tls->certfp)) ? "<code>".htmlspecialchars($user->tls->certfp)."</code>" : "<span class=\"rounded-pill badge badge-info\">None</span>"; ?></td>
</tr>
</table>
</td>
</table>
<?php
-}
\ No newline at end of file
+}
+
+
+function generate_html_userchannels($user)
+{
+ ?>
+
+ <table class="table-sm table-responsive caption-top table-hover table-striped">
+ <thead class="table-info">
+ <th>
+ Channel
+ </th>
+ <th >
+ Status
+ </th>
+ </thead>
+ <tbody>
+ <?php
+ foreach($user->user->channels as $chan)
+ {
+ ?>
+ <tr>
+ <td><?php echo "<a href=\"".get_config("base_url")."channels/details.php?chan=".urlencode($chan->name)."\">$chan->name</a>"; ?></td>
+ <td>
+
+ <?php
+ for ($i = 0; isset($chan->level[$i]); $i++)
+ {
+ ?><div class="text-nowrap row mb-1"><?php
+ if ($chan->level[$i] == "v")
+ {
+ ?><span class="rounded-pill badge badge-info" value="Voice">Voice</span><?php
+ }
+ if ($chan->level[$i] == "h")
+ {
+ ?><span class="rounded-pill badge badge-info">Half-Op</span><?php
+ }
+ if ($chan->level[$i] == "o")
+ {
+ ?><h6><span class="rounded-pill badge badge-info">Operator</span></h6><?php
+ }
+ if ($chan->level[$i] == "a")
+ {
+ ?><span class="rounded-pill badge badge-info">Admin</span><?php
+ }
+ if ($chan->level[$i] == "q")
+ {
+ ?><span class="rounded-pill badge badge-info">Owner</span><?php
+ }
+ if ($chan->level[$i] == "Y")
+ {
+ ?><span class="rounded-pill badge badge-info">OJOIN</span><?php
+ }
+ ?></div><?php
+ }
+ ?>
+ </td>
+ </tr>
+ <?php
+ }
+ ?>
+ </tbody>
+ </table>
+
+ <?php
+}