Permalink
Browse files

fixed typo, improoved a logic a bit

  • Loading branch information...
dmitryme committed Nov 13, 2008
1 parent e64a44b commit cc565e79dbfc85f746884dfb530263f02bd7c3c7
Showing with 12 additions and 4 deletions.
  1. +12 −4 app/controllers/users_controller.rb
@@ -45,8 +45,12 @@ def create
@user.name=@user.login
success = @user && @user.save
if success && @user.errors.empty?
- flash[:notice] = "Thanks for signing up! We're sending you an email with your activation code."
- flash[:error] = "<a href='#{HOST}/activate/#{@user.activation_code}'>Click here to activate<a>" if(SHOW_ACTIVATION_LINK)
+ if(SHOW_ACTIVATION_LINK)
+ flash[:notice] = "<a href='#{HOST}/activate/#{@user.activation_code}'>Click here to activate</a>"
+ else
+ flash[:notice] = "Thanks for signing up! We're sending you an email with your activation code."
+ end
+
redirect_to home_path
else
flash[:error] = "We couldn't set up that account, sorry. Please try again, or contact an admin (link is above)."
@@ -118,8 +122,12 @@ def forgot_password
if @user = User.find_by_email(params[:user][:email])
@user.forgot_password
@user.save
- flash[:notice] = "A password reset link has been sent to your email address"
- flash[:error] = "<a href='#{HOST}/reset_password/#{@user.password_reset_code}'>Click here to reset<a>" if(SHOW_ACTIVATION_LINK)
+ if(SHOW_ACTIVATION_LINK)
+ flash[:notice] = "<a href='#{HOST}/reset_password/#{@user.password_reset_code}'>Click here to reset</a>"
+ else
+ flash[:notice] = "A password reset link has been sent to your email address"
+ end
+
redirect_to :controller => "sessions", :action => "new"
else

0 comments on commit cc565e7

Please sign in to comment.