From 4a3ec0ca3f7d0ca8776a6ee7f2a2615234395eb8 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Mon, 16 Jul 2018 00:09:33 +0200 Subject: Cake 3.6.7 fresh install --- fai_gestion/src/Controller/PagesController.php | 69 ++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 fai_gestion/src/Controller/PagesController.php (limited to 'fai_gestion/src/Controller/PagesController.php') diff --git a/fai_gestion/src/Controller/PagesController.php b/fai_gestion/src/Controller/PagesController.php new file mode 100644 index 0000000..d023661 --- /dev/null +++ b/fai_gestion/src/Controller/PagesController.php @@ -0,0 +1,69 @@ +redirect('/'); + } + if (in_array('..', $path, true) || in_array('.', $path, true)) { + throw new ForbiddenException(); + } + $page = $subpage = null; + + if (!empty($path[0])) { + $page = $path[0]; + } + if (!empty($path[1])) { + $subpage = $path[1]; + } + $this->set(compact('page', 'subpage')); + + try { + $this->render(implode('/', $path)); + } catch (MissingTemplateException $exception) { + if (Configure::read('debug')) { + throw $exception; + } + throw new NotFoundException(); + } + } +} -- cgit v1.1