OSDN Git Service

fix test
[pettanr/pettanr.git] / app / controllers / application_controller.rb
index 00f2d46..4eb49ec 100644 (file)
@@ -23,39 +23,32 @@ class ApplicationController < ActionController::Base
       :location => {:controller => params[:controller], :action => params[:action]}
     }
     @server_result[:location][:id] = params[:id] if params[:id]
-    if Admin.count.to_i == 0 or License.count.to_i == 0
-      if params[:controller] == 'system' and params[:action] == 'start'
-      else
-        redirect_to :controller => '/system', :action => 'start'
-      end
+    user = if user_signed_in?
+      current_user
     else
-      user = if user_signed_in?
-        current_user
-      else
-        nil
-      end
-      author = if user
-        user.author
-      else
-        nil
-      end
-      artist = if user
-        user.artist
-      else
-        nil
-      end
-      admin = if admin_signed_in?
-        current_admin
-      else
-        nil
-      end
-      demand_user = if demand_user_signed_in?
-        current_demand_user
-      else
-        nil
-      end
-      @operators = Operator.new [user, author, artist, admin, demand_user]
+      nil
+    end
+    author = if user
+      user.author
+    else
+      nil
+    end
+    artist = if user
+      user.artist
+    else
+      nil
+    end
+    admin = if admin_signed_in?
+      current_admin
+    else
+      nil
+    end
+    demand_user = if demand_user_signed_in?
+      current_demand_user
+    else
+      nil
     end
+    @operators = Operator.new [user, author, artist, admin, demand_user]
   end
   
   def authenticate_reader