Merge pull request #6762 from Quadra-Digital/login-hooks

Add Extension Hooks to Member Login Processes
This commit is contained in:
Daniel Hensby 2017-03-30 12:57:00 +01:00 committed by GitHub
commit 203963199b

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.