concrete/src/User/Login/LoginAttemptService.php
public function trackAttempt($username, $password)
    {
        if (!$this->config->get('concrete.user.deactivation.authentication_failure.enabled', false)) {
            return $this;
        }

        $user = $this->resolveUser($username);
        if (!$user) {
            return;
        }

        $attempt = new LoginAttempt();
        $attempt->setUtcDate(Carbon::now('UTC'));
        $attempt->setUserId($user->getUserID());
        $this->entityManager->persist($attempt);

        // Make sure we get flushed with the next batch
        $this->batch[] = $attempt;

        // Prune old attempts
        $this->pruneAttempts();

        return $this;
    }
public function trackAttempt($username, $password)
    {
        if (!$this->config->get('concrete.user.deactivation.authentication_failure.enabled', false)) {
            return $this;
        }

        $user = $this->resolveUser($username);
        if (!$user) {
            return;
        }

        $attempt = new LoginAttempt();
        $attempt->setUtcDate(Carbon::now('UTC'));
        $attempt->setUserId($user->getUserID());
        $this->entityManager->persist($attempt);

        // Make sure we get flushed with the next batch
        $this->batch[] = $attempt;

        // Prune old attempts
        $this->pruneAttempts();

        return $this;
    }
public function trackAttempt ( $ username , $ password ) { if ( ! $ this -> config -> get ( 'concrete.user.deactivation.authentication_failure.enabled' , false ) ) { return $ this ; } $ user = $ this -> resolveUser ( $ username ) ; if ( ! $ user ) { return ; } $ attempt = new LoginAttempt ( ) ; $ attempt -> setUtcDate ( Carbon :: now ( 'UTC' ) ) ; $ attempt -> setUserId ( $ user -> getUserID ( ) ) ; $ this -> entityManager -> persist ( $ attempt ) ; // Make sure we get flushed with the next batch $ this -> batch [ ] = $ attempt ; // Prune old attempts $ this -> pruneAttempts ( ) ; return $ this ; }
Track a login attempt for a user

@param string $username
@param string $password

@return $this
Track a login attempt for a user