예제 #1
0
파일: test.py 프로젝트: keizo/kulu
 def POST(self):
     page = self.page
     i = web.input()
     captcha = recaptcha.submit(i.recaptcha_challenge_field, 
                                 i.recaptcha_response_field, 
                                 private_key, web.ctx.ip)
     content = captcha.is_valid, captcha.error_code
     web.render('generic.html')
예제 #2
0
 def send(options):
   from os import environ
   import recaptcha
   challenge = options['recaptcha_challenge_field']
   response = options['recaptcha_response_field']
   remoteip = environ['REMOTE_ADDR']
   f = open('captcha.key','r')
   cResponse = recaptcha.submit(challenge,response,f.read(),remoteip)
   if cResponse.is_valid and users.get_current_user() != None:
     #send email
     from google.appengine.api import mail
     mail.send_mail(sender=str(users.get_current_user().email()),
         to="Jason Ippitsu3 <*****@*****.**>",
         subject="[IPPITSU3] "+options['subject'],
         body=options['body'])
     return "Success"
   else:
     return "You failed the Turing test"
예제 #3
0
 def check(self, challenge, response, ip):
     res = submit(challenge, response, self.server_key, ip)
     return res.is_valid