OSDN Git Service

t#30328:create op import ...and pull
[pettanr/pettanr.git] / app / controllers / pictures_controller.rb
index 7cfaf3c..9d2966b 100644 (file)
@@ -1,8 +1,12 @@
 class PicturesController < ApplicationController
   layout 'test' if MagicNumber['test_layout']
-  before_filter :authenticate_user!, :only => [:show, :credit, :md5]
-  before_filter :authenticate_author, :only => [:show, :credit, :md5]
-  before_filter :authenticate_artist, :only => [:md5]
+  if MagicNumber['run_mode'] == 0
+    before_filter :authenticate_user!, :only => []
+    before_filter :authenticate_author, :only => []
+  else
+    before_filter :authenticate_user!, :only => [:show, :credit, :search]
+    before_filter :authenticate_author, :only => [:show, :credit, :search]
+  end
   before_filter :authenticate_admin!, :only => [:list, :browse]
   
   def show
@@ -27,7 +31,7 @@ class PicturesController < ApplicationController
     end
   end
   
-  def md5
+  def search
     @pictures = Picture.list_by_md5(params[:md5])
     
     respond_to do |format|