• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

コミットメタ情報

リビジョン60cdb049374677019e660524c4adfc3c05140a08 (tree)
日時2016-02-25 23:40:20
作者umorigu <umorigu@gmai...>
コミッターumorigu

ログメッセージ

BugTrack2/375 Show "Invalid username or password" on failed login

変更サマリ

差分

--- a/plugin/loginform.inc.php
+++ b/plugin/loginform.inc.php
@@ -33,6 +33,7 @@ function plugin_loginform_action()
3333 . ($page_after_login ? '&page_after_login=' . rawurlencode($page_after_login) : '');
3434 $username = isset($_POST['username']) ? $_POST['username'] : '';
3535 $password = isset($_POST['password']) ? $_POST['password'] : '';
36+ $isset_user_credential = $username || $password ;
3637 if ($username && $password && form_auth($username, $password)) {
3738 // Sign in successfully completed
3839 form_auth_redirect($url_after_login, $page_after_login);
@@ -62,12 +63,8 @@ function plugin_loginform_action()
6263 );
6364 } else {
6465 // login
65- $action_url_html = htmlsc($action_url);
66- $username_html = htmlsc($username);
67- $username_label_html = htmlsc($_loginform_messages['username']);
68- $password_label_html = htmlsc($_loginform_messages['password']);
69- $login_label_html = htmlsc($_loginform_messages['login']);
70- $body = <<< EOT
66+ ob_start();
67+?>
7168 <style>
7269 .loginformcontainer {
7370 text-align: center;
@@ -89,23 +86,32 @@ function plugin_loginform_action()
8986 .loginform .loginbutton {
9087 margin-top: 1em;
9188 }
89+ .loginform .errormessage {
90+ color: red;
91+ }
9292 </style>
9393 <div class="loginformcontainer">
94-<form name="loginform" class="loginform" action="$action_url_html" method="post">
94+<form name="loginform" class="loginform" action="<?php echo htmlsc($action_url) ?>" method="post">
9595 <div>
9696 <table style="border:0">
9797 <tbody>
9898 <tr>
99- <td class="label"><label for="_plugin_loginform_username">$username_label_html</label></td>
100- <td><input type="text" name="username" value="$username_html" id="_plugin_loginform_username"></td>
99+ <td class="label"><label for="_plugin_loginform_username"><?php echo htmlsc($_loginform_messages['username']) ?></label></td>
100+ <td><input type="text" name="username" value="<?php echo htmlsc($username) ?>" id="_plugin_loginform_username"></td>
101101 </tr>
102102 <tr>
103- <td class="label"><label for="_plugin_loginform_password">$password_label_html</label></td>
103+ <td class="label"><label for="_plugin_loginform_password"><?php echo htmlsc($_loginform_messages['password']) ?></label></td>
104104 <td><input type="password" name="password" id="_plugin_loginform_password"></td>
105105 </tr>
106+<?php if ($isset_user_credential): ?>
106107 <tr>
107108 <td></td>
108- <td class="login-button-container"><input type="submit" value="$login_label_html" class="loginbutton"></td>
109+ <td class="errormessage"><?php echo $_loginform_messages['invalid_username_or_password'] ?></td>
110+ </tr>
111+<?php endif ?>
112+ <tr>
113+ <td></td>
114+ <td class="login-button-container"><input type="submit" value="<?php echo htmlsc($_loginform_messages['login']) ?>" class="loginbutton"></td>
109115 </tr>
110116 </tbody>
111117 </table>
@@ -130,7 +136,9 @@ window.addEventListener && window.addEventListener("DOMContentLoaded", function(
130136 });
131137 //-->
132138 </script>
133-EOT;
139+<?php
140+ $body = ob_get_contents();
141+ ob_end_clean();
134142 return array(
135143 'msg' => $_loginform_messages['login'],
136144 'body' => $body,