コード例 #1
0
ファイル: Kernel.php プロジェクト: nirix/traq-lite
 /**
  * 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();
     }
 }
コード例 #2
0
ファイル: AppKernel.php プロジェクト: nirix/unframework
 /**
  * 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));
     }
 }