v 1.3.4 - Improvements for banlist
This commit is contained in:
parent
cc9b755087
commit
44eb73c379
31
bans.php
31
bans.php
|
@ -64,20 +64,28 @@ 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) {
|
||||||
|
|
||||||
if (!isset($ban['lastnickname']))
|
$user = null;
|
||||||
continue;
|
|
||||||
|
|
||||||
$lastnickname = $ban['lastnickname']->toString();
|
if (!empty($ban['ip']))
|
||||||
$reason = $ban['reason'];
|
$user = censorIP($ban['ip']->toString());
|
||||||
$invokername = $ban['invokername']->toString();
|
|
||||||
$created = date('d-m-Y H:i:s', $ban['created']);
|
if (!empty($ban['lastnickname']))
|
||||||
$duration = $ban['duration'];
|
$user = $ban['lastnickname']->toString();
|
||||||
|
|
||||||
|
if (empty($user))
|
||||||
|
$user = "<i>Unknown</i>";
|
||||||
|
|
||||||
|
|
||||||
|
$reason = $ban['reason'];
|
||||||
|
$invokername = $ban['invokername']->toString();
|
||||||
|
$created = date('d-m-Y H:i:s', $ban['created']);
|
||||||
|
$duration = $ban['duration'];
|
||||||
|
|
||||||
if (empty($reason))
|
if (empty($reason))
|
||||||
$reason = "<b>" . translate($lang["banlist"]["table"]["emptyreason"]) . "</b>";
|
$reason = "<b>" . translate($lang["banlist"]["table"]["emptyreason"]) . "</b>";
|
||||||
|
@ -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