You are here

private function AlternativeFrontpageSettings::isAllowedPath in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::isAllowedPath()
  2. 8.2 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::isAllowedPath()
  3. 8.3 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::isAllowedPath()
  4. 8.4 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::isAllowedPath()
  5. 8.5 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::isAllowedPath()
  6. 8.6 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::isAllowedPath()
  7. 8.7 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::isAllowedPath()
  8. 8.8 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::isAllowedPath()
  9. 10.3.x modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::isAllowedPath()
  10. 10.0.x modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::isAllowedPath()
  11. 10.1.x modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::isAllowedPath()
  12. 10.2.x modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::isAllowedPath()

Checks if a path is allowed.

Some paths are not allowed, e.g. /user/logout or /ajax.

Parameters

string $path: Path to check.

Return value

bool Returns true when path is allowed.

1 call to AlternativeFrontpageSettings::isAllowedPath()
AlternativeFrontpageSettings::validateForm in modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php
Form validation handler.

File

modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php, line 133

Class

AlternativeFrontpageSettings
Class AlternativeFrontpageSettings.

Namespace

Drupal\alternative_frontpage\Form

Code

private function isAllowedPath($path) {
  $unallowed_paths = [
    '/user/logout',
    '/ajax',
  ];
  foreach ($unallowed_paths as $unallowed_path) {
    if ($unallowed_path === substr($path, 0, strlen($unallowed_path))) {
      return FALSE;
    }
  }
  return TRUE;
}