示例#1
0
 public function __construct($source_id, $filedir_prefs, $ignore_restrictions)
 {
     parent::__construct();
     $filedir_prefs = self::apply_filedir_overrides($filedir_prefs);
     $banned_or_guest = !$this->EE->session->userdata('member_id') or $this->EE->session->userdata('is_banned');
     $filedir_denied = in_array($source_id, self::get_denied_filedirs());
     $assets_action = in_array($this->EE->input->get_post('ACT'), Assets_helper::get_asset_action_ids());
     // Enforce restrictions, if needed
     if (!$ignore_restrictions && (REQ == 'ACTION' && $assets_action && ($banned_or_guest or $filedir_denied))) {
         header('HTTP/1.1 403 Forbidden');
         exit;
     }
     $this->_ignore_restrictions = $ignore_restrictions;
     $this->_source_id = $source_id;
     $filedir_prefs->server_path = self::resolve_server_path($filedir_prefs->server_path);
     $this->_source_settings = $filedir_prefs;
 }