Commit 6d65afb3 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce

parents 8b05490f 1a57a1e4
...@@ -34,9 +34,11 @@ module Gitlab ...@@ -34,9 +34,11 @@ module Gitlab
# In this case we generate temporary email and force user to fill it later # In this case we generate temporary email and force user to fill it later
if user.email.blank? if user.email.blank?
user.generate_tmp_oauth_email user.generate_tmp_oauth_email
else elsif provider != "ldap"
# Google oauth returns email but dont return nickname # Google oauth returns email but dont return nickname
# So we use part of email as username for new user # 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] user.username = email.match(/^[^@]*/)[0]
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment