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

This commit is contained in:
Jacob Vosmaer
2013-10-29 10:50:06 +00:00
+6 -2
View File
@@ -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