X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/2ba5067fcfd30d5fad952a54ba02cc1ceb6e715c..c21aa5933a0892e27c465bd75329ddd9c08d2807:/app/controllers/application_controller.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d715c618d..8062c9fe3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -15,6 +15,16 @@ class ApplicationController < ActionController::Base session_expires_automatically redirect_to :controller => "user", :action => "suspended" + + # don't allow access to any auth-requiring part of the site unless + # the new CTs have been seen (and accept/decline chosen). + elsif !@user.terms_seen and flash[:showing_terms].nil? + flash[:notice] = t 'user.terms.you need to accept or decline' + if params[:referer] + redirect_to :controller => "user", :action => "terms", :referer => params[:referer] + else + redirect_to :controller => "user", :action => "terms", :referer => request.request_uri + end end elsif session[:token] @user = User.authenticate(:token => session[:token])