Skip to content
Browse files

don't resend password or username for inactive users to avoid confusion

  • Loading branch information...
1 parent ad2a7f2 commit af95968fa238ce94e1a75cde8ffe449bbf75ecb5 @bborn bborn committed
Showing with 14 additions and 5 deletions.
  1. +2 −2 app/controllers/users_controller.rb
  2. +1 −1 lang/base.yml
  3. +2 −2 lang/ui/en-US.yml
  4. +9 −0 test/functional/sessions_controller_test.rb
View
4 app/controllers/users_controller.rb
@@ -314,7 +314,7 @@ def welcome_complete
def forgot_password
return unless request.post?
- @user = User.find_by_email(params[:email])
+ @user = User.active.find_by_email(params[:email])
if @user && @user.reset_password
UserNotifier.deliver_reset_password(@user)
@user.save
@@ -328,7 +328,7 @@ def forgot_password
def forgot_username
return unless request.post?
- if @user = User.find_by_email(params[:email])
+ if @user = User.active.find_by_email(params[:email])
UserNotifier.deliver_forgot_username(@user)
redirect_to login_url
flash[:info] = :your_username_was_emailed_to_you.l
View
2 lang/base.yml
@@ -556,7 +556,7 @@
#en: sorry_there_was_an_error_requesting_friendship: Sorry, there was an error requesting friendship.
#en: sorry_there_was_an_error_uploading_the_photo: Sorry, there was an error uploading the photo.
#en: sorry_we_dont_have_any_pros_in_this_skill_category_yet: Sorry, we don't have any pros in this skill category yet.
-#en: sorry_we_dont_recognize_that_email_address: Sorry. We don't recognize that email address.
+#en: sorry_we_dont_recognize_that_email_address: "Sorry. That e-mail address is not associated with an active account. Are you sure you typed it correctly? Have you signed up and activated your account?"
#en: spread_the_word: Spread the word
#en: start_date: Start date
#en: start_time: Start time
View
4 lang/ui/en-US.yml
@@ -1129,8 +1129,8 @@ en:
sorry_there_was_an_error_uploading_the_photo: "Sorry, there was an error uploading the photo."
#en: sorry_we_dont_have_any_pros_in_this_skill_category_yet: "Sorry, we don't have any pros in this skill category yet."
sorry_we_dont_have_any_pros_in_this_skill_category_yet: "Sorry, we don't have any pros in this skill category yet."
- #en: sorry_we_dont_recognize_that_email_address: "Sorry. We don't recognize that email address."
- sorry_we_dont_recognize_that_email_address: "Sorry. We don't recognize that email address."
+ #en: sorry_we_dont_recognize_that_email_address: "Sorry. That e-mail address is not associated with an active account. Are you sure you typed it correctly? Have you signed up and activated your account?"
+ sorry_we_dont_recognize_that_email_address: "Sorry. That e-mail address is not associated with an active account. Are you sure you typed it correctly? Have you signed up and activated your account?"
#en: spread_the_word: Spread the word
spread_the_word: Spread the word
#en: start_date: Start date
View
9 test/functional/sessions_controller_test.rb
@@ -65,6 +65,15 @@ def test_should_fail_cookie_login
get :new
assert !@controller.send(:logged_in?)
end
+
+ def test_should_login_with_reset_password
+ quentin = users(:quentin)
+ quentin.reset_password
+ newpass = quentin.password
+ quentin.save!
+ post :create, :login => 'quentin', :password => newpass
+ assert session[:user]
+ end
protected
def auth_token(token)

0 comments on commit af95968

Please sign in to comment.
Something went wrong with that request. Please try again.