diff --git a/app/controllers/users.rb b/app/controllers/users.rb index 4555084..ac15242 100644 --- a/app/controllers/users.rb +++ b/app/controllers/users.rb @@ -5,8 +5,8 @@ class Users < Application include Ambethia::ReCaptcha::Controller def index - if current_user.administrator? - @users = User.find :all, :order => 'user_name ASC' + if logged_in? and current_user.administrator? + @users = User.find :all, :order => 'user_name ASC', :conditions => 'facebook_id IS NULL' render else redirect url(:user, :id => current_user.user_name) diff --git a/binaryattraction_facebooker.rb b/binaryattraction_facebooker.rb index d7897c9..5a59fa7 100755 --- a/binaryattraction_facebooker.rb +++ b/binaryattraction_facebooker.rb @@ -16,7 +16,7 @@ # # libraries used -%w(rubygems frankie active_record yaml memcache memcache_util).each do |lib| +%w(rubygems frankie mysql active_record yaml memcache memcache_util).each do |lib| require lib end # require AR models @@ -46,8 +46,9 @@ configure do log.debug "Using #{Sinatra.env} database environment" db_config = YAML::load_file(File.dirname(__FILE__) + '/config/database.yml')[Sinatra.env] ActiveRecord::Base.logger = log - ActiveRecord::Base.establish_connection db_config ActiveRecord::Base.allow_concurrency = true + ActiveRecord::Base.verification_timeout = 300 + ActiveRecord::Base.establish_connection db_config rescue => exception log.fatal "There was a problem loading the database.yml file:" exception.backtrace.each do |msg|