Adding extension hooks to Member isLockedOut() and registerSuccessfulLogin()

This commit is contained in:
Joe Harvey 2017-03-30 11:07:51 +01:00
parent d9cffe5f53
commit 0d0d18612d

View File

@ -398,7 +398,9 @@ class Member extends DataObject implements TemplateGlobalProvider {
* Returns true if this user is locked out * Returns true if this user is locked out
*/ */
public function isLockedOut() { public function isLockedOut() {
return $this->LockedOutUntil && SS_Datetime::now()->Format('U') < strtotime($this->LockedOutUntil); $state = ($this->LockedOutUntil && SS_Datetime::now()->Format('U') < strtotime($this->LockedOutUntil));
$this->extend('updateIsLockedOut', $state);
return $state;
} }
/** /**
@ -1685,6 +1687,7 @@ class Member extends DataObject implements TemplateGlobalProvider {
$this->FailedLoginCount = 0; $this->FailedLoginCount = 0;
$this->write(); $this->write();
} }
$this->extend('onAfterRegisterSuccessfulLogin');
} }
/** /**
* Get the HtmlEditorConfig for this user to be used in the CMS. * Get the HtmlEditorConfig for this user to be used in the CMS.