fixed Recapcha, thanks Osman Masood
This commit is contained in:
@@ -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
@@ -662,13 +662,24 @@ class Mail(object):
|
|||||||
|
|
||||||
class Recaptcha(DIV):
|
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_SSL_SERVER = 'https://www.google.com/recaptcha/api'
|
||||||
API_SERVER = 'http://www.google.com/recaptcha/api'
|
API_SERVER = 'http://www.google.com/recaptcha/api'
|
||||||
VERIFY_SERVER = 'http://www.google.com/recaptcha/api/verify'
|
VERIFY_SERVER = 'http://www.google.com/recaptcha/api/verify'
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
request,
|
request=None,
|
||||||
public_key='',
|
public_key='',
|
||||||
private_key='',
|
private_key='',
|
||||||
use_ssl=False,
|
use_ssl=False,
|
||||||
@@ -677,6 +688,7 @@ class Recaptcha(DIV):
|
|||||||
label = 'Verify:',
|
label = 'Verify:',
|
||||||
options = ''
|
options = ''
|
||||||
):
|
):
|
||||||
|
self.request_vars = request and request.vars or current.request.vars
|
||||||
self.remote_addr = request.env.remote_addr
|
self.remote_addr = request.env.remote_addr
|
||||||
self.public_key = public_key
|
self.public_key = public_key
|
||||||
self.private_key = private_key
|
self.private_key = private_key
|
||||||
|
|||||||
Reference in New Issue
Block a user