Permalink
Browse files

Update for Authlogic 1.3.0

  • Loading branch information...
binarylogic committed Nov 21, 2008
1 parent 847ac88 commit eb0d4def5f6116c1fb2c8d4e4ee87c26265297fa
Showing with 12 additions and 9 deletions.
  1. +1 −1 app/controllers/application.rb
  2. +6 −3 app/models/user.rb
  3. +2 −2 app/views/users/_form.erb
  4. +3 −3 config/environment.rb
@@ -4,7 +4,7 @@
class ApplicationController < ActionController::Base
helper :all
helper_method :current_user_session, :current_user
- filter_parameter_logging :password, :confirm_password
+ filter_parameter_logging :password, :password_confirmation
private
def current_user_session
View
@@ -1,11 +1,14 @@
class User < ActiveRecord::Base
- acts_as_authentic :allow_blank_login_and_password_fields => true
+ acts_as_authentic :login_field_validation_options => {:if => :openid_identifier_blank?}, :password_field_validation_options => {:if => :openid_identifier_blank?}
- validates_presence_of :login, :if => Proc.new { |user| user.openid_identifier.blank? }
- validates_presence_of :password, :if => Proc.new { |user| user.openid_identifier.blank? }
validate :normalize_openid_identifier
validates_uniqueness_of :openid_identifier, :allow_blank => true
+ # For acts_as_authentic configuration
+ def openid_identifier_blank?
+ openid_identifier.blank?
+ end
+
def deliver_password_reset_instructions!
reset_perishable_token!
Notifier.deliver_password_reset_instructions(self)
@@ -4,8 +4,8 @@
<%= form.label :password, form.object.new_record? ? nil : "Change password" %><br />
<%= form.password_field :password %><br />
<br />
-<%= form.label :confirm_password%><br />
-<%= form.password_field :confirm_password %><br />
+<%= form.label :password_confirmation %><br />
+<%= form.password_field :password_confirmation %><br />
<br />
<%= form.label :openid_identifier, "Or use OpenID instead of a standard login / password" %><br />
<%= form.text_field :openid_identifier %><br />
View
@@ -25,14 +25,14 @@
# config.gem "bj"
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
# config.gem "aws-s3", :lib => "aws/s3"
- config.gem "authlogic"
+ #config.gem "authlogic"
# Only load the plugins named here, in the order given. By default, all plugins
# in vendor/plugins are loaded in alphabetical order.
# :all can be used as a placeholder for all plugins not explicitly named
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
- #config.plugin_paths += ["#{RAILS_ROOT}/../../Libs"]
- #config.plugins = [:authlogic, :open_id_authentication]
+ config.plugin_paths += ["#{RAILS_ROOT}/../../Libs"]
+ config.plugins = [:authlogic, :open_id_authentication]
# Add additional load paths for your own custom dirs
# config.load_paths += %W( #{RAILS_ROOT}/extras )

0 comments on commit eb0d4de

Please sign in to comment.