diff options
author | Marin Jankovski <marin@gitlab.com> | 2014-04-07 19:11:06 +0400 |
---|---|---|
committer | Marin Jankovski <marin@gitlab.com> | 2014-04-07 19:11:06 +0400 |
commit | aea3712e8dd71092847eeaec6f934a426d1becc0 (patch) | |
tree | 3b4623645b826e06d311b5dcd977a539afbfc1c2 | |
parent | 26c5102002ac78bb328e11a2f273800e853b3fa9 (diff) |
Add option for disable standard signin.
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/views/devise/sessions/new.html.haml | 13 | ||||
-rw-r--r-- | config/gitlab.yml.example | 6 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 1 |
4 files changed, 17 insertions, 4 deletions
diff --git a/CHANGELOG b/CHANGELOG index f0a72710a92..2718a5d268b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,7 @@ v 6.8.0 - Fix popen bug in `rake gitlab:satellites:create` - Disable connection reaping for MySQL - Allow oauth signup without email for twitter and github + - Option to disable standard login v 6.7.3 - Fix the merge notification email not being sent (Pierre de La Morinerie) diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index bb87d9ecb4a..31221ae9c37 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,6 +1,6 @@ .login-box %h3.page-title Sign in - - if ldap_enabled? + - if ldap_enabled? && gitlab_config.signin_enabled %ul.nav.nav-tabs %li.active = link_to 'LDAP', '#tab-ldap', 'data-toggle' => 'tab' @@ -12,11 +12,18 @@ %div#tab-signin.tab-pane = render partial: 'devise/sessions/new_base' - - else + - elsif ldap_enabled? + = render partial: 'devise/sessions/new_ldap' + + - elsif gitlab_config.signin_enabled = render partial: 'devise/sessions/new_base' + - else + %div + No authentication methods configured. + - = render 'devise/sessions/oauth_providers' if devise_mapping.omniauthable? + = render 'devise/sessions/oauth_providers' if Gitlab.config.omniauth.enabled && devise_mapping.omniauthable? %hr - if gitlab_config.signup_enabled diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index d9ac1c02ef5..3b1427cba70 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -54,8 +54,12 @@ production: &base ## Users management - # default: false - Account passwords are not sent via the email if signup is enabled. + # default: false - Account passwords are not sent via the email if signup is enabled. # signup_enabled: true + # + # default: true - If set to false, standard login form won't be shown on the sign-in page + # signin_enabled: false + # Restrict setting visibility levels for non-admin users. # The default is to allow all levels. diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 70ba26cea7a..ce672372a3d 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -87,6 +87,7 @@ rescue ArgumentError # no user configured '/home/' + Settings.gitlab['user'] end Settings.gitlab['signup_enabled'] ||= false +Settings.gitlab['signin_enabled'] ||= true if Settings.gitlab['signin_enabled'].nil? Settings.gitlab['restricted_visibility_levels'] = Settings.send(:verify_constant_array, Gitlab::VisibilityLevel, Settings.gitlab['restricted_visibility_levels'], []) Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil? Settings.gitlab['issue_closing_pattern'] = '([Cc]loses|[Ff]ixes) #(\d+)' if Settings.gitlab['issue_closing_pattern'].nil? |