1 class PicturesController < ApplicationController
2 if Manifest.manifest.magic_numbers['run_mode'] == 0
3 before_filter :authenticate_user, :only => []
4 before_filter :authenticate_author, :only => []
6 before_filter :authenticate_user, :only => []
7 before_filter :authenticate_resource_reader, :only => [
8 :show, :credit, :search
10 before_filter :authenticate_author, :only => []
12 before_filter :authenticate_admin, :only => [:index, :by_artist ]
22 def show_html_format format
31 respond_to do |format|
32 opt = {:type => @item.mime_type, :disposition=>"inline"}
33 format.png { send_data(@item.restore(params[:subdir]), opt ) }
34 format.gif { send_data(@item.restore(params[:subdir]), opt ) }
35 format.jpeg { send_data(@item.restore(params[:subdir]), opt ) }
36 show_html_format format
37 show_json_format format
38 show_prof_format format
43 @picture = Picture.show(params[:id], @operators)
45 respond_to do |format|
46 format.html { render :layout => false }
47 format.json { render :json => @picture.to_json}
52 @pictures = Picture.list_by_md5(params[:md5])
54 respond_to do |format|
56 format.json { render json: @pictures.to_json }