diff --git a/adminer/include/auth.inc.php b/adminer/include/auth.inc.php index 590b4c23..d951c526 100644 --- a/adminer/include/auth.inc.php +++ b/adminer/include/auth.inc.php @@ -73,6 +73,7 @@ function auth_error($exception = null) { } } } + unset($_GET["username"]); // checked in page_header() for successful login page_header(lang('Login'), $error, null); echo "
\n"; $adminer->loginForm(); diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index dfad385a..6e9bb840 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -32,7 +32,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { -);" onload="bodyLoad('server_info, 0, 3) : ""); ?>', '');"> + onclick="return bodyClick(event, '');" onload="bodyLoad('server_info, 0, 3) : ""); ?>', '');"> diff --git a/adminer/static/functions.js b/adminer/static/functions.js index c678e785..91a3b0cb 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -368,7 +368,7 @@ function selectDblClick(td, event, text) { /** Load link by AJAX * @param MouseEvent -* @param [string] +* @param string * @return bool */ function bodyClick(event, db) { @@ -381,11 +381,9 @@ function bodyClick(event, db) { } if (/^a$/i.test(el.tagName) && !/^https?:|#/i.test(el.getAttribute('href')) && /[&?]username=/.exec(el.href)) { var match = /&db=([^&]*)/.exec(el.href); - if (db === (match ? match[1] : '') && ajaxMain(el.href, '', event)) { - return false; - } + return !(db == (match ? match[1] : '') && ajaxMain(el.href, '', event)); } - if (/^input$/i.test(el.tagName) && /submit|image/.test(el.type) && !/&(database|scheme|create|view|sql|user)=/.test(location.href) && /[&?]username=/.test(location.href)) { + if (/^input$/i.test(el.tagName) && /submit|image/.test(el.type) && !/&(database|scheme|create|view|sql|user)=/.test(location.href)) { return !ajaxForm(el.form, (el.name ? encodeURIComponent(el.name) + '=1' : '')); } return true;