/** * Constructor */ public function __construct($source_id, $settings, $ignore_restrictions) { parent::__construct(); $this->_source_settings = $settings; $this->_source_id = $source_id; if ($source_id) { $this->_source_row = $this->EE->assets_lib->get_source_row_by_id($this->get_source_id()); } }
/** * Constructor */ public function __construct($source_id, $settings, $ignore_restrictions) { parent::__construct(); require_once PATH_THIRD . 'assets/sources/s3/lib/Assets_S3.php'; $this->s3 = new Assets_S3($settings->access_key_id, $settings->secret_access_key); $this->_source_settings = $settings; $this->_source_id = $source_id; $this->_source_row = $this->EE->assets_lib->get_source_row_by_id($this->get_source_id()); }
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; }