Sha256: 848d624fef1f08fbb85b897d9c046bb5a6891c233abe7a00705cd738595512d2

Contents?: true

Size: 728 Bytes

Versions: 19

Compression:

Stored size: 728 Bytes

Contents

module Pageflow
  class FilesController < Pageflow::ApplicationController
    include PublicHttpsMode
    include EntryPasswordProtection

    before_filter :check_public_https_mode

    def show
      respond_to do |format|
        format.html do
          entry = PublishedEntry.find(params[:entry_id], entry_request_scope)
          @file = entry.find_file(file_type.model, params[:id])

          check_entry_password_protection(entry)
        end
      end
    end

    protected

    def file_type
      @file_type ||= Pageflow.config.file_types.find_by_collection_name!(params[:collection_name])
    end

    def entry_request_scope
      Pageflow.config.public_entry_request_scope.call(Entry, request)
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
pageflow-12.6.0 app/controllers/pageflow/files_controller.rb
pageflow-12.5.0 app/controllers/pageflow/files_controller.rb
pageflow-12.4.1 app/controllers/pageflow/files_controller.rb
pageflow-12.4.0 app/controllers/pageflow/files_controller.rb
pageflow-12.3.0 app/controllers/pageflow/files_controller.rb
pageflow-12.2.0 app/controllers/pageflow/files_controller.rb
pageflow-12.1.0 app/controllers/pageflow/files_controller.rb
pageflow-12.0.4 app/controllers/pageflow/files_controller.rb
pageflow-12.0.3 app/controllers/pageflow/files_controller.rb
pageflow-12.0.2 app/controllers/pageflow/files_controller.rb
pageflow-12.0.1 app/controllers/pageflow/files_controller.rb
pageflow-12.0.0 app/controllers/pageflow/files_controller.rb
pageflow-12.0.0.rc7 app/controllers/pageflow/files_controller.rb
pageflow-12.0.0.rc6 app/controllers/pageflow/files_controller.rb
pageflow-12.0.0.rc5 app/controllers/pageflow/files_controller.rb
pageflow-12.0.0.rc4 app/controllers/pageflow/files_controller.rb
pageflow-12.0.0.rc3 app/controllers/pageflow/files_controller.rb
pageflow-12.0.0.rc2 app/controllers/pageflow/files_controller.rb
pageflow-12.0.0.rc1 app/controllers/pageflow/files_controller.rb