]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Add <title> to /blocks and don't Camel Case headings
[rails.git] / app / controllers / application_controller.rb
index 6dbe9165ca2593b20f5fff3c7e6c46f7469016e6..c701d8adde71093f37b9f927c1e8b228e4d5bbc6 100644 (file)
@@ -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