Changeset - 70262a0dca6b
[Not reviewed]
default
0 1 0
Patrick Vane - 8 years ago 2018-04-03 16:20:05
patrick_vane@lowentry.com
recpatcha: Drop unused recaptcha code
1 file changed with 0 insertions and 30 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/recaptcha.py
Show inline comments
 
@@ -13,42 +13,12 @@ class RecaptchaResponse(object):
 
        self.error_code = error_code
 

	
 
    def __repr__(self):
 
        return '<RecaptchaResponse:%s>' % (self.is_valid)
 

	
 

	
 
def displayhtml(public_key, use_ssl=False, error=None):
 
    """Gets the HTML to display for reCAPTCHA
 

	
 
    public_key -- The public api key
 
    use_ssl -- Should the request be sent over ssl?
 
    error -- An error message to display (from RecaptchaResponse.error_code)"""
 

	
 
    error_param = ''
 
    if error:
 
        error_param = '&error=%s' % error
 

	
 
    if use_ssl:
 
        server = API_SSL_SERVER
 
    else:
 
        server = API_SERVER
 

	
 
    return """<script type="text/javascript" src="%(ApiServer)s/challenge?k=%(PublicKey)s%(ErrorParam)s"></script>
 

	
 
<noscript>
 
  <iframe src="%(ApiServer)s/noscript?k=%(PublicKey)s%(ErrorParam)s" height="300" width="500" frameborder="0"></iframe><br />
 
  <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
 
  <input type='hidden' name='recaptcha_response_field' value='manual_challenge' />
 
</noscript>
 
""" % {
 
        'ApiServer': server,
 
        'PublicKey': public_key,
 
        'ErrorParam': error_param,
 
    }
 

	
 

	
 
def submit(recaptcha_challenge_field, recaptcha_response_field, private_key,
 
           remoteip):
 
    """
 
    Submits a reCAPTCHA request for verification. Returns RecaptchaResponse
 
    for the request
 

	
0 comments (0 inline, 0 general)