devise_active_directory_authenticatable 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{devise_active_directory_authenticatable}
8
- s.version = "0.4.0"
8
+ s.version = "0.4.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Adam Kerr"]
@@ -19,29 +19,29 @@ module Devise
19
19
 
20
20
  # Update the attributes of the current object from the AD
21
21
  # Defaults to current user if no parameters given
22
- def activedirectory_sync! params = {}
23
- params[:objectguid] = self.objectguid if params.empty?
24
- @ad_obj ||= params[:object] || klass.find_activedirectory_objs(params).first
25
- copy_from_activedirectory @ad_obj unless @ad_obj.nil?
26
- update_memberships
27
- end
22
+ # def activedirectory_sync! params = {}
23
+ # params[:objectguid] = self.objectguid if params.empty?
24
+ # @ad_obj ||= params[:object] || klass.find_activedirectory_objs(params).first
25
+
26
+ # attr_map.each do |local_attr, active_directory_attr|
27
+ # self[local_attr] = @ad_obj[active_directory_attr]
28
+ # end
29
+
30
+ # update_memberships
31
+ # end
28
32
 
29
33
  # Update the attributes of the current object from the AD
30
34
  # Defaults to current user if no parameters given
31
35
  def copy_from_activedirectory! params = {}
32
- #Allows for caching, object, or AD search
33
- params[:objectguid] = self[:objectguid] if params.empty?
34
- @ad_obj ||= params[:object] || klass.find_activedirectory_objs(params).first
35
- copy_from_activedirectory @ad_obj unless @ad_obj.nil?
36
- # update_memberships
37
- end
38
-
36
+ #Allows us to change what ad object is bound to this user
37
+ @ad_obj = klass.find_activedirectory_objs(params).first unless params.empty?
39
38
 
39
+ unless @ad_obj.nil?
40
+ attr_map.each do |local_attr, active_directory_attr|
41
+ self[local_attr] = @ad_obj[active_directory_attr]
42
+ end
40
43
 
41
- # Update the local object using an Active Directory entry
42
- def copy_from_activedirectory ad_obj
43
- attr_map.each do |local_attr, active_directory_attr|
44
- self[local_attr] = ad_obj[active_directory_attr]
44
+ update_memberships
45
45
  end
46
46
  end
47
47
 
@@ -20,6 +20,7 @@ module Devise
20
20
  # Login event handler. Triggered after authentication.
21
21
  # Maybe
22
22
  def login
23
+ update_parents
23
24
  super if defined? super
24
25
  end
25
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_active_directory_authenticatable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: devise
17
- requirement: &2153561640 !ruby/object:Gem::Requirement
17
+ requirement: &2160174660 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 1.1.5
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2153561640
25
+ version_requirements: *2160174660
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: active_directory
28
- requirement: &2153561160 !ruby/object:Gem::Requirement
28
+ requirement: &2160174180 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: 1.5.1
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2153561160
36
+ version_requirements: *2160174180
37
37
  description: Active Directory authentication module for Devise, based off of LDAP
38
38
  Authentication
39
39
  email: ajrkerr@gmail.com