Browse Source

Use Captcha in Forgot Password view

sh4nks 9 years ago
parent
commit
bebe6182ff
2 changed files with 7 additions and 0 deletions
  1. 2 0
      flaskbb/auth/forms.py
  2. 5 0
      flaskbb/templates/auth/forgot_password.html

+ 2 - 0
flaskbb/auth/forms.py

@@ -92,6 +92,8 @@ class ForgotPasswordForm(Form):
         DataRequired(message=_("A E-Mail Address is reguired.")),
         DataRequired(message=_("A E-Mail Address is reguired.")),
         Email()])
         Email()])
 
 
+    recaptcha = RecaptchaField(_("Captcha"))
+
     submit = SubmitField(_("Request Password"))
     submit = SubmitField(_("Request Password"))
 
 
 
 

+ 5 - 0
flaskbb/templates/auth/forgot_password.html

@@ -14,6 +14,11 @@
         <form class="form-horizontal" role="form" method="POST">
         <form class="form-horizontal" role="form" method="POST">
             {{ form.hidden_tag() }}
             {{ form.hidden_tag() }}
             {{ horizontal_field(form.email) }}
             {{ horizontal_field(form.email) }}
+
+            {% if flaskbb_config["RECAPTCHA_ENABLED"] %}
+                {{ horizontal_field(form.recaptcha) }}
+            {% endif %}
+
             {{ horizontal_field(form.submit)}}
             {{ horizontal_field(form.submit)}}
         </form>
         </form>
     </div>
     </div>