Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-13 12:38:18 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-13 12:38:18 +0400
commit6d65afb3c44a989f5b80353a213f40895a9c1c45 (patch)
tree0f195acefed8f45286618099a952922893efa3b4
parent8b05490f37336bdbb68bd59966ef229ce3492007 (diff)
parent1a57a1e49fd1a14ad6b98ba6ca606064fd05c1b7 (diff)
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
-rw-r--r--lib/gitlab/oauth/user.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/oauth/user.rb b/lib/gitlab/oauth/user.rb
index 7f1d1cd6532..d154bd8600b 100644
--- a/lib/gitlab/oauth/user.rb
+++ b/lib/gitlab/oauth/user.rb
@@ -34,9 +34,11 @@ module Gitlab
# In this case we generate temporary email and force user to fill it later
if user.email.blank?
user.generate_tmp_oauth_email
- else
+ elsif provider != "ldap"
# Google oauth returns email but dont return nickname
# So we use part of email as username for new user
+ # For LDAP, username is already set to the user's
+ # uid/userid/sAMAccountName.
user.username = email.match(/^[^@]*/)[0]
end