各位大哥,小弟新手,,写个计数器出现问题- ChinaonRails
楼主
def login

@records = YAML.load_file(RAILS_ROOT + "/config/config.yml")
session[:errorCount] = 0
unless request.get?
account = params[:member][:account]
password = Digest::MD5.hexdigest(params[:member][:password])
if account.to_s.empty?
render :text => "Account can not be empty."
elsif password.to_s.empty?
render :text => "Password can not be empty."
else
if account.to_s.include?('@')
@member = Member.find(:first,:conditions => ["email = ? and password =?",account,password])
else
@member = Member.find(:first,:conditions => ["account = ? and password =?",account,password])
end
unless @member.to_s.empty?
unless @member.iflock?
session[:account] = account
@member.lastlogintime = Time.now
require 'socket'
ip=IPSocket.getaddress(Socket.gethostname)
@member.ip= ip
@member.save
type = @member.membertype_id
if type.eql?(2)

redirect_to :action => "adminindex"
else
redirect_to :action => "memberindex"
end
else
render :text => "Account Locked."
end

else
session[:errorCount] = (session[:errorCount].to_s).to_i()+1
flash[:notice] = 'Account or Password may be Mistake.'
end
end
end
end

请帮忙看下,为什么errorCount只会加一次啊


? 2006-2009 A Production   -      -   
a
郑重声明:资讯 【各位大哥,小弟新手,,写个计数器出现问题- ChinaonRails】由 发布,版权归原作者及其所在单位,其原创性以及文中陈述文字和内容未经(企业库qiyeku.com)证实,请读者仅作参考,并请自行核实相关内容。若本文有侵犯到您的版权, 请你提供相关证明及申请并与我们联系(qiyeku # qq.com)或【在线投诉】,我们审核后将会尽快处理。
—— 相关资讯 ——