Skip to content

Commit

Permalink
Add support for auto-activation
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanholstyn committed Jan 27, 2008
1 parent 068b2a2 commit 9ccce73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/login_controller.rb
Expand Up @@ -33,6 +33,7 @@ def acts_as_login_controller( options = {} )
:signup_flash => "Please signup",
:successful_signup_flash => "You have successfully signed up",
:allow_signup => false,
:require_activation => false
:reminder_flash => "Please enter the email address of the account whose information you would like to retrieve",
:reminder_error_flash => "The email address you entered was not found",
:reminder_success_flash => "Please check your email to retrieve your account information",
Expand Down Expand Up @@ -228,7 +229,7 @@ module SignupInstanceMethods
def signup
instance_variable_set( "@#{self.class.login_model_name}", model = self.class.login_model.new( params[self.class.login_model_name.to_sym] ) )
if request.post?
model.active = false
model.active = self.class.lwt_authentication_system_options[:require_activation] ? false : true
if model.save
reminder = UserReminder.create_for_user( model, Time.now + self.class.lwt_authentication_system_options[:reminder_login_duration] )
url = url_for(:action => 'login', :id => model, :token => reminder.token)
Expand Down

0 comments on commit 9ccce73

Please sign in to comment.