Skip to content
Snippets Groups Projects
Commit a767140b authored by Ken Rickard's avatar Ken Rickard Committed by GitHub
Browse files

Merge pull request #266 from agentrickard/265-path

Fixes issue 265 -- no default settings for path exceptions.
parents 5cdefe6d 966668a3
No related branches found
Tags 8.x-1.7
No related merge requests found
......@@ -52,11 +52,11 @@ class DomainAccessCheck implements AccessCheckInterface {
* {@inheritdoc}
*/
public function checkPath($path) {
$allowed_paths = $this->configFactory->get('domain.settings')->get('login_paths');
$allowed_paths = $this->configFactory->get('domain.settings')->get('login_paths', '/user/login\r\n/user/password');
if (!empty($allowed_paths)) {
$paths = preg_split("(\r\n?|\n)", $allowed_paths);
}
if (in_array($path, $paths)) {
if (!empty($paths) && in_array($path, $paths)) {
return FALSE;
}
return TRUE;
......
......@@ -46,7 +46,7 @@ class DomainSettingsForm extends ConfigFormBase {
'#rows' => 5,
'#columns' => 40,
'#title' => $this->t('Paths that should be accessible for inactive domains'),
'#default_value' => $config->get('login_paths'),
'#default_value' => $config->get('login_paths', '/user/login\r\n/user/password'),
'#description' => $this->t('Inactive domains are only accessible to users with permission.
Enter any paths that should be accessible, one per line. Normally, only the
login path will be allowed.'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment