diff --git a/check.php b/check.php index 2f28131..bb5d699 100644 --- a/check.php +++ b/check.php @@ -28,7 +28,7 @@ class Check { if (!isset($uuid)) { if (filter_var($name, FILTER_VALIDATE_FLOAT)) { echo "
"; - $page->settings->redirect("info.php?id=$name&type=$type", false); + redirect("info.php?id=$name&type=$type", false); return; } $name = htmlspecialchars($name, ENT_QUOTES, 'UTF-8'); @@ -42,7 +42,7 @@ class Check { } echo "
"; - $page->settings->redirect($href, false); + redirect($href, false); /* $table = $page->settings->table['bans']; diff --git a/error/missing-extensions.php b/error/missing-extensions.php new file mode 100644 index 0000000..615c991 --- /dev/null +++ b/error/missing-extensions.php @@ -0,0 +1,46 @@ + + + + + + + litebans-php - Missing Extensions + + + +
+
+

Missing Extensions


+
+ The following PHP extensions are required by litebans-php but were not found: +
+ pdo_mysql"; + } ?> + + + + array()); + if (preg_match_all('#(?:

(?:)?(.*?)(?:)?

)|(?:(.*?)\s*(?:(.*?)\s*(?:(.*?)\s*)?)?)#s', ob_get_clean(), $matches, PREG_SET_ORDER)) + foreach ($matches as $match) + if (strlen($match[1])) + $phpinfo[$match[1]] = array(); + elseif (isset($match[3])) + $phpinfo[end(array_keys($phpinfo))][$match[2]] = isset($match[4]) ? array($match[3], $match[4]) : $match[3]; + else + $phpinfo[end(array_keys($phpinfo))][] = $match[2]; + + echo "These extensions can be enabled in php.ini.
"; + echo "php.ini location: " . $phpinfo['phpinfo']["Loaded Configuration File"] . ""; + ?> +
+
+ Try Again +
+
+ + diff --git a/inc/init.php b/inc/init.php new file mode 100644 index 0000000..5b47dbc --- /dev/null +++ b/inc/init.php @@ -0,0 +1,12 @@ +Redirecting..."; + } + die(""); +} + +if (!extension_loaded("pdo_mysql")) { + redirect("error/missing-extensions.php"); +} diff --git a/inc/page.php b/inc/page.php index b62c266..bbbbdc2 100644 --- a/inc/page.php +++ b/inc/page.php @@ -1,4 +1,5 @@ driver = $driver; if ($connect) { if ($username === "" && $password === "") { - $this->redirect("error/unconfigured.php"); + redirect("error/unconfigured.php"); } $host = $this->host; $port = $this->port; @@ -212,9 +212,9 @@ final class Settings { if ($settings->error_pages) { if (strstr($message, "Access denied for user")) { if ($settings->error_reporting) { - $settings->redirect("error/access-denied.php?error=" . base64_encode($message)); + redirect("error/access-denied.php?error=" . base64_encode($message)); } else { - $settings->redirect("error/access-denied.php"); + redirect("error/access-denied.php"); } } if (strstr($message, "Base table or view not found:")) { @@ -223,12 +223,12 @@ final class Settings { $st->fetch(); $st->closeCursor(); } catch (PDOException $e) { - $settings->redirect("error/tables-not-found.php"); + redirect("error/tables-not-found.php"); } - $settings->redirect("error/outdated-plugin.php"); + redirect("error/outdated-plugin.php"); } if (strstr($message, "Unknown column")) { - $settings->redirect("error/outdated-plugin.php"); + redirect("error/outdated-plugin.php"); } } if ($settings->error_reporting === false) { @@ -238,13 +238,6 @@ final class Settings { } - function redirect($url, $showtext = true) { - if ($showtext === true) { - echo "Redirecting..."; - } - echo ""; - die; - } private function test_strftime() { // If you modify this function, you may get an "Assertion failed" error.