diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-07-30 11:50:50 +0400 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-08-06 20:03:01 +0400 |
commit | 669682686ea32a787aa9ef950388f780cfc00146 (patch) | |
tree | 586fcdc44534f1aee34ce9432cf1d8fa6d620feb /lib/gitlab | |
parent | 68a9203bcef1e44bdf72acf4cc8d4977eec79b7a (diff) |
Move LDAP timeout code to Gitlab::LDAP::Access
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/ldap/access.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitlab/ldap/access.rb b/lib/gitlab/ldap/access.rb index 4e48ff11871..62709a12942 100644 --- a/lib/gitlab/ldap/access.rb +++ b/lib/gitlab/ldap/access.rb @@ -9,6 +9,19 @@ module Gitlab end end + def self.allowed?(user) + self.open do |access| + if access.allowed?(user) + # GitLab EE LDAP code goes here + user.last_credential_check_at = Time.now + user.save + true + else + false + end + end + end + def initialize(adapter=nil) @adapter = adapter end |