From d043a1fb9d44d23bd49188ec3da2d0e20bd13f75 Mon Sep 17 00:00:00 2001 From: fanqiang <316257774@qq.com> Date: Tue, 27 Aug 2013 22:15:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=8F=90=E7=A4=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 9 ++++++++- config/locales/zh.yml | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index f89e9a4d..879c61c0 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -176,9 +176,11 @@ class AccountController < ApplicationController def password_authentication user = User.try_to_login(params[:username], params[:password]) - + if user.nil? invalid_credentials + elsif user.status == 2 + invalid_credentials_new elsif user.new_record? onthefly_creation_failed(user, {:login => user.login, :auth_source_id => user.auth_source_id }) else @@ -268,6 +270,11 @@ class AccountController < ApplicationController logger.warn "Failed login for '#{params[:username]}' from #{request.remote_ip} at #{Time.now.utc}" flash.now[:error] = l(:notice_account_invalid_creditentials) end + + def invalid_credentials_new + logger.warn "Failed login for '#{params[:username]}' from #{request.remote_ip} at #{Time.now.utc}" + flash.now[:error] = l(:notice_account_invalid_creditentials_new) + end # Register a user for email activation. # diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 99ad35e0..668211e1 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -150,6 +150,7 @@ zh: notice_account_updated: 帐号更新成功 notice_account_invalid_creditentials: 无效的用户名或密码 + notice_account_invalid_creditentials_new: 您还未到邮箱激活 notice_account_password_updated: 密码更新成功 notice_account_wrong_password: 密码错误 notice_account_register_done: 帐号创建成功,请使用注册确认邮件中的链接来激活您的帐号。