Commit 1a57a1e4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch...

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
parents 68b89142 566badba
...@@ -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