Page 1 of 1

How to refresh the CAPTCHA image for each password attempt

Posted: Sun Jun 12, 2011 11:42 pm
by hubsun
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

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

Posted: Mon Jun 13, 2011 4:28 am
by s_ismail
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();

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

Posted: Mon Jun 13, 2011 11:45 pm
by hubsun
Thanks Ismail.