Commit 566badba authored by Julien Pivotto's avatar Julien Pivotto
Browse files

Use uid as username when creating user with LDAP

Without that commit, each user created by a LDAP login would have the
first part of their email address as nickname.

This is not useful for LDAP, where a uid attribute is already set.
parent ba10d7040f20
......@@ -34,9 +34,11 @@ def create(auth)
# In this case we generate temporary email and force user to fill it later
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]
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