diff options
Diffstat (limited to 'w/class/controller.php')
-rw-r--r-- | w/class/controller.php | 57 |
1 files changed, 57 insertions, 0 deletions
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 @@ +<?php + +class Controller extends Application +{ + + protected $user; + protected $usermanager; + protected $templates; + + public function __construct() { + parent::__construct(); + $this->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 '<h3>Editor access</h3>'; + return true; + } else { + echo '<h3>Not enought rights to see more...</h3>'; + return false; + } + } + + + + + + public function redirect($url) + { + header('Location: ' . $url); + } + + + +} + + + + + +?>
\ No newline at end of file |