/** * Requires logged in user to be administrator */ public function requireAdministrator() { $this->setState('REQUIRE_ADMINISTRATOR'); //Required Level $lvl = "administrator"; $u = new User(); //If level is not ok force quick stop of processing if (!$u->checkUserLevel($lvl)) { //Get Access Denied Page for his level $cont = $this->openFile("core/fragments/users/access_denied.phtml"); //Set the content $this->getController()->getView()->setContentTitle("Access Denied"); //Set the content $this->getController()->getView()->setContent($cont); //Display page $this->getController()->displayPage(); //Stop All Processing $this->getController()->freeze_all(); } }