mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #2560 from TomSpeak/patch-2
NEW Hook for `Member::registerFailedLogin`
This commit is contained in:
commit
1895f289cc
@ -227,7 +227,6 @@ class Member extends DataObject implements TemplateGlobalProvider {
|
||||
|
||||
$e = PasswordEncryptor::create_for_algorithm($this->PasswordEncryption);
|
||||
if(!$e->check($this->Password, $password, $this->Salt, $this)) {
|
||||
$iidentifierField =
|
||||
$result->error(_t (
|
||||
'Member.ERRORWRONGCREDS',
|
||||
'The provided details don\'t seem to be correct. Please try again.'
|
||||
@ -1408,15 +1407,15 @@ class Member extends DataObject implements TemplateGlobalProvider {
|
||||
if(self::config()->lock_out_after_incorrect_logins) {
|
||||
// Keep a tally of the number of failed log-ins so that we can lock people out
|
||||
$this->FailedLoginCount = $this->FailedLoginCount + 1;
|
||||
$this->write();
|
||||
|
||||
if($this->FailedLoginCount >= self::config()->lock_out_after_incorrect_logins) {
|
||||
$lockoutMins = self::config()->lock_out_delay_mins;
|
||||
$this->LockedOutUntil = date('Y-m-d H:i:s', time() + $lockoutMins*60);
|
||||
$this->FailedLoginCount = 0;
|
||||
$this->write();
|
||||
}
|
||||
}
|
||||
$this->extend('registerFailedLogin');
|
||||
$this->write();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user