mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Logging in with an invalid email returns no error message (fixes #5332, thanks ajshort)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@102072 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
97b40fbca6
commit
05b4a2313e
@ -42,7 +42,12 @@ class MemberAuthenticator extends Authenticator {
|
|||||||
"Member",
|
"Member",
|
||||||
"\"" . Member::get_unique_identifier_field() . "\" = '$SQL_user' AND \"Password\" IS NOT NULL"
|
"\"" . Member::get_unique_identifier_field() . "\" = '$SQL_user' AND \"Password\" IS NOT NULL"
|
||||||
);
|
);
|
||||||
$result = ($member) ? $member->checkPassword($RAW_data['Password']) : false;
|
|
||||||
|
if($member) {
|
||||||
|
$result = $member->checkPassword($RAW_data['Password']);
|
||||||
|
} else {
|
||||||
|
$result = new ValidationResult(false, _t('Member.ERRORWRONGCRED'));
|
||||||
|
}
|
||||||
|
|
||||||
if($member && !$result->valid()) {
|
if($member && !$result->valid()) {
|
||||||
$member->registerFailedLogin();
|
$member->registerFailedLogin();
|
||||||
|
@ -247,6 +247,9 @@ class SecurityTest extends FunctionalTest {
|
|||||||
$this->assertTrue(is_object($attempt));
|
$this->assertTrue(is_object($attempt));
|
||||||
$this->assertEquals($attempt->Status, 'Failure');
|
$this->assertEquals($attempt->Status, 'Failure');
|
||||||
$this->assertEquals($attempt->Email, 'wronguser@silverstripe.com');
|
$this->assertEquals($attempt->Email, 'wronguser@silverstripe.com');
|
||||||
|
$this->assertNotNull(
|
||||||
|
$this->loginErrorMessage(), 'An invalid email returns a message.'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testSuccessfulLoginAttempts() {
|
function testSuccessfulLoginAttempts() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user