Commit aea3712e8dd71092847eeaec6f934a426d1becc0

Authored by Marin Jankovski
1 parent 26c51020

Add option for disable standard signin.

@@ -11,6 +11,7 @@ v 6.8.0 @@ -11,6 +11,7 @@ v 6.8.0
11 - Fix popen bug in `rake gitlab:satellites:create` 11 - Fix popen bug in `rake gitlab:satellites:create`
12 - Disable connection reaping for MySQL 12 - Disable connection reaping for MySQL
13 - Allow oauth signup without email for twitter and github 13 - Allow oauth signup without email for twitter and github
  14 + - Option to disable standard login
14 15
15 v 6.7.3 16 v 6.7.3
16 - Fix the merge notification email not being sent (Pierre de La Morinerie) 17 - Fix the merge notification email not being sent (Pierre de La Morinerie)
app/views/devise/sessions/new.html.haml
1 .login-box 1 .login-box
2 %h3.page-title Sign in 2 %h3.page-title Sign in
3 - - if ldap_enabled? 3 + - if ldap_enabled? && gitlab_config.signin_enabled
4 %ul.nav.nav-tabs 4 %ul.nav.nav-tabs
5 %li.active 5 %li.active
6 = link_to 'LDAP', '#tab-ldap', 'data-toggle' => 'tab' 6 = link_to 'LDAP', '#tab-ldap', 'data-toggle' => 'tab'
@@ -12,11 +12,18 @@ @@ -12,11 +12,18 @@
12 %div#tab-signin.tab-pane 12 %div#tab-signin.tab-pane
13 = render partial: 'devise/sessions/new_base' 13 = render partial: 'devise/sessions/new_base'
14 14
15 - - else 15 + - elsif ldap_enabled?
  16 + = render partial: 'devise/sessions/new_ldap'
  17 +
  18 + - elsif gitlab_config.signin_enabled
16 = render partial: 'devise/sessions/new_base' 19 = render partial: 'devise/sessions/new_base'
17 20
  21 + - else
  22 + %div
  23 + No authentication methods configured.
  24 +
18 25
19 - = render 'devise/sessions/oauth_providers' if devise_mapping.omniauthable? 26 + = render 'devise/sessions/oauth_providers' if Gitlab.config.omniauth.enabled && devise_mapping.omniauthable?
20 %hr 27 %hr
21 28
22 - if gitlab_config.signup_enabled 29 - if gitlab_config.signup_enabled
config/gitlab.yml.example
@@ -54,8 +54,12 @@ production: &base @@ -54,8 +54,12 @@ production: &base
54 54
55 55
56 ## Users management 56 ## Users management
57 - # default: false - Account passwords are not sent via the email if signup is enabled. 57 + # default: false - Account passwords are not sent via the email if signup is enabled.
58 # signup_enabled: true 58 # signup_enabled: true
  59 + #
  60 + # default: true - If set to false, standard login form won't be shown on the sign-in page
  61 + # signin_enabled: false
  62 +
59 63
60 # Restrict setting visibility levels for non-admin users. 64 # Restrict setting visibility levels for non-admin users.
61 # The default is to allow all levels. 65 # The default is to allow all levels.
config/initializers/1_settings.rb
@@ -87,6 +87,7 @@ rescue ArgumentError # no user configured @@ -87,6 +87,7 @@ rescue ArgumentError # no user configured
87 '/home/' + Settings.gitlab['user'] 87 '/home/' + Settings.gitlab['user']
88 end 88 end
89 Settings.gitlab['signup_enabled'] ||= false 89 Settings.gitlab['signup_enabled'] ||= false
  90 +Settings.gitlab['signin_enabled'] ||= true if Settings.gitlab['signin_enabled'].nil?
90 Settings.gitlab['restricted_visibility_levels'] = Settings.send(:verify_constant_array, Gitlab::VisibilityLevel, Settings.gitlab['restricted_visibility_levels'], []) 91 Settings.gitlab['restricted_visibility_levels'] = Settings.send(:verify_constant_array, Gitlab::VisibilityLevel, Settings.gitlab['restricted_visibility_levels'], [])
91 Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil? 92 Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil?
92 Settings.gitlab['issue_closing_pattern'] = '([Cc]loses|[Ff]ixes) #(\d+)' if Settings.gitlab['issue_closing_pattern'].nil? 93 Settings.gitlab['issue_closing_pattern'] = '([Cc]loses|[Ff]ixes) #(\d+)' if Settings.gitlab['issue_closing_pattern'].nil?