Permalink
Browse files

Added comments about OpenID specifics

  • Loading branch information...
1 parent cb140c2 commit 895f26ab7d601a2d9f57c8d17ccfc4f9277cae72 @binarylogic binarylogic committed Nov 24, 2008
View
@@ -1,4 +1,6 @@
class User < ActiveRecord::Base
+ # ALL of the following code is for OpenID integration. If you are not using OpenID in your app
+ # just remove all of the following code, to the point where you User class is completely blank.
acts_as_authentic :login_field_validation_options => {:if => :openid_identifier_blank?}, :password_field_validation_options => {:if => :openid_identifier_blank?}
validate :normalize_openid_identifier
@@ -1,4 +1,6 @@
class UserSession < Authlogic::Session::Base
+ # ALL of the following code is for OpenID integration. If you are not using OpenID in your app
+ # just remove all of the following code, to the point where you UserSession class is completely blank.
attr_accessor :openid_identifier
def authenticating_with_openid?
@@ -9,6 +9,12 @@
<%= f.label :password %><br />
<%= f.password_field :password %><br />
</div>
+ <!--
+ Notice the following is for OpenID. If you are not implementing OpenID in your app, simply remove the following <div> block.
+ Also, notice the <div id="login_container"> above, those fields do not need to be wrapped in a <div>, you can remove that as well.
+ I apologize if this makes it a little confusing, I have been building this app with a number of tutorials and one of them has been
+ OpenID integration.
+ -->
<div id="openid_container"<% if @user_session.openid_identifier.blank? %> style="display: none;"<% end %>>
<%= f.label :openid_identifier, "OpenID" %> (or <%= link_to_function "login using a standard username / password", "$('login_container').toggle(); $('openid_container').toggle();" %>)<br /><br />
<%= f.text_field :openid_identifier %><br />
@@ -7,6 +7,10 @@
<%= form.label :password_confirmation %><br />
<%= form.password_field :password_confirmation %><br />
<br />
+<!--
+ The following is for OpenID integration, if you are not using OpenID in your app
+ simple remove the :openid_identifier label and field
+-->
<%= form.label :openid_identifier, "Or use OpenID instead of a standard login / password" %><br />
<%= form.text_field :openid_identifier %><br />
<br />
@@ -1,3 +1,7 @@
+<!--
+ The following is for OpenID, if you are not using OpenID in your app remove
+ the OpenID if statement and field below.
+-->
<% if @user.openid_identifier.blank? %>
<p>
<b>Login:</b>
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 895f26a

Please sign in to comment.