You are here

public function ClientIp::getErrorMessage in User restrictions 8

Get error message displayed to the user.

Return value

string Error message.

Overrides UserRestrictionTypeBase::getErrorMessage

File

src/Plugin/UserRestrictionType/ClientIp.php, line 58

Class

ClientIp
Defines a restriction type by client IP.

Namespace

Drupal\user_restrictions\Plugin\UserRestrictionType

Code

public function getErrorMessage() {
  return $this
    ->t('Accessing the site from the IP %value is not allowed.', [
    '%value' => $this->requestStack
      ->getCurrentRequest()
      ->getClientIp(),
  ]);
}