Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-06-07 19:19:19 +0300
committerPatricio Cano <suprnova32@gmail.com>2016-06-07 19:21:20 +0300
commitc593154cb4f0215851fbbae1dde753dacbaa6713 (patch)
tree4a3a99ce032df14209eb159fc74801801ed0056d /lib/gitlab/saml
parent7038440e342a521807b1e5ffb6d47d4c0b13048d (diff)
Moved `find_or_create_ldap_user` method to parent class and added logging.
Diffstat (limited to 'lib/gitlab/saml')
-rw-r--r--lib/gitlab/saml/user.rb24
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/gitlab/saml/user.rb b/lib/gitlab/saml/user.rb
index 6f7d4825ae5..8943022612c 100644
--- a/lib/gitlab/saml/user.rb
+++ b/lib/gitlab/saml/user.rb
@@ -62,30 +62,6 @@ module Gitlab
!Gitlab::Saml::Config.external_groups.nil?
end
- def find_or_create_ldap_user
- return unless ldap_person
-
- # If a corresponding person exists with same uid in a LDAP server,
- # check if the user already has a GitLab account
- user = Gitlab::LDAP::User.find_by_uid_and_provider(ldap_person.dn, ldap_person.provider)
- if user
- # Case when a LDAP user already exists in Gitlab. Add the SAML identity to existing account.
- user.identities.build(extern_uid: auth_hash.uid, provider: auth_hash.provider)
- else
- # No account found using LDAP in Gitlab yet: check if there is a SAML account with
- # the passed uid and provider
- user = find_by_uid_and_provider
- if user.nil?
- # No SAML account found, build a new user.
- user = build_new_user
- end
- # Correct account is present, add the LDAP Identity to the user.
- user.identities.new(provider: ldap_person.provider, extern_uid: ldap_person.dn)
- end
-
- user
- end
-
def auth_hash=(auth_hash)
@auth_hash = Gitlab::Saml::AuthHash.new(auth_hash)
end