Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-10 03:06:44 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-10 03:06:44 +0300
commit308146dc398fd4c13453048105498018459e0985 (patch)
treed843eb63c1672e4b18c483907e2cd4aa7fca708e /app/controllers/application_controller.rb
parent4b28d5ae770c6bd332283a3f13ceae06329c409b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 01d80d77080..f5939b61948 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -26,6 +26,7 @@ class ApplicationController < ActionController::Base
before_action :add_gon_variables, unless: [:peek_request?, :json_request?]
before_action :configure_permitted_parameters, if: :devise_controller?
before_action :require_email, unless: :devise_controller?
+ before_action :active_user_check, unless: :devise_controller?
before_action :set_usage_stats_consent_flag
before_action :check_impersonation_availability
@@ -294,6 +295,14 @@ class ApplicationController < ActionController::Base
end
end
+ def active_user_check
+ return unless current_user && current_user.deactivated?
+
+ sign_out current_user
+ flash[:alert] = _("Your account has been deactivated by your administrator. Please log back in to reactivate your account.")
+ redirect_to new_user_session_path
+ end
+
def ldap_security_check
if current_user && current_user.requires_ldap_check?
return unless current_user.try_obtain_ldap_lease