# HG changeset patch # User Jittat Fakcharoenphol # Date 2010-03-06 15:21:48 # Node ID e64cd998f824afff8734e14cd0c66c7dd1fd018f # Parent 105cc0f11b687b2abb4f8794e5a7d1c1b6937859 fixed admin authorization bug in single user mode diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -33,7 +33,7 @@ # check if run in single user mode if (Configuration[SINGLE_USER_MODE_CONF_KEY]) user = User.find(session[:user_id]) - if user==nil or user.login != 'root' + if user==nil or (not user.admin?) redirect_to :controller => 'main', :action => 'login' return false end