<?php
Abstract Class ControllerBase{
protected $xml;
protected $session;
protected $navigator;
protected function __construct(){
$auth = new Privileges();
$this->session = Session::getInstance();
$group = GUEST;
if($this->session->isRegistered('group')){
$group = $this->session->get('group');
}
$allowed_access = $auth->getAuth($group);
if(!array_key_exists($this->getName(),$allowed_access)){
die('WARNING: You dont have privileges to access this page! consult admin');
}
$this->xml = new XMLGenerator();
$this->navigator = new Navigation($allowed_access);
}
protected function getName(){
$r = new ReflectionClass($this);
return strtolower($r->getName());
}
protected function getContent($page){
$content = new Content();
$content->selectByID($page);
return $content->getContent();
}
abstract function index();
}
?>