You are here

public function CredentialsCheckFlood::isAllowedAccount in Commerce Core 8.2

Whether or not a credentials check with the given account is allowed.

Parameters

string $ip: The client IP address.

string $name: The account name.

Return value

bool TRUE if credentials check is allowed, FALSE otherwise.

Overrides CredentialsCheckFloodInterface::isAllowedAccount

File

src/CredentialsCheckFlood.php, line 99

Class

CredentialsCheckFlood
Provides flood protection for login credential checks.

Namespace

Drupal\commerce

Code

public function isAllowedAccount($ip, $name) {
  $allowed = TRUE;
  if ($identifier = $this
    ->getAccountIdentifier($ip, $name)) {
    $allowed = $this->flood
      ->isAllowed('user.failed_login_user', $this->config
      ->get('user_limit'), $this->config
      ->get('user_window'), $identifier);
  }
  return $allowed;
}