Revision #3 was created by zitter on Jun 13, 2012, 10:45:11 AM.
minor formatting changes + references
Content
[...]
Basically, you need three things:
- in the model, you have to add captcha field as a required field in the rules() method
- in the controller, you have to create a different LoginForm model if number of unsuccessfull attempts are greater than <N>**N**
- in the view, you have to show captcha field if number of unsuccessfull attempts are greater than <N>**N**
In the LoginForm model, you can use 'scenario' to set different required fields, so:
- if function *captchaRequired()* returns true create LoginForm with scenario 'captchaRequired', else create LoginForm with default scenario. This is useful because in protected/models/LoginForm.php we have set two different required fields depending on scenario: