devise_w3_authenticatable 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.3.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{devise_w3_authenticatable}
8
- s.version = "0.2.2"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Rodrigo Navarro"]
12
- s.date = %q{2010-08-30}
12
+ s.date = %q{2010-09-01}
13
13
  s.description = %q{Devise strategy to authenticate against IBM w3 LDAP directory.}
14
14
  s.email = %q{reu@rnavarro.com.br}
15
15
  s.files = [
@@ -4,6 +4,8 @@ require 'devise'
4
4
  require 'devise_w3_authenticatable/schema'
5
5
  require 'devise_w3_authenticatable/w3_adapter'
6
6
 
7
+ require 'active_support'
8
+
7
9
  # Add w3_authenticatable strategy to defaults.
8
10
  Devise.add_module(:w3_authenticatable,
9
11
  :strategy => true,
@@ -12,4 +14,7 @@ Devise.add_module(:w3_authenticatable,
12
14
  :model => 'devise_w3_authenticatable/model')
13
15
 
14
16
  module DeviseW3Authenticatable
17
+ # Should we create the user on the local database?
18
+ mattr_accessor :auto_create_user
19
+ @@auto_create_user = true
15
20
  end
@@ -18,7 +18,11 @@ module Devise
18
18
 
19
19
  module ClassMethods
20
20
  def find_for_w3_authentication(conditions={})
21
- find_or_initialize_by_email(conditions[:email])
21
+ if DeviseW3Authenticatable.auto_create_user
22
+ find_or_initialize_by_email(conditions[:email])
23
+ else
24
+ find_by_email(conditions[:email])
25
+ end
22
26
  end
23
27
  end
24
28
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 2
8
- - 2
9
- version: 0.2.2
7
+ - 3
8
+ - 0
9
+ version: 0.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Rodrigo Navarro
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-30 00:00:00 -03:00
17
+ date: 2010-09-01 00:00:00 -03:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency