From a91c916248f967da2d4218b575e665242b7c975b Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Thu, 25 Oct 2018 20:25:05 +0200 Subject: phoenixreborn\'NWY --- w/class/controller.php | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 w/class/controller.php (limited to 'w/class/controller.php') diff --git a/w/class/controller.php b/w/class/controller.php new file mode 100644 index 0000000..6eab6e4 --- /dev/null +++ b/w/class/controller.php @@ -0,0 +1,57 @@ +setuser(); + $this->settemplate(); + } + + + + public function setuser() + { + $this->usermanager = new Modeluser; + $this->user = $this->usermanager->readsession(); + } + + public function settemplate() + { + $this->templates = new League\Plates\Engine(Model::TEMPLATES_DIR); + } + + public function useriseditor() + { + if ($this->user->level() >= $this->usermanager::EDITOR) { + echo '

Editor access

'; + return true; + } else { + echo '

Not enought rights to see more...

'; + return false; + } + } + + + + + + public function redirect($url) + { + header('Location: ' . $url); + } + + + +} + + + + + +?> \ No newline at end of file -- cgit v1.2.3