OSDN Git Service

t#30443:add test for open mode
[pettanr/pettanr.git] / app / controllers / pictures_controller.rb
index 8e7444d..9d2966b 100644 (file)
@@ -1,7 +1,12 @@
 class PicturesController < ApplicationController
   layout 'test' if MagicNumber['test_layout']
-  before_filter :authenticate_user!, :only => [:show, :credit, :search]
-  before_filter :authenticate_author, :only => [:show, :credit, :search]
+  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