diff --git a/error/outdated-plugin.php b/error/outdated-plugin.php new file mode 100644 index 0000000..1331e6a --- /dev/null +++ b/error/outdated-plugin.php @@ -0,0 +1,28 @@ + + + + + + + litebans-php - Outdated Plugin + + + +
+
+

Outdated Plugin


+
+ The web interface has connected to the database, but this database is managed by an older version of LiteBans. +
+ You will need to update LiteBans before you can continue using the web interface. Older versions are not supported. +
+ Updates can be downloaded here: https://www.spigotmc.org/resources/litebans.3715/ +
+ LiteBans will automatically upgrade the tables in the database after you have updated. After this, the web interface will work as normal. +
+
+ Try Again +
+
+ + diff --git a/inc/page.php b/inc/page.php index 54e5cb4..9604145 100644 --- a/inc/page.php +++ b/inc/page.php @@ -137,7 +137,7 @@ class Page { // Under certain versions of PHP, there is a bug with BIT columns. // An empty string is returned no matter what the value is. // Workaround: cast to unsigned. - $selection = "id,uuid,reason,banned_by_name,banned_by_uuid,time,until,CAST(active AS UNSIGNED) AS active"; + $selection = "id,uuid,reason,banned_by_name,banned_by_uuid,removed_by_name,time,until,CAST(active AS UNSIGNED) AS active"; if ($table === $this->settings->table['warnings']) { $selection .= ",CAST(warned AS UNSIGNED) AS warned"; } diff --git a/inc/settings.php b/inc/settings.php index 1e17cb7..5310af0 100644 --- a/inc/settings.php +++ b/inc/settings.php @@ -146,6 +146,9 @@ final class Settings { if (strstr($message, "Base table or view not found:")) { $settings->redirect("error/tables-not-found.php"); } + if (strstr($message, "Unknown column")) { + $settings->redirect("error/outdated-plugin.php"); + } } die('Database error: ' . $message); }