X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7df2da959b583d3646b9fde606f9e74d598d4bb9..a1f5f2c608f87b7bb59a4044cd02184a47494188:/apps/workbench/app/controllers/application_controller.rb diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb index a5034fd895..12f9c70c1a 100644 --- a/apps/workbench/app/controllers/application_controller.rb +++ b/apps/workbench/app/controllers/application_controller.rb @@ -368,8 +368,18 @@ class ApplicationController < ActionController::Base end def thread_with_mandatory_api_token - thread_with_api_token do - yield + thread_with_api_token(true) do + if Thread.current[:arvados_api_token] + yield + elsif session[:arvados_api_token] + # Expired session. Clear it before refreshing login so that, + # if this login procedure fails, we end up showing the "please + # log in" page instead of getting stuck in a redirect loop. + session.delete :arvados_api_token + redirect_to_login + else + render 'users/welcome' + end end end @@ -403,7 +413,10 @@ class ApplicationController < ActionController::Base end def check_user_agreements - if current_user && !current_user.is_active && current_user.is_invited + if current_user && !current_user.is_active + if not current_user.is_invited + return render 'users/inactive' + end signatures = UserAgreement.signatures @signed_ua_uuids = UserAgreement.signatures.map &:head_uuid @required_user_agreements = UserAgreement.all.map do |ua| @@ -516,7 +529,9 @@ class ApplicationController < ActionController::Base helper_method :recent_jobs_and_pipelines def recent_jobs_and_pipelines - (Job.limit(10) | PipelineInstance.limit(10)). + in_my_folders = ['owner_uuid','in',my_folders.collect(&:uuid)] + (Job.limit(10).filter([in_my_folders]) | + PipelineInstance.limit(10).filter([in_my_folders])). sort_by do |x| x.finished_at || x.started_at || x.created_at rescue x.created_at end