Commit 1bb804da7f3b1784dac2a6e9041216da77cb04fe

Authored by Valery Sizov
2 parents 442d5dbe 27cd6c75

Merge branch 'master' of github.com:gitlabhq/gitlabhq

@@ -16,4 +16,5 @@ Vagrantfile @@ -16,4 +16,5 @@ Vagrantfile
16 .vagrant 16 .vagrant
17 config/gitlab.yml 17 config/gitlab.yml
18 config/database.yml 18 config/database.yml
  19 +config/initializers/omniauth.rb
19 db/data.yml 20 db/data.yml
app/models/user.rb
@@ -80,7 +80,7 @@ class User < ActiveRecord::Base @@ -80,7 +80,7 @@ class User < ActiveRecord::Base
80 80
81 def self.find_for_ldap_auth(omniauth_info) 81 def self.find_for_ldap_auth(omniauth_info)
82 name = omniauth_info.name 82 name = omniauth_info.name
83 - email = omniauth_info.email 83 + email = omniauth_info.email.downcase
84 84
85 if @user = User.find_by_email(email) 85 if @user = User.find_by_email(email)
86 @user 86 @user
config/initializers/devise.rb
@@ -195,18 +195,9 @@ Devise.setup do |config| @@ -195,18 +195,9 @@ Devise.setup do |config|
195 config.sign_out_via = :delete 195 config.sign_out_via = :delete
196 196
197 # ==> OmniAuth 197 # ==> OmniAuth
198 - # Add a new OmniAuth provider. Check the wiki for more information on setting  
199 - # up on your models and hooks.  
200 - # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'  
201 -  
202 - #config.omniauth :ldap,  
203 - # :host => 'YOUR_LDAP_SERVER',  
204 - # :base => 'THE_BASE_WHERE_YOU_SEARCH_FOR_USERS',  
205 - # :uid => 'sAMAccountName',  
206 - # :port => 389,  
207 - # :method => :plain,  
208 - # :bind_dn => 'THE_FULL_DN_OF_THE_USER_YOU_WILL_BIND_WITH',  
209 - # :password => 'THE_PASSWORD_OF_THE_BIND_USER' 198 + # To configure a new OmniAuth provider copy and edit omniauth.rb.sample
  199 + # selecting the provider you require.
  200 + # Check the wiki for more information on setting up on your models
210 201
211 # ==> Warden configuration 202 # ==> Warden configuration
212 # If you want to use other strategies, that are not supported by Devise, or 203 # If you want to use other strategies, that are not supported by Devise, or
config/initializers/omniauth.rb.sample 0 → 100644
@@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
  1 +# Copy this file to 'omniauth.rb' and configure it as necessary.
  2 +# The wiki has further details on configuring each provider.
  3 +
  4 +Devise.setup do |config|
  5 + # config.omniauth :github 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
  6 +
  7 + # config.omniauth :ldap,
  8 + # :host => 'YOUR_LDAP_SERVER',
  9 + # :base => 'THE_BASE_WHERE_YOU_SEARCH_FOR_USERS',
  10 + # :uid => 'sAMAccountName',
  11 + # :port => 389,
  12 + # :method => :plain,
  13 + # :bind_dn => 'THE_FULL_DN_OF_THE_USER_YOU_WILL_BIND_WITH',
  14 + # :password => 'THE_PASSWORD_OF_THE_BIND_USER'
  15 +end
0 \ No newline at end of file 16 \ No newline at end of file