src/Security/Member.php
public function registerFailedLogin()
    {
        $lockOutAfterCount = self::config()->get('lock_out_after_incorrect_logins');
        if ($lockOutAfterCount) {
            // Keep a tally of the number of failed log-ins so that we can lock people out
            ++$this->FailedLoginCount;

            if ($this->FailedLoginCount >= $lockOutAfterCount) {
                $lockoutMins = self::config()->get('lock_out_delay_mins');
                $this->LockedOutUntil = date('Y-m-d H:i:s', DBDatetime::now()->getTimestamp() + $lockoutMins * 60);
                $this->FailedLoginCount = 0;
            }
        }
        $this->extend('registerFailedLogin');
        $this->write();
    }
public function registerFailedLogin()
    {
        $lockOutAfterCount = self::config()->get('lock_out_after_incorrect_logins');
        if ($lockOutAfterCount) {
            // Keep a tally of the number of failed log-ins so that we can lock people out
            ++$this->FailedLoginCount;

            if ($this->FailedLoginCount >= $lockOutAfterCount) {
                $lockoutMins = self::config()->get('lock_out_delay_mins');
                $this->LockedOutUntil = date('Y-m-d H:i:s', DBDatetime::now()->getTimestamp() + $lockoutMins * 60);
                $this->FailedLoginCount = 0;
            }
        }
        $this->extend('registerFailedLogin');
        $this->write();
    }
public function registerFailedLogin ( ) { $ lockOutAfterCount = self :: config ( ) -> get ( 'lock_out_after_incorrect_logins' ) ; if ( $ lockOutAfterCount ) { // Keep a tally of the number of failed log-ins so that we can lock people out ++ $ this -> FailedLoginCount ; if ( $ this -> FailedLoginCount >= $ lockOutAfterCount ) { $ lockoutMins = self :: config ( ) -> get ( 'lock_out_delay_mins' ) ; $ this -> LockedOutUntil = date ( 'Y-m-d H:i:s' , DBDatetime :: now ( ) -> getTimestamp ( ) + $ lockoutMins * 60 ) ; $ this -> FailedLoginCount = 0 ; } } $ this -> extend ( 'registerFailedLogin' ) ; $ this -> write ( ) ; }
Tell this member that someone made a failed attempt at logging in as them.
This can be used to lock the user out temporarily if too many failed attempts are made.
Tell this member that someone made a failed attempt at logging in as them . This can be used to lock the user out temporarily if too many failed attempts are made .