mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 16:32:45 +00:00
Add [IP Ban], [IP Mute] labels for info.php
This commit is contained in:
parent
2b78e68729
commit
73eb0e152f
@ -165,7 +165,7 @@ class Page {
|
|||||||
// Under certain versions of PHP, there is a bug with BIT columns.
|
// Under certain versions of PHP, there is a bug with BIT columns.
|
||||||
// An empty string is returned no matter what the value is.
|
// An empty string is returned no matter what the value is.
|
||||||
// Workaround: cast to unsigned.
|
// Workaround: cast to unsigned.
|
||||||
$selection = "id,uuid,reason,banned_by_name,banned_by_uuid,time,until,server_origin,server_scope,CAST(active AS UNSIGNED) AS active";
|
$selection = "id,uuid,reason,banned_by_name,banned_by_uuid,time,until,server_origin,server_scope,CAST(active AS UNSIGNED) AS active,CAST(ipban AS UNSIGNED) AS ipban";
|
||||||
if ($table === $this->settings->table['warnings']) {
|
if ($table === $this->settings->table['warnings']) {
|
||||||
$selection .= ",CAST(warned AS UNSIGNED) AS warned";
|
$selection .= ",CAST(warned AS UNSIGNED) AS warned";
|
||||||
}
|
}
|
||||||
|
12
info.php
12
info.php
@ -154,6 +154,18 @@ if ($st->execute(array($id))) {
|
|||||||
if (!($info instanceof KickInfo)) {
|
if (!($info instanceof KickInfo)) {
|
||||||
$style = 'style="margin-left: 13px; font-size: 16px;"';
|
$style = 'style="margin-left: 13px; font-size: 16px;"';
|
||||||
$active = $page->active($row);
|
$active = $page->active($row);
|
||||||
|
$ipban = $page->active($row, 'ipban');
|
||||||
|
if ($ipban === true) {
|
||||||
|
$idx = null;
|
||||||
|
if ($info instanceof BanInfo) {
|
||||||
|
$idx = "generic.ipban";
|
||||||
|
} else if ($info instanceof MuteInfo) {
|
||||||
|
$idx = "generic.ipmute";
|
||||||
|
}
|
||||||
|
if ($idx !== null) {
|
||||||
|
$header .= "<span $style class='label label-danger'>" . $page->t($idx) . "</span>";
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($active === true) {
|
if ($active === true) {
|
||||||
$header .= "<span $style class='label label-danger'>" . $page->t("generic.active") . "</span>";
|
$header .= "<span $style class='label label-danger'>" . $page->t("generic.active") . "</span>";
|
||||||
if ($permanent) {
|
if ($permanent) {
|
||||||
|
@ -23,6 +23,8 @@ class DefaultLang {
|
|||||||
|
|
||||||
$array["generic.ban"] = "Ban";
|
$array["generic.ban"] = "Ban";
|
||||||
$array["generic.mute"] = "Mute";
|
$array["generic.mute"] = "Mute";
|
||||||
|
$array["generic.ipban"] = "IP " . $array["generic.ban"];
|
||||||
|
$array["generic.ipmute"] = "IP " . $array["generic.mute"];
|
||||||
$array["generic.warn"] = "Warning";
|
$array["generic.warn"] = "Warning";
|
||||||
$array["generic.kick"] = "Kick";
|
$array["generic.kick"] = "Kick";
|
||||||
$array["generic.type"] = "Type";
|
$array["generic.type"] = "Type";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user