If you are just trying to restrict or prevent login after five times
of failure its really no need to create a database for it. but use
cookies and put some values in it and set the time when it will
expire. after that a if statement that will redirect the user into
other page or just use a disable attribute of a form.

but since you use table for it. maybe to make sure that even if the
client clear its cache the user cant login again.

you said you already have the times of failure then just put a if
statement  for it.

On Jan 6, 4:08 pm, Colin Law <clan...@googlemail.com> wrote:
> On 6 January 2012 01:22, Daisy Di <li...@ruby-forum.com> wrote:
>
>
>
>
>
>
>
>
>
> > Colin Law wrote in post #1039527:
> >> On 5 January 2012 09:47, Daisy Di <li...@ruby-forum.com> wrote:
> >>> Hi all
> >>> i have two table,member and failed_times,the member table is designed by
> >>> customer which i cant modify anything, but the failed_times is created
> >>> by myself.the columns in the failed_times are id,mbr_id,times, now i can
> >>> calculate the login failed times and save it into failed_times table,
> >>> but i am not sure how to lock the sign in account that user can not try
> >>> to login again.
> >>> Any good idea?
>
> >> In the login code just test the count and prevent login if necessary.
>
> >> Colin
>
> > Hi Colin,
>
> > How to prevent login?
>
> Presumably you have some code somewhere that handles the login.  In
> that code test your count.
>
> Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to