diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-01 03:06:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-01 03:06:02 +0300 |
commit | 8078bd185fd9fce86cb5a8d9a6b6209e0c23ae44 (patch) | |
tree | 6bce184b45888ebeacc7060c84b892ecbd67a4ca /app/helpers | |
parent | 8f210aebe1d740e8ee194f171f1f33a6e1fba313 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/auth_helper.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/helpers/auth_helper.rb b/app/helpers/auth_helper.rb index 9e6fcf6a267..a9c4cfe7dcc 100644 --- a/app/helpers/auth_helper.rb +++ b/app/helpers/auth_helper.rb @@ -8,6 +8,10 @@ module AuthHelper Gitlab::Auth::LDAP::Config.enabled? end + def ldap_sign_in_enabled? + Gitlab::Auth::LDAP::Config.sign_in_enabled? + end + def omniauth_enabled? Gitlab::Auth.omniauth_enabled? end @@ -56,6 +60,16 @@ module AuthHelper auth_providers.select { |provider| form_based_provider?(provider) } end + def any_form_based_providers_enabled? + form_based_providers.any? { |provider| form_enabled_for_sign_in?(provider) } + end + + def form_enabled_for_sign_in?(provider) + return true unless provider.to_s.match?(LDAP_PROVIDER) + + ldap_sign_in_enabled? + end + def crowd_enabled? auth_providers.include? :crowd end |