登录提示bug
This commit is contained in:
parent
7350b692d5
commit
d043a1fb9d
|
@ -179,6 +179,8 @@ class AccountController < ApplicationController
|
|||
|
||||
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
|
||||
|
@ -269,6 +271,11 @@ class AccountController < ApplicationController
|
|||
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.
|
||||
#
|
||||
# Pass a block for behavior when a user fails to save
|
||||
|
|
|
@ -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: 帐号创建成功,请使用注册确认邮件中的链接来激活您的帐号。
|
||||
|
|
Loading…
Reference in New Issue