From c600bbc3ab7c6fe22d213108086a44ad8f929ca4 Mon Sep 17 00:00:00 2001 From: fragonib Date: Mon, 30 May 2011 23:29:34 +0200 Subject: Support for positional captchas --- module/web/json_app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/web/json_app.py') diff --git a/module/web/json_app.py b/module/web/json_app.py index 39cd81f5f..4b9c91634 100644 --- a/module/web/json_app.py +++ b/module/web/json_app.py @@ -317,17 +317,17 @@ def edit_package(): def set_captcha(): if request.environ.get('REQUEST_METHOD', "GET") == "POST": try: - PYLOAD.set_captcha_result(request.forms["cap_id"], request.forms["cap_text"]) + PYLOAD.set_captcha_result(request.forms["cap_id"], request.forms["cap_result"]) except: pass - id, binary, typ = PYLOAD.get_captcha_task() + id, binary, format, result_type = PYLOAD.get_captcha_task() if id: binary = base64.standard_b64encode(str(binary)) - src = "data:image/%s;base64,%s" % (typ, binary) + src = "data:image/%s;base64,%s" % (format, binary) - return {'captcha': True, 'src': src, 'id': id} + return {'captcha': True, 'id': id, 'src': src, 'result_type' : result_type} else: return {'captcha': False} -- cgit v1.2.3