get('banlist');
// $cache->clean();
if (is_null($banlist)) {
$banlist = array(getBanlist(), date('d-m-Y H:i:s'));
$cache->set('banlist', $banlist, 600);
}
?>
banList();
$output = "";
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 = "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"]) . "";
if ($duration == 0)
$expires = translate($lang["banlist"]["table"]["permaban"]);
else
$expires = date('d-m-Y H:i:s', $ban['created'] + $duration);
$output .= "$user | $reason | $invokername | $created | $expires |
";
}
return $output;
} catch (TeamSpeak3_Exception $e) {
if ($e->getCode() == 1281) {
return '';
} else {
return '' . translate($lang["general"]["scripterror"], [$e->getCode(), $e->getMessage()]) . '
';
}
}
}
function censorIP($ip) {
return preg_replace("/(\d+\.\d+\.)\d+\.\d+/", "$1***.***", $ip);
}
require_once __DIR__ . "/include/footer.php";
?>