summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2014-11-27 13:34:39 +0200
committerValery Sizov <vsv2711@gmail.com>2014-12-04 13:03:55 +0200
commit3a5ed5260b24051939575d1934ce9b8392cac09f (patch)
tree04d361e52d16234f00e5cdd27b5ebfef9a503579 /app/models/user.rb
parent1a80d13a3990937580c97e2b0ba8fb98f69bc055 (diff)
downloadgitlab-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.rb6
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