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 => [:show, :credit, :search]
8 before_filter :authenticate_author, :only => []
10 before_filter :authenticate_admin, :only => [:index, :by_artist, :count, :count_by_artist]
24 def show_html_format format
33 respond_to do |format|
34 opt = {:type => @item.mime_type, :disposition=>"inline"}
35 format.png { send_data(@item.restore(params[:subdir]), opt ) }
36 format.gif { send_data(@item.restore(params[:subdir]), opt ) }
37 format.jpeg { send_data(@item.restore(params[:subdir]), opt ) }
38 show_html_format format
39 show_json_format format
40 show_prof_format format
45 @picture = Picture.show(params[:id], @operators)
47 respond_to do |format|
48 format.html { render :layout => false }
49 format.json { render :json => @picture.to_json}
54 @pictures = Picture.list_by_md5(params[:md5])
56 respond_to do |format|
58 format.json { render json: @pictures.to_json }