Example #1
0
 /**
  * Run ACL check and redirect user automatically if user doesn't have the privilege
  * 
  * @access	public
  * @param	mixed	$resource
  * @param	string	$type 
  */
 protected final function _acl($resource, $type = null)
 {
     $status = \Hybrid\Acl::access_status($resource, $type);
     switch ($status) {
         case 401:
             \Request::show_404();
             break;
     }
 }
Example #2
0
 /**
  * PHP Exception handler
  *
  * @param   Exception  $e  the exception
  * @return  bool
  */
 public static function exception_handler(\Exception $e)
 {
     if ($e instanceof Request404Exception) {
         \Request::show_404();
     }
     $severity = !isset(static::$levels[$e->getCode()]) ? $e->getCode() : static::$levels[$e->getCode()];
     logger(Fuel::L_ERROR, $severity . ' - ' . $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine());
     if (\Fuel::$env != Fuel::PRODUCTION) {
         static::show_php_error($e);
     } else {
         static::show_production_error($e);
     }
 }