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]
20 def show_html_format format
29 respond_to do |format|
30 opt = {:type => @item.mime_type, :disposition=>"inline"}
31 format.png { send_data(@item.restore(params[:subdir]), opt ) }
32 format.gif { send_data(@item.restore(params[:subdir]), opt ) }
33 format.jpeg { send_data(@item.restore(params[:subdir]), opt ) }
34 show_html_format format
35 show_json_format format
36 show_prof_format format
41 @picture = Picture.show(params[:id], @operators)
43 respond_to do |format|
44 format.html { render :layout => false }
45 format.json { render :json => @picture.to_json}
50 @pictures = Picture.list_by_md5(params[:md5])
52 respond_to do |format|
54 format.json { render json: @pictures.to_json }