Commit 1a57a1e49fd1a14ad6b98ba6ca606064fd05c1b7

Authored by Dmitriy Zaporozhets
2 parents 68b89142 566badba

Merge branch 'use_ldap_uid_as_username_instead_of_first_part_of_email_address_on…

…_user_creation' into 'master'

Use ldap uid as username instead of first part of email address on user creation
Showing 1 changed file with 3 additions and 1 deletions   Show diff stats
lib/gitlab/oauth/user.rb
... ... @@ -34,9 +34,11 @@ module Gitlab
34 34 # In this case we generate temporary email and force user to fill it later
35 35 if user.email.blank?
36 36 user.generate_tmp_oauth_email
37   - else
  37 + elsif provider != "ldap"
38 38 # Google oauth returns email but dont return nickname
39 39 # So we use part of email as username for new user
  40 + # For LDAP, username is already set to the user's
  41 + # uid/userid/sAMAccountName.
40 42 user.username = email.match(/^[^@]*/)[0]
41 43 end
42 44  
... ...