Commit 6d65afb3c44a989f5b80353a213f40895a9c1c45
Exists in
spb-stable
and in
2 other branches
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
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 | ... | ... |