How to refresh the CAPTCHA image for each password attempt

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
hubsun
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 32
Joined: Mon Nov 10, 2008 4:01 am

How to refresh the CAPTCHA image for each password attempt

Post by hubsun » Sun Jun 12, 2011 11:42 pm

Hi,

I want to refresh the CAPTCHA image when the user puts wrong password. Right now when the password is wrong, it will change the image but underlying digits will be same. I want to generate completely new image with different digits for each password attempt. Is it possible to do that?

Thanks in advance,
Regards,
Sunil

User avatar
s_ismail
Commander (CMDR)
Commander (CMDR)
Posts: 162
Joined: Mon Nov 09, 2009 12:20 am
Contact:

Re: How to refresh the CAPTCHA image for each password attempt

Post by s_ismail » Mon Jun 13, 2011 4:28 am

Yes it is possible.
Locate this code in Conlib/LoginDialog.ascx.cs

Code: Select all

InvalidLogin.ErrorMessage += " You have {0} tries remaining.";
                                    InvalidLogin.ErrorMessage = String.Format(InvalidLogin.ErrorMessage, remainingTries);
                                    InvalidLogin.IsValid = false;
and replace with this code

Code: Select all

 InvalidLogin.ErrorMessage += " You have {0} tries remaining.";
                                    InvalidLogin.ErrorMessage = String.Format(InvalidLogin.ErrorMessage, remainingTries);
                                    InvalidLogin.IsValid = false;
                                    RefreshCaptcha();

hubsun
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 32
Joined: Mon Nov 10, 2008 4:01 am

Re: How to refresh the CAPTCHA image for each password attempt

Post by hubsun » Mon Jun 13, 2011 11:45 pm

Thanks Ismail.

Post Reply