From 2cafcd7fc8c4f2ae5a54d86c19d474ea1aa634e1 Mon Sep 17 00:00:00 2001 From: Peter Knut Date: Tue, 19 Nov 2024 22:35:56 +0100 Subject: [PATCH] Handle the situation when no driver is found This can happen if Adminer for MySQL with existing login is replaced by Adminer for PostgreSQL. --- adminer/include/auth.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/adminer/include/auth.inc.php b/adminer/include/auth.inc.php index 9bde480d..531079a8 100644 --- a/adminer/include/auth.inc.php +++ b/adminer/include/auth.inc.php @@ -214,6 +214,12 @@ function auth_error($error) { exit; } +if (isset($_GET["username"]) && !DRIVER) { + page_header(lang('No driver'), lang('Database driver not found.'), false); + page_footer("auth"); + exit; +} + if (isset($_GET["username"]) && !class_exists("Min_DB")) { unset($_SESSION["pwds"][DRIVER]); unset_permanent();