X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/0d5be22cb517ebaaab5eb7af13150bf61e41df56..77851bac7bf76473de33b7bbab00bc1b3d834cb1:/app/controllers/application_controller.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6dbe9165c..c701d8add 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -78,6 +78,12 @@ class ApplicationController < ActionController::Base @user = User.authenticate(:username => username, :password => passwd) # basic auth end end + + # check if the user has been banned + unless @user.nil? or @user.active_blocks.empty? + # NOTE: need slightly more helpful message than this. + render :text => t('application.setup_user_auth.blocked'), :status => :forbidden + end end def authorize(realm='Web Password', errormessage="Couldn't authenticate you") @@ -174,6 +180,8 @@ class ApplicationController < ActionController::Base rescue OSM::APIError => ex report_error ex.message, ex.status rescue Exception => ex + logger.info("API threw unexpected #{ex.class} exception: #{ex.message}") + ex.backtrace.each { |l| logger.info(l) } report_error "#{ex.class}: #{ex.message}", :internal_server_error end end