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 => []
11 def show_html_format format
19 respond_to do |format|
20 opt = {:type => @item.mime_type, :disposition=>"inline"}
21 format.png { send_data(@item.restore(params[:subdir]), opt ) }
22 format.gif { send_data(@item.restore(params[:subdir]), opt ) }
23 format.jpeg { send_data(@item.restore(params[:subdir]), opt ) }
24 show_html_format format
25 show_prof_format format
26 show_json_format format
31 @picture = Picture.show(params[:id], @operators)
33 respond_to do |format|
34 format.html { render :layout => false }
35 format.json { render :json => @picture.to_json}
40 @pictures = Picture.list_by_md5(params[:md5])
42 respond_to do |format|
44 format.json { render json: @pictures.to_json }