diff --git a/bans.php b/bans.php index 2d7e0bd..02cb00e 100644 --- a/bans.php +++ b/bans.php @@ -64,20 +64,28 @@ function getBanlist() { try { $tsAdmin = TeamSpeak3::factory(getTeamspeakURI() . "#no_query_clients"); - $bany = $tsAdmin->banList(); + $bans = $tsAdmin->banList(); $output = ""; - foreach ($bany as $ban) { + foreach ($bans as $ban) { - if (!isset($ban['lastnickname'])) - continue; + $user = null; - $lastnickname = $ban['lastnickname']->toString(); - $reason = $ban['reason']; - $invokername = $ban['invokername']->toString(); - $created = date('d-m-Y H:i:s', $ban['created']); - $duration = $ban['duration']; + if (!empty($ban['ip'])) + $user = censorIP($ban['ip']->toString()); + + if (!empty($ban['lastnickname'])) + $user = $ban['lastnickname']->toString(); + + if (empty($user)) + $user = "Unknown"; + + + $reason = $ban['reason']; + $invokername = $ban['invokername']->toString(); + $created = date('d-m-Y H:i:s', $ban['created']); + $duration = $ban['duration']; if (empty($reason)) $reason = "" . translate($lang["banlist"]["table"]["emptyreason"]) . ""; @@ -87,7 +95,7 @@ function getBanlist() { else $expires = date('d-m-Y H:i:s', $ban['created'] + $duration); - $output .= "
- ts-website v 1.3.3 — © Wruczek 2016 + ts-website v 1.3.4 — © Wruczek 2016
diff --git a/include/modulecheck.php b/include/modulecheck.php index daacbb8..9f1f240 100644 --- a/include/modulecheck.php +++ b/include/modulecheck.php @@ -90,7 +90,7 @@ function showError($title, $text) { ?>