Loading src/EventSubscriber/FsaEventSubscriber.php +13 −6 Original line number Diff line number Diff line Loading @@ -46,7 +46,10 @@ class FsaEventSubscriber implements EventSubscriberInterface { * @param \Drupal\Core\Session\AccountProxy $currentUser * The account proxy service. */ public function __construct(ConfigFactoryInterface $configFactory, AccountProxy $currentUser) { public function __construct( ConfigFactoryInterface $configFactory, AccountProxy $currentUser ) { $this->currentUser = $currentUser; $this->config = $configFactory; } Loading Loading @@ -110,7 +113,8 @@ class FsaEventSubscriber implements EventSubscriberInterface { * @return array|mixed|null */ protected function getStandardAclName() { return $this->config->get('fastly_streamline_access.settings')->get('acl_name');; return $this->config->get('fastly_streamline_access.settings') ->get('acl_name');; } /** Loading Loading @@ -190,10 +194,13 @@ class FsaEventSubscriber implements EventSubscriberInterface { * React to an FSA triggered event */ public function fsaResponse() { if ($this->currentUser->hasPermission('access protected lagoon routes')) { try { $this->addIpToACL(); } catch (\Exception $exception) { \Drupal::logger('fastly_streamline_access')->error($exception->getMessage()); \Drupal::logger('fastly_streamline_access') ->error($exception->getMessage()); } } } Loading @@ -204,8 +211,7 @@ class FsaEventSubscriber implements EventSubscriberInterface { * Config crud event. */ public function pageResponse(FilterResponseEvent $event) { if ($this->currentUser->hasPermission('access protected lagoon routes') && in_array( if (in_array( \Drupal::routeMatch() ->getRouteName(), self::FSA_TRIGGER_ROUTES Loading @@ -213,7 +219,8 @@ class FsaEventSubscriber implements EventSubscriberInterface { try { $this->fsaResponse(); } catch (\Exception $exception) { \Drupal::logger('fastly_streamline_access')->error($exception->getMessage()); \Drupal::logger('fastly_streamline_access') ->error($exception->getMessage()); } } } Loading Loading
src/EventSubscriber/FsaEventSubscriber.php +13 −6 Original line number Diff line number Diff line Loading @@ -46,7 +46,10 @@ class FsaEventSubscriber implements EventSubscriberInterface { * @param \Drupal\Core\Session\AccountProxy $currentUser * The account proxy service. */ public function __construct(ConfigFactoryInterface $configFactory, AccountProxy $currentUser) { public function __construct( ConfigFactoryInterface $configFactory, AccountProxy $currentUser ) { $this->currentUser = $currentUser; $this->config = $configFactory; } Loading Loading @@ -110,7 +113,8 @@ class FsaEventSubscriber implements EventSubscriberInterface { * @return array|mixed|null */ protected function getStandardAclName() { return $this->config->get('fastly_streamline_access.settings')->get('acl_name');; return $this->config->get('fastly_streamline_access.settings') ->get('acl_name');; } /** Loading Loading @@ -190,10 +194,13 @@ class FsaEventSubscriber implements EventSubscriberInterface { * React to an FSA triggered event */ public function fsaResponse() { if ($this->currentUser->hasPermission('access protected lagoon routes')) { try { $this->addIpToACL(); } catch (\Exception $exception) { \Drupal::logger('fastly_streamline_access')->error($exception->getMessage()); \Drupal::logger('fastly_streamline_access') ->error($exception->getMessage()); } } } Loading @@ -204,8 +211,7 @@ class FsaEventSubscriber implements EventSubscriberInterface { * Config crud event. */ public function pageResponse(FilterResponseEvent $event) { if ($this->currentUser->hasPermission('access protected lagoon routes') && in_array( if (in_array( \Drupal::routeMatch() ->getRouteName(), self::FSA_TRIGGER_ROUTES Loading @@ -213,7 +219,8 @@ class FsaEventSubscriber implements EventSubscriberInterface { try { $this->fsaResponse(); } catch (\Exception $exception) { \Drupal::logger('fastly_streamline_access')->error($exception->getMessage()); \Drupal::logger('fastly_streamline_access') ->error($exception->getMessage()); } } } Loading