fixed Recapcha, thanks Osman Masood

This commit is contained in:
mdipierro
2012-07-27 16:53:34 -05:00
parent 4e50aee372
commit c7ac700355
2 changed files with 14 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.00.0 (2012-07-27 09:32:24) dev
Version 2.00.0 (2012-07-27 16:53:30) dev
+13 -1
View File
@@ -662,13 +662,24 @@ class Mail(object):
class Recaptcha(DIV):
"""
Usage:
form = FORM(Recaptcha(public_key='...',private_key='...'))
or
form = SQLFORM(...)
form.append(Recaptcha(public_key='...',private_key='...'))
"""
API_SSL_SERVER = 'https://www.google.com/recaptcha/api'
API_SERVER = 'http://www.google.com/recaptcha/api'
VERIFY_SERVER = 'http://www.google.com/recaptcha/api/verify'
def __init__(
self,
request,
request=None,
public_key='',
private_key='',
use_ssl=False,
@@ -677,6 +688,7 @@ class Recaptcha(DIV):
label = 'Verify:',
options = ''
):
self.request_vars = request and request.vars or current.request.vars
self.remote_addr = request.env.remote_addr
self.public_key = public_key
self.private_key = private_key