Commit 1e8ed9d51454df4d18ace7c89d41d79121135743

Authored by Dmitriy Zaporozhets
2 parents 7f148385 7f2551ac

Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq

CHANGELOG
... ... @@ -12,6 +12,7 @@ v 6.8.0
12 12 - Disable connection reaping for MySQL
13 13 - Allow oauth signup without email for twitter and github
14 14 - Fix faulty namespace names that caused 500 on user creation
  15 + - Option to disable standard login
15 16  
16 17 v 6.7.3
17 18 - Fix the merge notification email not being sent (Pierre de La Morinerie)
... ...
app/views/devise/sessions/new.html.haml
1 1 .login-box
2 2 %h3.page-title Sign in
3   - - if ldap_enabled?
  3 + - if ldap_enabled? && gitlab_config.signin_enabled
4 4 %ul.nav.nav-tabs
5 5 %li.active
6 6 = link_to 'LDAP', '#tab-ldap', 'data-toggle' => 'tab'
... ... @@ -12,11 +12,18 @@
12 12 %div#tab-signin.tab-pane
13 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 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 27 %hr
21 28  
22 29 - if gitlab_config.signup_enabled
... ...
config/gitlab.yml.example
... ... @@ -54,8 +54,12 @@ production: &base
54 54  
55 55  
56 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 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 64 # Restrict setting visibility levels for non-admin users.
61 65 # The default is to allow all levels.
... ...
config/initializers/1_settings.rb
... ... @@ -87,6 +87,7 @@ rescue ArgumentError # no user configured
87 87 '/home/' + Settings.gitlab['user']
88 88 end
89 89 Settings.gitlab['signup_enabled'] ||= false
  90 +Settings.gitlab['signin_enabled'] ||= true if Settings.gitlab['signin_enabled'].nil?
90 91 Settings.gitlab['restricted_visibility_levels'] = Settings.send(:verify_constant_array, Gitlab::VisibilityLevel, Settings.gitlab['restricted_visibility_levels'], [])
91 92 Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil?
92 93 Settings.gitlab['issue_closing_pattern'] = '([Cc]loses|[Ff]ixes) #(\d+)' if Settings.gitlab['issue_closing_pattern'].nil?
... ...