Merge branch 'feature/pagemedia' into 1.9

This commit is contained in:
Andy Miller
2018-10-01 10:25:02 -06:00
15 changed files with 82 additions and 31 deletions

View File

@@ -434,7 +434,13 @@ class AdminPlugin extends Plugin
throw new \RuntimeException('Page Not Found', 404);
}
} else {
$this->grav->redirect($this->admin_route);
// Not Found and not logged in: Display login page.
$login_file = $this->grav['locator']->findResource('plugins://admin/pages/admin/login.md');
$page = new Page();
$page->init(new \SplFileInfo($login_file));
$page->slug(basename($this->route));
unset($this->grav['page']);
$this->grav['page'] = $page;
}
}