/** * The main execution * * It will verify the URL and * call the module and action * * When the call is not Ajax, then * there's no place like home */ public function execute() { $uri = self::getUri(); /** * When server is running as a RESTful server */ if (RESTFUL == '1') { RestServer::runRestMethod($uri); $this->terminate(); } /** * When it's required to be a logged user to access */ if (REQUIRE_LOGIN == '1') { $this->checkAuthenticated($uri); } /** * When the request is not running over ajax, * then call the home for full page rendering * before calling the requested method */ if (!$this->isAjax()) { $this->controller = $this->requireHome(); if (self::isLoggedIn()) { $this->controller->newModel('uid'); } $this->controller->itStarts($uri); $this->terminate(); } /** * Normal Ajax Request, call the method only */ $this->runMethod($uri); $this->terminate(); }