Only set pending users to active on a password reset
authorTom Hughes <tom@compton.nu>
Sun, 9 May 2010 07:44:17 +0000 (08:44 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 9 May 2010 07:44:17 +0000 (08:44 +0100)
When resetting a password only activate pending users, otherwise a
confirmed user's account gets set back to active and may then get
suspended by the spam scorer.

app/controllers/user_controller.rb

index 222840a0610a60ed1117594c65e746eca7742ef5..42a50582e9831690dc66a6e21fb50e2c605e11d7 100644 (file)
@@ -129,7 +129,7 @@ class UserController < ApplicationController
         if params[:user]
           @user.pass_crypt = params[:user][:pass_crypt]
           @user.pass_crypt_confirmation = params[:user][:pass_crypt_confirmation]
-          @user.status = "active"
+          @user.status = "active" if @user.status == "pending"
           @user.email_valid = true
 
           if @user.save