You are here

public function ConfigForm::__construct in Restrict IP 3.x

Same name and namespace in other branches
  1. 8.2 src/Form/ConfigForm.php \Drupal\restrict_ip\Form\ConfigForm::__construct()
  2. 8 src/Form/ConfigForm.php \Drupal\restrict_ip\Form\ConfigForm::__construct()

* Constructs a Restrict IP ConfigForm object * *

Parameters

\Drupal\Core\Session\AccountProxyInterface $currentUser: * The current user * @param \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler * The Module Handler service * @param \Drupal\Core\Locale\CountryManagerInterface $countryManager * The Country Manager service * @param \Drupal\restrict_ip\Service\RestrictIpServiceInterface $restrictIpService * The Restrict IP service object

Overrides ConfigFormBase::__construct

File

src/Form/ConfigForm.php, line 78

Class

ConfigForm

Namespace

Drupal\restrict_ip\Form

Code

public function __construct(AccountProxyInterface $currentUser, ModuleHandlerInterface $moduleHandler, CountryManagerInterface $countryManager, RestrictIpServiceInterface $restrictIpService) {
  $this->currentUser = $currentUser;
  $this->moduleHandler = $moduleHandler;
  $this->countryManager = $countryManager;
  $this->restrictIpService = $restrictIpService;
  $this->whitelistedIpAddresses = $this->restrictIpService
    ->getWhitelistedIpAddresses();
  $this->whitelistedPagePaths = $this->restrictIpService
    ->getWhitelistedPagePaths();
  $this->blacklistedPagePaths = $this->restrictIpService
    ->getBlacklistedPagePaths();
}