socialcast_ldap_integration 1.1.14 → 1.1.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -187,8 +187,10 @@ module Socialcast
187
187
  matched_account = nil
188
188
 
189
189
  self.connect do |ldap, connection|
190
- map = connection['map']
191
- ldap.search(self.construct_filter_for_search(connection, nil, "#{map[identifying_field]}=#{identifier}")) do |entry, connection|
190
+ map = connection["map"]
191
+ base = discover_base_dn(map[identifying_field], identifier)
192
+ filter = self.construct_filter_for_search(connection, nil, "#{map[identifying_field]}=#{identifier}")
193
+ ldap.search(:base => base, :filter => filter[:filter]) do |entry, connection|
192
194
  matched_account = entry
193
195
  end
194
196
  if matched_account
@@ -202,10 +204,12 @@ module Socialcast
202
204
 
203
205
  nil
204
206
  end
205
-
206
207
 
207
208
  protected
208
209
 
210
+ # TODO: this method currently returns a hash, but the Net::LDAP
211
+ # search method expects :filter to be a Net::LDAP::Filter object.
212
+ # Should we change the method to match this expectation?
209
213
  def self.construct_filter_for_search(connection, filter_options=nil, auxiliary_filter=nil)
210
214
  unless filter_options
211
215
  search_filter = connection['filter_string'].blank? ? NULL_FILTER : Net::LDAP::Filter.construct(connection['filter_string'])
@@ -1,5 +1,5 @@
1
1
  module Socialcast
2
2
  module LdapIntegration
3
- VERSION = "1.1.14"
3
+ VERSION = "1.1.15"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socialcast_ldap_integration
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.14
4
+ version: 1.1.15
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-09-14 00:00:00.000000000 Z
14
+ date: 2012-09-27 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: socialcast-net-ldap
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  version: '0'
93
93
  requirements: []
94
94
  rubyforge_project: socialcast_ldap_integration
95
- rubygems_version: 1.8.24
95
+ rubygems_version: 1.8.21
96
96
  signing_key:
97
97
  specification_version: 3
98
98
  summary: Provides support for connecting to and traversing LDAP trees.