diff options
author | Valery Sizov <vsv2711@gmail.com> | 2014-11-27 13:34:39 +0200 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2014-12-04 13:03:55 +0200 |
commit | 3a5ed5260b24051939575d1934ce9b8392cac09f (patch) | |
tree | 04d361e52d16234f00e5cdd27b5ebfef9a503579 /app/models/user.rb | |
parent | 1a80d13a3990937580c97e2b0ba8fb98f69bc055 (diff) | |
download | gitlab-ce-3a5ed5260b24051939575d1934ce9b8392cac09f.tar.gz |
Supporting for multiple omniauth provider for the same user
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 0cf0946593c..7faeef1b5b0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -406,7 +406,11 @@ class User < ActiveRecord::Base end def ldap_user? - extern_uid && provider.start_with?('ldap') + identities.exists?(["provider LIKE ? AND extern_uid IS NOT NULL", "ldap%"]) + end + + def ldap_identity + @ldap_identity ||= identities.find_by(["provider LIKE ?", "ldap%"]) end def accessible_deploy_keys |