isExpired()) {
$cacheutils->setValue([getBanlist(), date('d-m-Y H:i:s')], 300);
}
$banlist = $cacheutils->getValue();
?>
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();
$duration = $ban['duration'];
$createdepoch = $ban['created'];
$expiresepoch = $ban['created'] + $duration;
$created = date('d-m-Y H:i:s', $createdepoch);
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', $expiresepoch);
$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";
?>