authlogic 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of authlogic might be problematic. Click here for more details.
- data/CHANGELOG.rdoc +6 -0
- data/README.rdoc +2 -2
- data/VERSION.yml +1 -1
- data/authlogic.gemspec +2 -2
- data/lib/authlogic/acts_as_authentic/login.rb +1 -1
- data/lib/authlogic/controller_adapters/rails_adapter.rb +13 -3
- data/lib/authlogic/session/cookies.rb +1 -1
- metadata +2 -2
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== 2.1.1 released 2009-7-04
|
2
|
+
|
3
|
+
* Use mb_chars when downcasing the login string to support international characters.
|
4
|
+
* Check for the existence of the :remember_me key before setting remember_me off of a hash.
|
5
|
+
* Added check to make sure Authlogic is not loaded too late, causing a NotActivated error.
|
6
|
+
|
1
7
|
== 2.1.0 released 2009-6-27
|
2
8
|
|
3
9
|
* Fixed bug when using act_like_restful_authentication and setting passwords, needed to add a 2nd parameter to tell if to check against the database or not.
|
data/README.rdoc
CHANGED
@@ -203,13 +203,13 @@ From rubyforge:
|
|
203
203
|
|
204
204
|
$ sudo gem install authlogic
|
205
205
|
|
206
|
-
|
206
|
+
Or from github:
|
207
207
|
|
208
208
|
$ sudo gem install binarylogic-authlogic
|
209
209
|
|
210
210
|
Now just add the gem dependency in your projects configuration.
|
211
211
|
|
212
|
-
Or you install this as a plugin
|
212
|
+
Or you can install this as a plugin:
|
213
213
|
|
214
214
|
script/plugin install git://github.com/binarylogic/authlogic.git
|
215
215
|
|
data/VERSION.yml
CHANGED
data/authlogic.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{authlogic}
|
5
|
-
s.version = "2.1.
|
5
|
+
s.version = "2.1.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Ben Johnson of Binary Logic"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-07-04}
|
10
10
|
s.email = %q{bjohnson@binarylogic.com}
|
11
11
|
s.extra_rdoc_files = [
|
12
12
|
"LICENSE",
|
@@ -118,7 +118,7 @@ module Authlogic
|
|
118
118
|
if sensitivity
|
119
119
|
send("find_by_#{field}", value)
|
120
120
|
else
|
121
|
-
first(:conditions => ["LOWER(#{quoted_table_name}.#{field}) = ?", value.downcase])
|
121
|
+
first(:conditions => ["LOWER(#{quoted_table_name}.#{field}) = ?", value.mb_chars.downcase])
|
122
122
|
end
|
123
123
|
end
|
124
124
|
end
|
@@ -3,6 +3,8 @@ module Authlogic
|
|
3
3
|
# Adapts authlogic to work with rails. The point is to close the gap between what authlogic expects and what the rails controller object
|
4
4
|
# provides. Similar to how ActiveRecord has an adapter for MySQL, PostgreSQL, SQLite, etc.
|
5
5
|
class RailsAdapter < AbstractAdapter
|
6
|
+
class AuthlogicLoadedTooLateError < StandardError; end
|
7
|
+
|
6
8
|
def authenticate_with_http_basic(&block)
|
7
9
|
controller.authenticate_with_http_basic(&block)
|
8
10
|
end
|
@@ -12,7 +14,7 @@ module Authlogic
|
|
12
14
|
end
|
13
15
|
|
14
16
|
def cookie_domain
|
15
|
-
@cookie_domain_key ||=
|
17
|
+
@cookie_domain_key ||= Rails::VERSION::STRING >= '2.3' ? :domain : :session_domain
|
16
18
|
ActionController::Base.session_options[@cookie_domain_key]
|
17
19
|
end
|
18
20
|
|
@@ -23,9 +25,17 @@ module Authlogic
|
|
23
25
|
# Lets Authlogic know about the controller object via a before filter, AKA "activates" authlogic.
|
24
26
|
module RailsImplementation
|
25
27
|
def self.included(klass) # :nodoc:
|
28
|
+
if defined?(::ApplicationController)
|
29
|
+
raise AuthlogicLoadedTooLateError.new("Authlogic is trying to prepend a before_filter in ActionController::Base to active itself" +
|
30
|
+
", the problem is that ApplicationController has already been loaded meaning the before_filter won't get copied into your" +
|
31
|
+
" application. Generally this is due to another gem or plugin requiring your ApplicationController prematurely, such as" +
|
32
|
+
" the resource_controller plugin. The solution is to require Authlogic before these other gems / plugins. Please require" +
|
33
|
+
" authlogic first to get rid of this error.")
|
34
|
+
end
|
35
|
+
|
26
36
|
klass.prepend_before_filter :activate_authlogic
|
27
37
|
end
|
28
|
-
|
38
|
+
|
29
39
|
private
|
30
40
|
def activate_authlogic
|
31
41
|
Authlogic::Session::Base.controller = RailsAdapter.new(self)
|
@@ -35,4 +45,4 @@ module Authlogic
|
|
35
45
|
end
|
36
46
|
end
|
37
47
|
|
38
|
-
ActionController::Base.send(:include, Authlogic::ControllerAdapters::RailsAdapter::RailsImplementation)
|
48
|
+
ActionController::Base.send(:include, Authlogic::ControllerAdapters::RailsAdapter::RailsImplementation)
|
@@ -57,7 +57,7 @@ module Authlogic
|
|
57
57
|
values = value.is_a?(Array) ? value : [value]
|
58
58
|
case values.first
|
59
59
|
when Hash
|
60
|
-
self.remember_me = values.first.with_indifferent_access[:remember_me]
|
60
|
+
self.remember_me = values.first.with_indifferent_access[:remember_me] if values.first.with_indifferent_access.key?(:remember_me)
|
61
61
|
else
|
62
62
|
r = values.find { |value| value.is_a?(TrueClass) || value.is_a?(FalseClass) }
|
63
63
|
self.remember_me = r if !r.nil?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authlogic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Johnson of Binary Logic
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-07-04 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|