v 1.3.4 - Improvements for banlist
This commit is contained in:
parent
cc9b755087
commit
44eb73c379
23
bans.php
23
bans.php
|
@ -64,16 +64,24 @@ function getBanlist() {
|
||||||
try {
|
try {
|
||||||
$tsAdmin = TeamSpeak3::factory(getTeamspeakURI() . "#no_query_clients");
|
$tsAdmin = TeamSpeak3::factory(getTeamspeakURI() . "#no_query_clients");
|
||||||
|
|
||||||
$bany = $tsAdmin->banList();
|
$bans = $tsAdmin->banList();
|
||||||
|
|
||||||
$output = "";
|
$output = "";
|
||||||
|
|
||||||
foreach ($bany as $ban) {
|
foreach ($bans as $ban) {
|
||||||
|
|
||||||
|
$user = null;
|
||||||
|
|
||||||
|
if (!empty($ban['ip']))
|
||||||
|
$user = censorIP($ban['ip']->toString());
|
||||||
|
|
||||||
|
if (!empty($ban['lastnickname']))
|
||||||
|
$user = $ban['lastnickname']->toString();
|
||||||
|
|
||||||
|
if (empty($user))
|
||||||
|
$user = "<i>Unknown</i>";
|
||||||
|
|
||||||
if (!isset($ban['lastnickname']))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
$lastnickname = $ban['lastnickname']->toString();
|
|
||||||
$reason = $ban['reason'];
|
$reason = $ban['reason'];
|
||||||
$invokername = $ban['invokername']->toString();
|
$invokername = $ban['invokername']->toString();
|
||||||
$created = date('d-m-Y H:i:s', $ban['created']);
|
$created = date('d-m-Y H:i:s', $ban['created']);
|
||||||
|
@ -87,7 +95,7 @@ function getBanlist() {
|
||||||
else
|
else
|
||||||
$expires = date('d-m-Y H:i:s', $ban['created'] + $duration);
|
$expires = date('d-m-Y H:i:s', $ban['created'] + $duration);
|
||||||
|
|
||||||
$output .= "<tr><td>$lastnickname</td><td>$reason</td><td>$invokername</td><td>$created</td><td>$expires</td></tr>";
|
$output .= "<tr><td>$user</td><td>$reason</td><td>$invokername</td><td>$created</td><td>$expires</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
|
@ -101,6 +109,9 @@ function getBanlist() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function censorIP($ip) {
|
||||||
|
return preg_replace("/(\d+\.\d+\.)\d+\.\d+/", "$1*.*", $ip);
|
||||||
|
}
|
||||||
|
|
||||||
require_once __DIR__ . "/include/footer.php";
|
require_once __DIR__ . "/include/footer.php";
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<ul class="list-inline">
|
<ul class="list-inline">
|
||||||
<li> <!-- Please respect the amount of work we've put for free into this project and leave the authors in the footer. Thank you. -->
|
<li> <!-- Please respect the amount of work we've put for free into this project and leave the authors in the footer. Thank you. -->
|
||||||
<p>
|
<p>
|
||||||
<a href="https://github.com/Wruczek/ts-website">ts-website</a> v 1.3.3 — © <a href="http://wruczek.top">Wruczek</a> 2016
|
<a href="https://github.com/Wruczek/ts-website">ts-website</a> v 1.3.4 — © <a href="http://wruczek.top">Wruczek</a> 2016
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -90,7 +90,7 @@ function showError($title, $text) { ?>
|
||||||
<?php echo $text; ?>
|
<?php echo $text; ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-footer">
|
<div class="panel-footer">
|
||||||
© <a href="http://wruczek.top">Wruczek</a> 2016 | <a href="https://github.com/Wruczek/ts-website">ts-website</a> v 1.3.3 | MIT License
|
© <a href="http://wruczek.top">Wruczek</a> 2016 | <a href="https://github.com/Wruczek/ts-website">ts-website</a> v 1.3.4 | MIT License
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue