Commit 0fdfcb23 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Merge branch 'LDAPUsernameUID' of /mnt/ebs/repositories/subscribers/gitlab-ee

parents 3a9bda2a b215350e
......@@ -13,8 +13,8 @@ module Gitlab
def find_or_create(auth)
@auth = auth
if uid.blank? || email.blank?
raise_error("Account must provide an uid and email address")
if uid.blank? || email.blank? || username.blank?
raise_error("Account must provide a dn, uid and email address")
end
user = find(auth)
......@@ -64,6 +64,10 @@ module Gitlab
model.where(provider: provider, extern_uid: uid).last
end
def username
auth.info.nickname.to_s.force_encoding("utf-8")
end
def provider
'ldap'
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