Closed (fixed)
Project:
Login Security
Version:
7.x-1.9
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Aug 2013 at 10:45 UTC
Updated:
13 Sep 2017 at 09:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
shrop commentedThis issue was caused by a usability commit in Drupal 7.23. You can read about it in this issue.
This issue has been resolved in this commit.
Comment #2
shrop commentedUpdates committed:
* Improved the preg_grep regex to include the user name and full message check compatible with Drupal core 7.23+
* Updated related simpltests to support the new error message
* Added check_plain() for the user name for value returned
Comment #3
shrop commentedI confirmed that this fix doesn't apply to the 5.x-1.x and 6.x-1.x branches. I then released login_security 7.x-1.6.
Comment #4
quiptime commentedThe bug still exist in 7.x-1.6.
Comment #5
quiptime commentedComment #6
shrop commented@quiptime: Are you running Drupal core 7.23? This fix is only for that version and onward. If not, can you provide more details. I already have this fix deployed on production applications and it appears to be working fine. Thanks!
Comment #7
quiptime commentedThe error occurs on Drupal core 7.23.
The login page use math Captcha 7.x-1.0.
The bug is fixed login_security 7.x-1.6?
Comment #8
shrop commentedThanks for the details! So, it sounds like an interaction issue with math captcha. Have you tried login_security 7.x-1.7?
I wonder if it is a weight issue where math captcha is getting to reset the login form first?
Comment #9
quiptime commentedThe problem still exist with
My Login Security configuration:
The option Disable login failure error message is enabled. All other configurable options use the default values.
Comment #10
shrop commentedThanks for that clarification @quiptime.
I did go back and do some tests on one of our production sites with the latest login_security codebase. The display login failure error messages do stay hidden as expected for the latest versions of Safari, Chrome, FireFox, and IE10. I then ran drush quick-drupal with Drupal 7.23 and Login Security 7.x-1.7. The feature also works fine there with default options and "Disable login failure error message" enabled.
Just to clarify, when you have "Disable login failure error message" enabled/checked, you still see the "Sorry, unrecognized username or password. Have you forgotten your password?" message? That is not the case for me, but just wanted to be sure that is what you mean by your report that it isn't working.
I will leave this issue open with "needs more information" for a while to see if others report problems as you have seen. I don't think there is any more I can do until we have more info.
Thanks!
Comment #11
quiptime commentedYes, I mean the message "Sorry, unrecognized username or password. Have you forgotten your password?".
Comment #12
quiptime commentedI have a little bit debugged your code.
My debug result
On the login page, a user is every time anonymous.
The function user_is_anonymous() makes no sense.
The variables $password_message and $block_message are arrays.
The usage of !empty($password_message) and !empty($block_message) does not work for an array.
My bug fix
With this code, the message "Sorry, unrecognized username or password. Have you forgotten your password?" are hidden if a login failed.
Comment #13
shrop commentedThanks! I didn't think about preg_grep returning an array. Of maybe it is our version of PHP or something. It worked for me in multiple cases, but your change looks right.
Do you mind uploading a patch?
Comment #14
shrop commentedChanging to "needs work"
Comment #15
shrop commentedAlso, related simpletests pass for me using 7.x-1.7. I would love some input on how to improve those tests where they would have caught this bug.
Comment #16
shrop commentedApplied quiptime's fix to 7.x-1.x. The patch is also attached here for reference. I confirmed that this fixed the issue. I finally had this happen on a web app so it was easy for me to see quiptime's issue. Thanks for the help!
Comment #19
my-family commentedUPDATED:
Disabling the core message works. However, if this option is enabled (together with the "Notify the user about the number of remaining login attempts " checkbox), there is another problem:
There is no message about blocking the user. Instead, the login form refreshes with the warning (yellow) message about attempts number.