From 60cdb049374677019e660524c4adfc3c05140a08 Mon Sep 17 00:00:00 2001 From: umorigu Date: Thu, 25 Feb 2016 23:40:20 +0900 Subject: [PATCH] BugTrack2/375 Show "Invalid username or password" on failed login --- plugin/loginform.inc.php | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/plugin/loginform.inc.php b/plugin/loginform.inc.php index 6811735..4885436 100644 --- a/plugin/loginform.inc.php +++ b/plugin/loginform.inc.php @@ -33,6 +33,7 @@ function plugin_loginform_action() . ($page_after_login ? '&page_after_login=' . rawurlencode($page_after_login) : ''); $username = isset($_POST['username']) ? $_POST['username'] : ''; $password = isset($_POST['password']) ? $_POST['password'] : ''; + $isset_user_credential = $username || $password ; if ($username && $password && form_auth($username, $password)) { // Sign in successfully completed form_auth_redirect($url_after_login, $page_after_login); @@ -62,12 +63,8 @@ function plugin_loginform_action() ); } else { // login - $action_url_html = htmlsc($action_url); - $username_html = htmlsc($username); - $username_label_html = htmlsc($_loginform_messages['username']); - $password_label_html = htmlsc($_loginform_messages['password']); - $login_label_html = htmlsc($_loginform_messages['login']); - $body = <<< EOT + ob_start(); +?>
-
+
- - + + - + + - + + + + + +
@@ -130,7 +136,9 @@ window.addEventListener && window.addEventListener("DOMContentLoaded", function( }); //--> -EOT; + $_loginform_messages['login'], 'body' => $body, -- 2.11.0