Exemple #1
0
 /**
  * Overwrite the `run` method to check admin permissions.
  */
 public function run()
 {
     Request::init();
     if (Request::seg(0) == 'admin' && !currentUser()->isAdmin()) {
         echo show403();
         exit;
     } else {
         return parent::run();
     }
 }
Exemple #2
0
 /**
  * Process the request.
  */
 public function run()
 {
     Request::init();
     $route = Router::process();
     if ($route) {
         Kernel::process("{$this->path}/{$route}");
     } else {
         throw new NoRouteFoundException(sprintf("No route matches [%s]", Request::$pathInfo));
     }
 }